diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..fbf0d398 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI +on: + push: + branches: + - main + pull_request: + branches: + - main + - next + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + if: github.repository == 'lithic-com/lithic-ruby' + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + ruby-version: '3.1' + - run: |- + bundle install + + - name: Run lints + run: ./scripts/lint + test: + name: test + runs-on: ubuntu-latest + if: github.repository == 'lithic-com/lithic-ruby' + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + ruby-version: '3.1' + - run: |- + bundle install + + - name: Run tests + run: ./scripts/test diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 00000000..6ca2127b --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,32 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to rubygems.org in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/lithic-com/lithic-python/actions/workflows/publish-gem.yml +name: Publish Gem +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + ruby-version: '3.1' + - run: |- + bundle install + + - name: Publish to RubyGems.org + run: | + bash ./bin/publish-gem + env: + # `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org + RUBYGEMS_HOST: ${{ secrets.LITHIC_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.LITHIC_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..ae6f51b8 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,22 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'lithic-com/lithic-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + RUBYGEMS_HOST: ${{ secrets.LITHIC_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.LITHIC_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..8b1228a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.gem +.idea/ +.prism.log +.ruby-lsp/ +.yardoc/ +Brewfile.lock.json +bin/tapioca +doc/ +sorbet/* +!/sorbet/config diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..ba6c3483 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0-alpha.1" +} \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..fd51a62d --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,254 @@ +--- +# Explicitly disable pending cops for now. This is the default behaviour but +# this avoids a large warning every time we run it. +# Stop RuboCop nagging about rubocop-rake. +# Ensure that RuboCop validates according to the lowest version of Ruby that we support. +AllCops: + Exclude: + - "bin/*" + NewCops: enable + SuggestExtensions: false + TargetRubyVersion: 3.1.0 + +# Whether MFA is required or not should be left to the token configuration. +Gemspec/RequireMFA: + Enabled: false + +# Don't require this extra line break, it can be excessive. +Layout/EmptyLineAfterGuardClause: + Enabled: false + +# Don't leave complex assignment values hanging off to the right. +Layout/EndAlignment: + EnforcedStyleAlignWith: variable + +Layout/FirstArrayElementLineBreak: + Enabled: true + +Layout/FirstHashElementLineBreak: + Enabled: true + +Layout/FirstMethodArgumentLineBreak: + Enabled: true + +Layout/FirstMethodParameterLineBreak: + Enabled: true + +# Set a reasonable line length; rely on other cops to correct long lines. +Layout/LineLength: + AllowedPatterns: + - "^\\s*#.*$" + - ^require(_relative)? + - "Lithic::(Models|Resources)::" + Max: 110 + +Layout/MultilineArrayLineBreaks: + Enabled: true + +# Start the assignment on the same line variable is mentioned. +Layout/MultilineAssignmentLayout: + EnforcedStyle: same_line + +Layout/MultilineHashKeyLineBreaks: + Enabled: true + +Layout/MultilineMethodArgumentLineBreaks: + Enabled: true + +Layout/MultilineMethodParameterLineBreaks: + Enabled: true + +# Prefer compact hash literals. +Layout/SpaceInsideHashLiteralBraces: + EnforcedStyle: no_space + +# This option occasionally mangles identifier names +Lint/DeprecatedConstants: + Exclude: + - "**/*.rbi" + +# Fairly useful in tests for pattern assertions. +Lint/EmptyInPattern: + Exclude: + - "test/**/*" + +Lint/MissingCopEnableDirective: + Exclude: + - "examples/**/*.rb" + +Lint/MissingSuper: + Exclude: + - "**/*.rbi" + +# Disabled for safety reasons, this option changes code semantics. +Lint/UnusedMethodArgument: + AutoCorrect: false + +# This option is prone to causing accidental bugs. +Lint/UselessAssignment: + AutoCorrect: false + Exclude: + - "examples/**/*.rb" + +Metrics/AbcSize: + Enabled: false + +Metrics/BlockLength: + AllowedPatterns: + - assert_pattern + Exclude: + - "**/*.rbi" + +Metrics/ClassLength: + Enabled: false + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ModuleLength: + Exclude: + - "**/*.rbi" + +Metrics/ParameterLists: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + +Naming/BlockForwarding: + Exclude: + - "**/*.rbi" + +Naming/ClassAndModuleCamelCase: + Exclude: + - "**/*.rbi" + +Naming/MethodParameterName: + Exclude: + - "**/*.rbi" + +Naming/PredicateName: + Exclude: + - "**/*.rbi" + +Naming/VariableNumber: + Enabled: false + +# Nothing wrong with inline private methods. +Style/AccessModifierDeclarations: + Enabled: false + +Style/AccessorGrouping: + Exclude: + - "**/*.rbi" + +# Behaviour of alias_method is more predictable. +Style/Alias: + EnforcedStyle: prefer_alias_method + +# And/or have confusing precedence, avoid them. +Style/AndOr: + EnforcedStyle: always + +Style/BisectedAttrAccessor: + Exclude: + - "**/*.rbi" + +# We prefer nested modules in lib/, but are currently using compact style for tests. +Style/ClassAndModuleChildren: + Exclude: + - "test/**/*" + +# We should go back and add these docs, but ignore for now. +Style/Documentation: + Enabled: false + +# Allow explicit empty elses, for clarity. +Style/EmptyElse: + Enabled: false + +Style/EmptyMethod: + Exclude: + - "**/*.rbi" + +# We commonly use ENV['KEY'], it's OK. +Style/FetchEnvVar: + Enabled: false + +# Just to be safe, ensure nobody is mutating our internal strings. +Style/FrozenStringLiteralComment: + EnforcedStyle: always + Exclude: + - "**/*.rbi" + +# Nothing wrong with clear if statements. +Style/IfUnlessModifier: + Enabled: false + +# Rubocop is pretty bad about mangling single line lambdas. +Style/Lambda: + Enabled: false + +# Prefer consistency in method calling syntax. +Style/MethodCallWithArgsParentheses: + AllowedMethods: + - raise + Enabled: true + Exclude: + - "**/*.gemspec" + +# Perfectly fine. +Style/MultipleComparison: + Enabled: false + +Style/MutableConstant: + Exclude: + - "**/*.rbi" + +# Not all parameters should be named. +Style/NumberedParameters: + Enabled: false + +Style/NumberedParametersLimit: + Max: 2 + +# Reasonable to use brackets for errors with long messages. +Style/RaiseArgs: + Enabled: false + +# Be explicit about `RuntimeError`s. +Style/RedundantException: + Enabled: false + +Style/RedundantInitialize: + Exclude: + - "**/*.rbi" + +# Prefer slashes for regex literals. +Style/RegexpLiteral: + EnforcedStyle: slashes + +# Allow explicit ifs, especially for imperative use. +Style/SafeNavigation: + Enabled: false + +# We use these sparingly, where we anticipate future branches for the +# inner conditional. +Style/SoleNestedConditional: + Enabled: false + +# Prefer double quotes so that interpolation can be easily added. +Style/StringLiterals: + EnforcedStyle: double_quotes + +# Prefer explicit symbols for clarity; you can search for `:the_symbol`. +Style/SymbolArray: + EnforcedStyle: brackets + +# This option makes examples harder to read for ruby novices. +Style/SymbolProc: + Exclude: + - "examples/**/*.rb" diff --git a/.solargraph.yml b/.solargraph.yml new file mode 100644 index 00000000..589df317 --- /dev/null +++ b/.solargraph.yml @@ -0,0 +1,10 @@ +--- +max_files: 0 +include: + - '*.gemspec' + - 'Rakefile' + - 'examples/**/*.rb' + - 'lib/**/*.rb' + - 'test/lithic/test_helper.rb' +exclude: + - 'rbi/**/*' diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 00000000..43a5991d --- /dev/null +++ b/.stats.yml @@ -0,0 +1,2 @@ +configured_endpoints: 156 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic-fe97f820471b725722897539252e7444af7490c5a444a2e9304f5e6eec5513f3.yml diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..c7c3301d --- /dev/null +++ b/.yardopts @@ -0,0 +1,3 @@ +--markup markdown +--exclude /rbi +--exclude /sig diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..086c5623 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +## 0.1.0-alpha.1 (2025-03-26) + +Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/lithic-com/lithic-ruby/compare/v0.0.1-alpha.0...v0.1.0-alpha.1) + +### ⚠ BREAKING CHANGES + +* use tagged enums in sorbet type definitions ([#4](https://github.com/lithic-com/lithic-ruby/issues/4)) +* support `for item in stream` style iteration on `Stream`s ([#1](https://github.com/lithic-com/lithic-ruby/issues/1)) + +### Features + +* consistently accept `AnyHash` types in parameter positions in sorbet ([#9](https://github.com/lithic-com/lithic-ruby/issues/9)) ([834c2d1](https://github.com/lithic-com/lithic-ruby/commit/834c2d14e78c83e2beb2675d7bd4a8da32aca4be)) +* prevent tapioca from introspecting the gem internals ([#8](https://github.com/lithic-com/lithic-ruby/issues/8)) ([c316306](https://github.com/lithic-com/lithic-ruby/commit/c316306e82fd376e92e54844661dc0dc3b901a7f)) +* support `for item in stream` style iteration on `Stream`s ([#1](https://github.com/lithic-com/lithic-ruby/issues/1)) ([00f0df1](https://github.com/lithic-com/lithic-ruby/commit/00f0df1b9d34605a6c40b52dd35ca0603e7876ac)) +* use tagged enums in sorbet type definitions ([#4](https://github.com/lithic-com/lithic-ruby/issues/4)) ([07a5b4d](https://github.com/lithic-com/lithic-ruby/commit/07a5b4dab5793761618a02a0ea791e222973b0f8)) + + +### Bug Fixes + +* pages should be able to accept non-converter models ([#12](https://github.com/lithic-com/lithic-ruby/issues/12)) ([f36c4b6](https://github.com/lithic-com/lithic-ruby/commit/f36c4b62aa3bc4f783110bfd635feba14bb0891e)) +* resolve tapioca derived sorbet errors ([#3](https://github.com/lithic-com/lithic-ruby/issues/3)) ([e5d8b78](https://github.com/lithic-com/lithic-ruby/commit/e5d8b78632b38867f2cfa79aaf1ba06f0a5e0e73)) +* yard example tag formatting ([#6](https://github.com/lithic-com/lithic-ruby/issues/6)) ([b5e3b7f](https://github.com/lithic-com/lithic-ruby/commit/b5e3b7feda9be01ee2026a4093c49e406af67e96)) + + +### Chores + +* `BaseModel` fields that are `BaseModel` typed should also accept `Hash` ([#5](https://github.com/lithic-com/lithic-ruby/issues/5)) ([83a2861](https://github.com/lithic-com/lithic-ruby/commit/83a286144f2469ec0d90c93144201e8626656543)) +* add type annotations for enum and union member listing methods ([#7](https://github.com/lithic-com/lithic-ruby/issues/7)) ([86672a1](https://github.com/lithic-com/lithic-ruby/commit/86672a1faea539aaf14c637f48c63205e8588734)) +* **api:** new attribute targets for Auth Rules and new Financial Account State schema ([#16](https://github.com/lithic-com/lithic-ruby/issues/16)) ([c8ef1a1](https://github.com/lithic-com/lithic-ruby/commit/c8ef1a11fef96c3e806d0a696c8ac901e3eddbdd)) +* disable dangerous rubocop auto correct rule ([#14](https://github.com/lithic-com/lithic-ruby/issues/14)) ([e31dbfb](https://github.com/lithic-com/lithic-ruby/commit/e31dbfb6c109e1777c7ded5d6d6e77ca3293990d)) +* fix typos ([#17](https://github.com/lithic-com/lithic-ruby/issues/17)) ([258055f](https://github.com/lithic-com/lithic-ruby/commit/258055fc6d742413ab4e6dc845d5cdad410f3ce9)) +* more readable output when tests fail ([#15](https://github.com/lithic-com/lithic-ruby/issues/15)) ([f231c30](https://github.com/lithic-com/lithic-ruby/commit/f231c3096d9e666896d514ec6fb9b5863c5acd86)) +* recursively accept `AnyHash` for `BaseModel`s in arrays and hashes ([#10](https://github.com/lithic-com/lithic-ruby/issues/10)) ([8852810](https://github.com/lithic-com/lithic-ruby/commit/8852810fa3e990794d5e655bbfe953132bcb6614)) +* reduce verbosity in type declarations ([#13](https://github.com/lithic-com/lithic-ruby/issues/13)) ([354c40b](https://github.com/lithic-com/lithic-ruby/commit/354c40b1dc4a23446314176f768322ea15d9abc9)) +* switch to prettier looking sorbet annotations ([#11](https://github.com/lithic-com/lithic-ruby/issues/11)) ([80c80b2](https://github.com/lithic-com/lithic-ruby/commit/80c80b2eb0bd921b9a029253484d3bf61724cea2)) diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..b064fc5a --- /dev/null +++ b/Gemfile @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gemspec + +group :development do + gem "async" + gem "minitest" + gem "minitest-focus" + gem "minitest-hooks" + gem "minitest-proveit" + gem "minitest-rg" + gem "rake" + gem "rbs" + gem "rubocop" + gem "sorbet" + gem "steep" + gem "syntax_tree" + # TODO: using a fork for now, the prettier below has a bug + gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main" + gem "tapioca" + gem "webrick" + gem "yard" +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..510d05e9 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,190 @@ +GIT + remote: https://github.com/stainless-api/syntax_tree-rbs.git + revision: 140eb3ba2ff4b959b345ac2a7927cd758a9f1284 + branch: main + specs: + syntax_tree-rbs (1.0.0) + prettier_print + rbs + syntax_tree (>= 2.0.1) + +PATH + remote: . + specs: + lithic (0.1.0.pre.alpha.1) + connection_pool + +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + ast (2.4.2) + async (2.23.0) + console (~> 1.29) + fiber-annotation + io-event (~> 1.9) + metrics (~> 0.12) + traces (~> 0.15) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.9) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + console (1.29.3) + fiber-annotation + fiber-local (~> 1.1) + json + csv (3.3.2) + drb (2.2.1) + erubi (1.13.1) + ffi (1.17.1) + fiber-annotation (0.2.0) + fiber-local (1.1.0) + fiber-storage + fiber-storage (1.0.0) + fileutils (1.7.3) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-event (1.9.0) + json (2.10.1) + language_server-protocol (3.17.0.4) + lint_roller (1.1.0) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.6) + metrics (0.12.1) + minitest (5.25.4) + minitest-focus (1.4.0) + minitest (>= 4, < 6) + minitest-hooks (1.5.2) + minitest (> 5.3) + minitest-proveit (1.0.0) + minitest (> 5, < 7) + minitest-rg (5.3.0) + minitest (~> 5.0) + netrc (0.11.0) + parallel (1.26.3) + parser (3.3.7.1) + ast (~> 2.4.1) + racc + prettier_print (1.2.1) + prism (1.3.0) + racc (1.8.1) + rainbow (3.1.1) + rake (13.2.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rbi (0.2.4) + prism (~> 1.0) + sorbet-runtime (>= 0.5.9204) + rbs (3.8.1) + logger + regexp_parser (2.10.0) + rubocop (1.73.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.1) + parser (>= 3.3.1.0) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + sorbet (0.5.11888) + sorbet-static (= 0.5.11888) + sorbet-runtime (0.5.11888) + sorbet-static (0.5.11888-x86_64-linux) + sorbet-static-and-runtime (0.5.11888) + sorbet (= 0.5.11888) + sorbet-runtime (= 0.5.11888) + spoom (1.5.4) + erubi (>= 1.10.0) + prism (>= 0.28.0) + rbi (>= 0.2.3) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) + steep (1.9.4) + activesupport (>= 5.1) + concurrent-ruby (>= 1.1.10) + csv (>= 3.0.9) + fileutils (>= 1.1.0) + json (>= 2.1.0) + language_server-protocol (>= 3.15, < 4.0) + listen (~> 3.0) + logger (>= 1.3.0) + parser (>= 3.1) + rainbow (>= 2.2.2, < 4.0) + rbs (~> 3.8) + securerandom (>= 0.1) + strscan (>= 1.0.0) + terminal-table (>= 2, < 4) + uri (>= 0.12.0) + strscan (3.1.2) + syntax_tree (6.2.0) + prettier_print (>= 1.2.0) + tapioca (0.16.11) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (~> 0.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.2.0) + thor (>= 1.2.0) + yard-sorbet + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + thor (1.3.2) + traces (0.15.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.6.0) + uri (1.0.3) + webrick (1.9.1) + yard (0.9.37) + yard-sorbet (0.9.0) + sorbet-runtime + yard + +PLATFORMS + x86_64-linux + +DEPENDENCIES + async + lithic! + minitest + minitest-focus + minitest-hooks + minitest-proveit + minitest-rg + rake + rbs + rubocop + sorbet + steep + syntax_tree + syntax_tree-rbs! + tapioca + webrick + yard + +BUNDLED WITH + 2.3.3 diff --git a/LICENSE b/LICENSE index 261eeb9e..06eee64e 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2025 Lithic Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md new file mode 100644 index 00000000..37442bb0 --- /dev/null +++ b/README.md @@ -0,0 +1,168 @@ +# Lithic Ruby API library + +The Lithic Ruby library provides convenient access to the Lithic REST API from any Ruby 3.0.0+ application. + +## Documentation + +Documentation for released of this gem can be found [on RubyDoc](https://gemdocs.org/gems/lithic). + +The underlying REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). + +## Installation + +To use this gem during the beta, install directly from GitHub with Bundler by adding the following to your application's `Gemfile`: + +```ruby +gem "lithic", git: "https://github.com/lithic-com/lithic-ruby", branch: "main" +``` + +To fetch an initial copy of the gem: + +```sh +bundle install +``` + +To update the version used by your application when updates are pushed to GitHub: + +```sh +bundle update lithic +``` + +## Usage + +```ruby +require "bundler/setup" +require "lithic" + +lithic = Lithic::Client.new( + api_key: "My Lithic API Key", # defaults to ENV["LITHIC_API_KEY"] + environment: "sandbox" # defaults to "production" +) + +card = lithic.cards.create(type: "SINGLE_USE") + +puts(card.token) +``` + +### Pagination + +List methods in the Lithic API are paginated. + +This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually: + +```ruby +page = lithic.cards.list + +# Fetch single item from page. +card = page.data[0] +puts(card.product_id) + +# Automatically fetches more pages as needed. +page.auto_paging_each do |card| + puts(card.product_id) +end +``` + +### Errors + +When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Lithic::Error` will be thrown: + +```ruby +begin + card = lithic.cards.create(type: "an_incorrect_type") +rescue Lithic::Error => e + puts(e.status) # 400 +end +``` + +Error codes are as followed: + +| Cause | Error Type | +| ---------------- | -------------------------- | +| HTTP 400 | `BadRequestError` | +| HTTP 401 | `AuthenticationError` | +| HTTP 403 | `PermissionDeniedError` | +| HTTP 404 | `NotFoundError` | +| HTTP 409 | `ConflictError` | +| HTTP 422 | `UnprocessableEntityError` | +| HTTP 429 | `RateLimitError` | +| HTTP >=500 | `InternalServerError` | +| Other HTTP error | `APIStatusError` | +| Timeout | `APITimeoutError` | +| Network error | `APIConnectionError` | + +### Retries + +Certain errors will be automatically retried 2 times by default, with a short exponential backoff. + +Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default. + +You can use the `max_retries` option to configure or disable this: + +```ruby +# Configure the default for all requests: +lithic = Lithic::Client.new( + max_retries: 0 # default is 2 +) + +# Or, configure per-request: +lithic.cards.list(page_size: 10, request_options: {max_retries: 5}) +``` + +### Timeouts + +By default, requests will time out after 60 seconds. + +Timeouts are applied separately to the initial connection and the overall request time, so in some cases a request could wait 2\*timeout seconds before it fails. + +You can use the `timeout` option to configure or disable this: + +```ruby +# Configure the default for all requests: +lithic = Lithic::Client.new( + timeout: nil # default is 60 +) + +# Or, configure per-request: +lithic.cards.list(page_size: 10, request_options: {timeout: 5}) +``` + +## Sorbet Support + +**This library emits an intentional warning under the [`tapioca` toolchain](https://github.com/Shopify/tapioca)**. This is normal, and does not impact functionality. + +This library is written with [Sorbet type definitions](https://sorbet.org/docs/rbi). However, there is no runtime dependency on the `sorbet-runtime`. + +What this means is that while you can use Sorbet to type check your code statically, and benefit from the [Sorbet Language Server](https://sorbet.org/docs/lsp) in your editor, there is no runtime type checking and execution overhead from Sorbet itself. + +Due to limitations with the Sorbet type system, where a method otherwise can take an instance of `Lithic::BaseModel` class, you will need to use the `**` splat operator to pass the arguments: + +Please follow Sorbet's [setup guides](https://sorbet.org/docs/adopting) for best experience. + +```ruby +model = CardCreateParams.new(type: "SINGLE_USE") + +lithic.cards.create(**model) +``` + +## Advanced + +### Concurrency & Connection Pooling + +The `Lithic::Client` instances are thread-safe, and should be re-used across multiple threads. By default, each `Client` have their own HTTP connection pool, with a maximum number of connections equal to thread count. + +When the maximum number of connections has been checked out from the connection pool, the `Client` will wait for an in use connection to become available. The queue time for this mechanism is accounted for by the per-request timeout. + +Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure. + +Currently, `Lithic::Client` instances are only fork-safe if there are no in-flight HTTP requests. + +## Versioning + +This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time. + +This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes. + +## Requirements + +Ruby 3.0.0 or higher. diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..ec881fff --- /dev/null +++ b/Rakefile @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +require "securerandom" +require "shellwords" + +require "minitest/test_task" +require "rake/clean" +require "rubocop/rake_task" + +CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/]) + +xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] + +task(default: [:test]) + +multitask(:test) do + rb = + FileList[ENV.fetch("TEST", "./test/**/*_test.rb")] + .map { "require_relative(#{_1.dump});" } + .join + + ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } +end + +RuboCop::RakeTask.new(:rubocop) do |t| + t.options = %w[--fail-level E] + if ENV.key?("CI") + t.options += %w[--format github] + end +end + +multitask(:ruboformat) do + find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0] + fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --] + sh("#{find.shelljoin} | #{fmt.shelljoin}") +end + +multitask(:syntax_tree) do + find = %w[find ./sig -type f -name *.rbs -print0] + inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? %w[-i''] : %w[-i] + uuid = SecureRandom.uuid + + # `syntax_tree` has trouble with `rbs`'s class & module aliases + + sed = xargs + %w[sed -E] + inplace + %w[-e] + # annotate unprocessable aliases with a unique comment + pre = sed + ["s/(class|module) ([^ ]+) = (.+$)/# \\1 #{uuid}\\n\\2: \\3/", "--"] + fmt = xargs + %w[stree write --plugin=rbs --] + # remove the unique comment and unprocessable aliases to type aliases + subst = <<~SED + s/# (class|module) #{uuid}/\\1/ + t l1 + b + + : l1 + N + s/\\n *([^:]+): (.+)$/ \\1 = \\2/ + SED + # for each line: + # 1. try transform the unique comment into `class | module`, if successful, branch to label `l1`. + # 2. at label `l1`, join previously annotated line with `class | module` information. + pst = sed + [subst, "--"] + + # transform class aliases to type aliases, which syntax tree has no trouble with + sh("#{find.shelljoin} | #{pre.shelljoin}") + # run syntax tree to format `*.rbs` files + sh("#{find.shelljoin} | #{fmt.shelljoin}") + # transform type aliases back to class aliases + sh("#{find.shelljoin} | #{pst.shelljoin}") +end + +multitask(format: [:ruboformat, :syntax_tree]) + +multitask(:steep) do + sh(*%w[steep check]) +end + +multitask(:sorbet) do + sh(*%w[srb typecheck]) +end + +file("sorbet/tapioca") do + sh(*%w[tapioca init]) +end + +multitask(typecheck: [:steep, :sorbet]) +multitask(lint: [:rubocop, :typecheck]) + +multitask(:build) do + sh(*%w[gem build -- lithic.gemspec]) +end + +multitask(release: [:build]) do + sh(*%w[gem push], *FileList["lithic-*.gem"]) +end diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..eae5ea4d --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainless.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Lithic please follow the respective company's security reporting guidelines. + +### Lithic Terms and Policies + +Please contact sdk-feedback@lithic.com for any questions or concerns regarding security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/Steepfile b/Steepfile new file mode 100644 index 00000000..48667fe7 --- /dev/null +++ b/Steepfile @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "yaml" + +target :lib do + configure_code_diagnostics(Steep::Diagnostic::Ruby.strict) + + signature("sig") + + YAML.safe_load_file("./manifest.yaml", symbolize_names: true) => { dependencies: } + # currently these libraries lack the `*.rbs` annotations required by `steep` + stdlibs = dependencies - %w[etc net/http rbconfig set stringio] + + stdlibs.each { library(_1) } +end diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 00000000..78cb96e9 --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${GEM_HOST_API_KEY}" ]; then + errors+=("The LITHIC_GEM_HOST_API_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/bin/publish-gem b/bin/publish-gem new file mode 100644 index 00000000..8444af20 --- /dev/null +++ b/bin/publish-gem @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail + +cd -- "$(dirname -- "$0")/.." + +bundle +find . -maxdepth 1 -type f -name "*.gem" -delete +rake release \ No newline at end of file diff --git a/examples/.keep b/examples/.keep new file mode 100644 index 00000000..d8c73e93 --- /dev/null +++ b/examples/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store example files demonstrating usage of this SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/lib/lithic.rb b/lib/lithic.rb new file mode 100644 index 00000000..196b96c9 --- /dev/null +++ b/lib/lithic.rb @@ -0,0 +1,363 @@ +# frozen_string_literal: true + +# We already ship the preferred sorbet manifests in the package itself. +# `tapioca` currently does not offer us a way to opt out of unnecessary compilation. +if Object.const_defined?(:Tapioca) && caller_locations.any? { _1.path.end_with?("tapioca/cli.rb") } + Warning.warn( + <<~WARN + \n + ⚠️ skipped loading of "lithic" gem under `tapioca`. + + This message is normal and expected if you are running a `tapioca` command, and does not impact `.rbi` generation. + \n + WARN + ) + return +end + +# Standard libraries. +require "cgi" +require "date" +require "erb" +require "etc" +require "json" +require "net/http" +require "pathname" +require "rbconfig" +require "securerandom" +require "set" +require "stringio" +require "time" +require "uri" + +# Gems. +require "connection_pool" + +# Package files. +require_relative "lithic/version" +require_relative "lithic/util" +require_relative "lithic/extern" +require_relative "lithic/base_model" +require_relative "lithic/base_page" +require_relative "lithic/request_options" +require_relative "lithic/errors" +require_relative "lithic/base_client" +require_relative "lithic/pooled_net_requester" +require_relative "lithic/client" +require_relative "lithic/cursor_page" +require_relative "lithic/single_page" +require_relative "lithic/models/payment" +require_relative "lithic/models/three_ds/challenge_response" +require_relative "lithic/models/account" +require_relative "lithic/models/account_financial_account_type" +require_relative "lithic/models/account_holder" +require_relative "lithic/models/account_holder_create_params" +require_relative "lithic/models/account_holder_create_response" +require_relative "lithic/models/account_holder_list_documents_params" +require_relative "lithic/models/account_holder_list_documents_response" +require_relative "lithic/models/account_holder_list_params" +require_relative "lithic/models/account_holder_retrieve_document_params" +require_relative "lithic/models/account_holder_retrieve_params" +require_relative "lithic/models/account_holder_simulate_enrollment_document_review_params" +require_relative "lithic/models/account_holder_simulate_enrollment_review_params" +require_relative "lithic/models/account_holder_simulate_enrollment_review_response" +require_relative "lithic/models/account_holder_update_params" +require_relative "lithic/models/account_holder_update_response" +require_relative "lithic/models/account_holder_upload_document_params" +require_relative "lithic/models/account_list_params" +require_relative "lithic/models/account_retrieve_params" +require_relative "lithic/models/account_retrieve_spend_limits_params" +require_relative "lithic/models/account_spend_limits" +require_relative "lithic/models/account_update_params" +require_relative "lithic/models/address" +require_relative "lithic/models/address_update" +require_relative "lithic/models/aggregate_balance" +require_relative "lithic/models/aggregate_balance_list_params" +require_relative "lithic/models/api_status" +require_relative "lithic/models/auth_rules/auth_rule" +require_relative "lithic/models/auth_rules/auth_rule_condition" +require_relative "lithic/models/auth_rules/conditional_attribute" +require_relative "lithic/models/auth_rules/conditional_block_parameters" +require_relative "lithic/models/auth_rules/v2/backtest_create_params" +require_relative "lithic/models/auth_rules/v2/backtest_create_response" +require_relative "lithic/models/auth_rules/v2/backtest_results" +require_relative "lithic/models/auth_rules/v2/backtest_retrieve_params" +require_relative "lithic/models/auth_rules/v2_apply_params" +require_relative "lithic/models/auth_rules/v2_apply_response" +require_relative "lithic/models/auth_rules/v2_create_params" +require_relative "lithic/models/auth_rules/v2_create_response" +require_relative "lithic/models/auth_rules/v2_delete_params" +require_relative "lithic/models/auth_rules/v2_draft_params" +require_relative "lithic/models/auth_rules/v2_draft_response" +require_relative "lithic/models/auth_rules/v2_list_params" +require_relative "lithic/models/auth_rules/v2_list_response" +require_relative "lithic/models/auth_rules/v2_promote_params" +require_relative "lithic/models/auth_rules/v2_promote_response" +require_relative "lithic/models/auth_rules/v2_report_params" +require_relative "lithic/models/auth_rules/v2_report_response" +require_relative "lithic/models/auth_rules/v2_retrieve_params" +require_relative "lithic/models/auth_rules/v2_retrieve_response" +require_relative "lithic/models/auth_rules/v2_update_params" +require_relative "lithic/models/auth_rules/v2_update_response" +require_relative "lithic/models/auth_rules/velocity_limit_params" +require_relative "lithic/models/auth_rules/velocity_limit_params_period_window" +require_relative "lithic/models/auth_stream_enrollment_retrieve_secret_params" +require_relative "lithic/models/auth_stream_enrollment_rotate_secret_params" +require_relative "lithic/models/auth_stream_secret" +require_relative "lithic/models/balance" +require_relative "lithic/models/balance_list_params" +require_relative "lithic/models/book_transfer_create_params" +require_relative "lithic/models/book_transfer_list_params" +require_relative "lithic/models/book_transfer_response" +require_relative "lithic/models/book_transfer_retrieve_params" +require_relative "lithic/models/book_transfer_reverse_params" +require_relative "lithic/models/card" +require_relative "lithic/models/card_convert_physical_params" +require_relative "lithic/models/card_create_params" +require_relative "lithic/models/card_embed_params" +require_relative "lithic/models/card_list_params" +require_relative "lithic/models/card_program" +require_relative "lithic/models/card_program_list_params" +require_relative "lithic/models/card_program_retrieve_params" +require_relative "lithic/models/card_provision_params" +require_relative "lithic/models/card_provision_response" +require_relative "lithic/models/card_reissue_params" +require_relative "lithic/models/card_renew_params" +require_relative "lithic/models/card_retrieve_params" +require_relative "lithic/models/card_retrieve_spend_limits_params" +require_relative "lithic/models/cards/aggregate_balance_list_params" +require_relative "lithic/models/cards/aggregate_balance_list_response" +require_relative "lithic/models/cards/balance_list_params" +require_relative "lithic/models/cards/balance_list_response" +require_relative "lithic/models/cards/financial_transaction_list_params" +require_relative "lithic/models/cards/financial_transaction_retrieve_params" +require_relative "lithic/models/card_search_by_pan_params" +require_relative "lithic/models/card_spend_limits" +require_relative "lithic/models/card_update_params" +require_relative "lithic/models/carrier" +require_relative "lithic/models/client_api_status_params" +require_relative "lithic/models/credit_products/extended_credit" +require_relative "lithic/models/credit_products/extended_credit_retrieve_params" +require_relative "lithic/models/credit_products/prime_rate_create_params" +require_relative "lithic/models/credit_products/prime_rate_retrieve_params" +require_relative "lithic/models/credit_products/prime_rate_retrieve_response" +require_relative "lithic/models/digital_card_art" +require_relative "lithic/models/digital_card_art_list_params" +require_relative "lithic/models/digital_card_art_retrieve_params" +require_relative "lithic/models/dispute" +require_relative "lithic/models/dispute_create_params" +require_relative "lithic/models/dispute_delete_evidence_params" +require_relative "lithic/models/dispute_delete_params" +require_relative "lithic/models/dispute_evidence" +require_relative "lithic/models/dispute_initiate_evidence_upload_params" +require_relative "lithic/models/dispute_list_evidences_params" +require_relative "lithic/models/dispute_list_params" +require_relative "lithic/models/dispute_retrieve_evidence_params" +require_relative "lithic/models/dispute_retrieve_params" +require_relative "lithic/models/dispute_update_params" +require_relative "lithic/models/document" +require_relative "lithic/models/event" +require_relative "lithic/models/event_list_attempts_params" +require_relative "lithic/models/event_list_params" +require_relative "lithic/models/event_retrieve_params" +require_relative "lithic/models/events/subscription_create_params" +require_relative "lithic/models/events/subscription_delete_params" +require_relative "lithic/models/events/subscription_list_attempts_params" +require_relative "lithic/models/events/subscription_list_params" +require_relative "lithic/models/events/subscription_recover_params" +require_relative "lithic/models/events/subscription_replay_missing_params" +require_relative "lithic/models/events/subscription_retrieve_params" +require_relative "lithic/models/events/subscription_retrieve_secret_params" +require_relative "lithic/models/events/subscription_retrieve_secret_response" +require_relative "lithic/models/events/subscription_rotate_secret_params" +require_relative "lithic/models/events/subscription_send_simulated_example_params" +require_relative "lithic/models/events/subscription_update_params" +require_relative "lithic/models/event_subscription" +require_relative "lithic/models/external_bank_account_address" +require_relative "lithic/models/external_bank_account_create_params" +require_relative "lithic/models/external_bank_account_create_response" +require_relative "lithic/models/external_bank_account_list_params" +require_relative "lithic/models/external_bank_account_list_response" +require_relative "lithic/models/external_bank_account_retrieve_params" +require_relative "lithic/models/external_bank_account_retrieve_response" +require_relative "lithic/models/external_bank_account_retry_micro_deposits_params" +require_relative "lithic/models/external_bank_account_retry_micro_deposits_response" +require_relative "lithic/models/external_bank_account_retry_prenote_params" +require_relative "lithic/models/external_bank_account_retry_prenote_response" +require_relative "lithic/models/external_bank_accounts/micro_deposit_create_params" +require_relative "lithic/models/external_bank_accounts/micro_deposit_create_response" +require_relative "lithic/models/external_bank_account_update_params" +require_relative "lithic/models/external_bank_account_update_response" +require_relative "lithic/models/external_payment" +require_relative "lithic/models/external_payment_cancel_params" +require_relative "lithic/models/external_payment_create_params" +require_relative "lithic/models/external_payment_list_params" +require_relative "lithic/models/external_payment_release_params" +require_relative "lithic/models/external_payment_retrieve_params" +require_relative "lithic/models/external_payment_reverse_params" +require_relative "lithic/models/external_payment_settle_params" +require_relative "lithic/models/financial_account" +require_relative "lithic/models/financial_account_create_params" +require_relative "lithic/models/financial_account_list_params" +require_relative "lithic/models/financial_account_retrieve_params" +require_relative "lithic/models/financial_accounts/balance_list_params" +require_relative "lithic/models/financial_accounts/balance_list_response" +require_relative "lithic/models/financial_accounts/credit_configuration_retrieve_params" +require_relative "lithic/models/financial_accounts/credit_configuration_update_params" +require_relative "lithic/models/financial_accounts/financial_account_credit_config" +require_relative "lithic/models/financial_accounts/statements" +require_relative "lithic/models/financial_accounts/financial_transaction_list_params" +require_relative "lithic/models/financial_accounts/financial_transaction_retrieve_params" +require_relative "lithic/models/financial_accounts/loan_tape" +require_relative "lithic/models/financial_accounts/loan_tape_list_params" +require_relative "lithic/models/financial_accounts/loan_tape_retrieve_params" +require_relative "lithic/models/financial_accounts/statement" +require_relative "lithic/models/financial_accounts/statement_list_params" +require_relative "lithic/models/financial_accounts/statement_retrieve_params" +require_relative "lithic/models/financial_accounts/statements/line_item_list_params" +require_relative "lithic/models/financial_accounts/statements/statement_line_items" +require_relative "lithic/models/financial_account_update_params" +require_relative "lithic/models/financial_account_update_status_params" +require_relative "lithic/models/financial_transaction" +require_relative "lithic/models/instance_financial_account_type" +require_relative "lithic/models/kyb" +require_relative "lithic/models/kyb_business_entity" +require_relative "lithic/models/kyc" +require_relative "lithic/models/kyc_exempt" +require_relative "lithic/models/management_operation_create_params" +require_relative "lithic/models/management_operation_list_params" +require_relative "lithic/models/management_operation_retrieve_params" +require_relative "lithic/models/management_operation_reverse_params" +require_relative "lithic/models/management_operation_transaction" +require_relative "lithic/models/message_attempt" +require_relative "lithic/models/owner_type" +require_relative "lithic/models/payment_create_params" +require_relative "lithic/models/payment_create_response" +require_relative "lithic/models/payment_list_params" +require_relative "lithic/models/payment_retrieve_params" +require_relative "lithic/models/payment_retry_params" +require_relative "lithic/models/payment_retry_response" +require_relative "lithic/models/payment_simulate_action_params" +require_relative "lithic/models/payment_simulate_action_response" +require_relative "lithic/models/payment_simulate_receipt_params" +require_relative "lithic/models/payment_simulate_receipt_response" +require_relative "lithic/models/payment_simulate_release_params" +require_relative "lithic/models/payment_simulate_release_response" +require_relative "lithic/models/payment_simulate_return_params" +require_relative "lithic/models/payment_simulate_return_response" +require_relative "lithic/models/reports/settlement/network_total_list_params" +require_relative "lithic/models/reports/settlement/network_total_list_response" +require_relative "lithic/models/reports/settlement/network_total_retrieve_params" +require_relative "lithic/models/reports/settlement/network_total_retrieve_response" +require_relative "lithic/models/reports/settlement_list_details_params" +require_relative "lithic/models/reports/settlement_summary_params" +require_relative "lithic/models/required_document" +require_relative "lithic/models/responder_endpoint_check_status_params" +require_relative "lithic/models/responder_endpoint_create_params" +require_relative "lithic/models/responder_endpoint_create_response" +require_relative "lithic/models/responder_endpoint_delete_params" +require_relative "lithic/models/responder_endpoint_status" +require_relative "lithic/models/settlement_detail" +require_relative "lithic/models/settlement_report" +require_relative "lithic/models/settlement_summary_details" +require_relative "lithic/models/shipping_address" +require_relative "lithic/models/spend_limit_duration" +require_relative "lithic/models/three_ds/authentication_retrieve_params" +require_relative "lithic/models/three_ds/authentication_retrieve_response" +require_relative "lithic/models/three_ds/authentication_simulate_otp_entry_params" +require_relative "lithic/models/three_ds/authentication_simulate_params" +require_relative "lithic/models/three_ds/authentication_simulate_response" +require_relative "lithic/models/three_ds/challenge_result" +require_relative "lithic/models/three_ds/decisioning_challenge_response_params" +require_relative "lithic/models/three_ds/decisioning_retrieve_secret_params" +require_relative "lithic/models/three_ds/decisioning_retrieve_secret_response" +require_relative "lithic/models/three_ds/decisioning_rotate_secret_params" +require_relative "lithic/models/tokenization" +require_relative "lithic/models/tokenization_activate_params" +require_relative "lithic/models/tokenization_deactivate_params" +require_relative "lithic/models/tokenization_decisioning_retrieve_secret_params" +require_relative "lithic/models/tokenization_decisioning_rotate_secret_params" +require_relative "lithic/models/tokenization_decisioning_rotate_secret_response" +require_relative "lithic/models/tokenization_list_params" +require_relative "lithic/models/tokenization_pause_params" +require_relative "lithic/models/tokenization_resend_activation_code_params" +require_relative "lithic/models/tokenization_retrieve_params" +require_relative "lithic/models/tokenization_retrieve_response" +require_relative "lithic/models/tokenization_secret" +require_relative "lithic/models/tokenization_simulate_params" +require_relative "lithic/models/tokenization_simulate_response" +require_relative "lithic/models/tokenization_unpause_params" +require_relative "lithic/models/tokenization_update_digital_card_art_params" +require_relative "lithic/models/tokenization_update_digital_card_art_response" +require_relative "lithic/models/transaction" +require_relative "lithic/models/transaction_expire_authorization_params" +require_relative "lithic/models/transaction_list_params" +require_relative "lithic/models/transaction_retrieve_params" +require_relative "lithic/models/transactions/enhanced_commercial_data_retrieve_params" +require_relative "lithic/models/transactions/enhanced_commercial_data_retrieve_response" +require_relative "lithic/models/transactions/events/enhanced_commercial_data_retrieve_params" +require_relative "lithic/models/transactions/events/enhanced_data" +require_relative "lithic/models/transaction_simulate_authorization_advice_params" +require_relative "lithic/models/transaction_simulate_authorization_advice_response" +require_relative "lithic/models/transaction_simulate_authorization_params" +require_relative "lithic/models/transaction_simulate_authorization_response" +require_relative "lithic/models/transaction_simulate_clearing_params" +require_relative "lithic/models/transaction_simulate_clearing_response" +require_relative "lithic/models/transaction_simulate_credit_authorization_params" +require_relative "lithic/models/transaction_simulate_credit_authorization_response" +require_relative "lithic/models/transaction_simulate_return_params" +require_relative "lithic/models/transaction_simulate_return_response" +require_relative "lithic/models/transaction_simulate_return_reversal_params" +require_relative "lithic/models/transaction_simulate_return_reversal_response" +require_relative "lithic/models/transaction_simulate_void_params" +require_relative "lithic/models/transaction_simulate_void_response" +require_relative "lithic/models/transfer" +require_relative "lithic/models/transfer_create_params" +require_relative "lithic/models/verification_method" +require_relative "lithic/resources/account_holders" +require_relative "lithic/resources/accounts" +require_relative "lithic/resources/aggregate_balances" +require_relative "lithic/resources/auth_rules" +require_relative "lithic/resources/auth_rules/v2" +require_relative "lithic/resources/auth_rules/v2/backtests" +require_relative "lithic/resources/auth_stream_enrollment" +require_relative "lithic/resources/balances" +require_relative "lithic/resources/book_transfers" +require_relative "lithic/resources/card_programs" +require_relative "lithic/resources/cards" +require_relative "lithic/resources/cards/aggregate_balances" +require_relative "lithic/resources/cards/balances" +require_relative "lithic/resources/cards/financial_transactions" +require_relative "lithic/resources/credit_products" +require_relative "lithic/resources/credit_products/extended_credit" +require_relative "lithic/resources/credit_products/prime_rates" +require_relative "lithic/resources/digital_card_art" +require_relative "lithic/resources/disputes" +require_relative "lithic/resources/events" +require_relative "lithic/resources/events/subscriptions" +require_relative "lithic/resources/external_bank_accounts" +require_relative "lithic/resources/external_bank_accounts/micro_deposits" +require_relative "lithic/resources/external_payments" +require_relative "lithic/resources/financial_accounts" +require_relative "lithic/resources/financial_accounts/balances" +require_relative "lithic/resources/financial_accounts/credit_configuration" +require_relative "lithic/resources/financial_accounts/financial_transactions" +require_relative "lithic/resources/financial_accounts/loan_tapes" +require_relative "lithic/resources/financial_accounts/statements" +require_relative "lithic/resources/financial_accounts/statements/line_items" +require_relative "lithic/resources/management_operations" +require_relative "lithic/resources/payments" +require_relative "lithic/resources/reports" +require_relative "lithic/resources/reports/settlement" +require_relative "lithic/resources/reports/settlement/network_totals" +require_relative "lithic/resources/responder_endpoints" +require_relative "lithic/resources/three_ds" +require_relative "lithic/resources/three_ds/authentication" +require_relative "lithic/resources/three_ds/decisioning" +require_relative "lithic/resources/tokenization_decisioning" +require_relative "lithic/resources/tokenizations" +require_relative "lithic/resources/transactions" +require_relative "lithic/resources/transactions/enhanced_commercial_data" +require_relative "lithic/resources/transactions/events" +require_relative "lithic/resources/transactions/events/enhanced_commercial_data" +require_relative "lithic/resources/transfers" diff --git a/lib/lithic/base_client.rb b/lib/lithic/base_client.rb new file mode 100644 index 00000000..fd66295b --- /dev/null +++ b/lib/lithic/base_client.rb @@ -0,0 +1,457 @@ +# frozen_string_literal: true + +module Lithic + # @api private + # + # @abstract + class BaseClient + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + # rubocop:disable Style/MutableConstant + PLATFORM_HEADERS = + { + "x-stainless-arch" => Lithic::Util.arch, + "x-stainless-lang" => "ruby", + "x-stainless-os" => Lithic::Util.os, + "x-stainless-package-version" => Lithic::VERSION, + "x-stainless-runtime" => ::RUBY_ENGINE, + "x-stainless-runtime-version" => ::RUBY_ENGINE_VERSION + } + # rubocop:enable Style/MutableConstant + + class << self + # @api private + # + # @param req [Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + def validate!(req) + keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] + case req + in Hash + req.each_key do |k| + unless keys.include?(k) + raise ArgumentError.new("Request `req` keys must be one of #{keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `req` must be a Hash or RequestOptions, got #{req.inspect}") + end + end + + # @api private + # + # @param status [Integer] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # + # @return [Boolean] + def should_retry?(status, headers:) + coerced = Lithic::Util.coerce_boolean(headers["x-should-retry"]) + case [coerced, status] + in [true | false, _] + coerced + in [_, 408 | 409 | 429 | (500..)] + # retry on: + # 408: timeouts + # 409: locks + # 429: rate limits + # 500+: unknown errors + true + else + false + end + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param status [Integer] + # + # @param response_headers [Hash{String=>String}, Net::HTTPHeader] + # + # @return [Hash{Symbol=>Object}] + def follow_redirect(request, status:, response_headers:) + method, url, headers = request.fetch_values(:method, :url, :headers) + location = + Kernel.then do + URI.join(url, response_headers["location"]) + rescue ArgumentError + message = "Server responded with status #{status} but no valid location header." + raise Lithic::APIConnectionError.new(url: url, message: message) + end + + request = {**request, url: location} + + case [url.scheme, location.scheme] + in ["https", "http"] + message = "Tried to redirect to a insecure URL" + raise Lithic::APIConnectionError.new(url: url, message: message) + else + nil + end + + # from whatwg fetch spec + case [status, method] + in [301 | 302, :post] | [303, _] + drop = %w[content-encoding content-language content-length content-location content-type] + request = { + **request, + method: method == :head ? :head : :get, + headers: headers.except(*drop), + body: nil + } + else + end + + # from undici + if Lithic::Util.uri_origin(url) != Lithic::Util.uri_origin(location) + drop = %w[authorization cookie host proxy-authorization] + request = {**request, headers: request.fetch(:headers).except(*drop)} + end + + request + end + + # @api private + # + # @param status [Integer, Lithic::APIConnectionError] + # @param stream [Enumerable, nil] + def reap_connection!(status, stream:) + case status + in (..199) | (300..499) + stream&.each { next } + in Lithic::APIConnectionError | (500..) + Lithic::Util.close_fused!(stream) + else + end + end + end + + # @api private + # @return [Lithic::PooledNetRequester] + attr_accessor :requester + + # @api private + # + # @param base_url [String] + # @param timeout [Float] + # @param max_retries [Integer] + # @param initial_retry_delay [Float] + # @param max_retry_delay [Float] + # @param headers [Hash{String=>String, Integer, Array, nil}] + # @param idempotency_header [String, nil] + def initialize( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + @requester = Lithic::PooledNetRequester.new + @headers = Lithic::Util.normalized_headers( + self.class::PLATFORM_HEADERS, + { + "accept" => "application/json", + "content-type" => "application/json" + }, + headers + ) + @base_url = Lithic::Util.parse_uri(base_url) + @idempotency_header = idempotency_header&.to_s&.downcase + @max_retries = max_retries + @timeout = timeout + @initial_retry_delay = initial_retry_delay + @max_retry_delay = max_retry_delay + end + + # @api private + # + # @return [Hash{String=>String}] + private def auth_headers = {} + + # @api private + # + # @return [String] + private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" + + # @api private + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Class, nil] :stream + # + # @option req [Lithic::Converter, Class, nil] :model + # + # @param opts [Hash{Symbol=>Object}] . + # + # @option opts [String, nil] :idempotency_key + # + # @option opts [Hash{String=>Array, String, nil}, nil] :extra_query + # + # @option opts [Hash{String=>String, nil}, nil] :extra_headers + # + # @option opts [Object, nil] :extra_body + # + # @option opts [Integer, nil] :max_retries + # + # @option opts [Float, nil] :timeout + # + # @return [Hash{Symbol=>Object}] + private def build_request(req, opts) + method, uninterpolated_path = req.fetch_values(:method, :path) + + path = Lithic::Util.interpolate_path(uninterpolated_path) + + query = Lithic::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h) + + headers = Lithic::Util.normalized_headers( + @headers, + auth_headers, + req[:headers].to_h, + opts[:extra_headers].to_h + ) + + if @idempotency_header && + !headers.key?(@idempotency_header) && + !Net::HTTP::IDEMPOTENT_METHODS_.include?(method.to_s.upcase) + headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key } + end + + unless headers.key?("x-stainless-retry-count") + headers["x-stainless-retry-count"] = "0" + end + + timeout = opts.fetch(:timeout, @timeout).to_f.clamp((0..)) + unless headers.key?("x-stainless-timeout") || timeout.zero? + headers["x-stainless-timeout"] = timeout.to_s + end + + headers.reject! { |_, v| v.to_s.empty? } + + body = + case method + in :get | :head | :options | :trace + nil + else + Lithic::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) + end + + headers, encoded = Lithic::Util.encode_content(headers, body) + { + method: method, + url: Lithic::Util.join_parsed_uri(@base_url, {**req, path: path, query: query}), + headers: headers, + body: encoded, + max_retries: opts.fetch(:max_retries, @max_retries), + timeout: timeout + } + end + + # @api private + # + # @param headers [Hash{String=>String}] + # @param retry_count [Integer] + # + # @return [Float] + private def retry_delay(headers, retry_count:) + # Non-standard extension + span = Float(headers["retry-after-ms"], exception: false)&.then { _1 / 1000 } + return span if span + + retry_header = headers["retry-after"] + return span if (span = Float(retry_header, exception: false)) + + span = retry_header&.then do + Time.httpdate(_1) - Time.now + rescue ArgumentError + nil + end + return span if span + + scale = retry_count**2 + jitter = 1 - (0.25 * rand) + (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param redirect_count [Integer] + # + # @param retry_count [Integer] + # + # @param send_retry_header [Boolean] + # + # @raise [Lithic::APIError] + # @return [Array(Integer, Net::HTTPResponse, Enumerable)] + private def send_request(request, redirect_count:, retry_count:, send_retry_header:) + url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout) + input = {**request.except(:timeout), deadline: Lithic::Util.monotonic_secs + timeout} + + if send_retry_header + headers["x-stainless-retry-count"] = retry_count.to_s + end + + begin + status, response, stream = @requester.execute(input) + rescue Lithic::APIConnectionError => e + status = e + end + + case status + in ..299 + [status, response, stream] + in 300..399 if redirect_count >= self.class::MAX_REDIRECTS + self.class.reap_connection!(status, stream: stream) + + message = "Failed to complete the request within #{self.class::MAX_REDIRECTS} redirects." + raise Lithic::APIConnectionError.new(url: url, message: message) + in 300..399 + self.class.reap_connection!(status, stream: stream) + + request = self.class.follow_redirect(request, status: status, response_headers: response) + send_request( + request, + redirect_count: redirect_count + 1, + retry_count: retry_count, + send_retry_header: send_retry_header + ) + in Lithic::APIConnectionError if retry_count >= max_retries + raise status + in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: response) + decoded = Kernel.then do + Lithic::Util.decode_content(response, stream: stream, suppress_error: true) + ensure + self.class.reap_connection!(status, stream: stream) + end + + raise Lithic::APIStatusError.for( + url: url, + status: status, + body: decoded, + request: nil, + response: response + ) + in (400..) | Lithic::APIConnectionError + self.class.reap_connection!(status, stream: stream) + + delay = retry_delay(response, retry_count: retry_count) + sleep(delay) + + send_request( + request, + redirect_count: redirect_count, + retry_count: retry_count + 1, + send_retry_header: send_retry_header + ) + end + end + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Class, nil] :stream + # + # @option req [Lithic::Converter, Class, nil] :model + # + # @option req [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :options + # + # @raise [Lithic::APIError] + # @return [Object] + def request(req) + self.class.validate!(req) + model = req.fetch(:model) { Lithic::Unknown } + opts = req[:options].to_h + Lithic::RequestOptions.validate!(opts) + request = build_request(req.except(:options), opts) + url = request.fetch(:url) + + # Don't send the current retry count in the headers if the caller modified the header defaults. + send_retry_header = request.fetch(:headers)["x-stainless-retry-count"] == "0" + status, response, stream = send_request( + request, + redirect_count: 0, + retry_count: 0, + send_retry_header: send_retry_header + ) + + decoded = Lithic::Util.decode_content(response, stream: stream) + case req + in { stream: Class => st } + st.new(model: model, url: url, status: status, response: response, stream: decoded) + in { page: Class => page } + page.new(client: self, req: req, headers: response, page_data: decoded) + else + unwrapped = Lithic::Util.dig(decoded, req[:unwrap]) + Lithic::Converter.coerce(model, unwrapped) + end + end + + # @return [String] + def inspect + # rubocop:disable Layout/LineLength + base_url = Lithic::Util.unparse_uri(@base_url) + "#<#{self.class.name}:0x#{object_id.to_s(16)} base_url=#{base_url} max_retries=#{@max_retries} timeout=#{@timeout}>" + # rubocop:enable Layout/LineLength + end + end +end diff --git a/lib/lithic/base_model.rb b/lib/lithic/base_model.rb new file mode 100644 index 00000000..68b396c0 --- /dev/null +++ b/lib/lithic/base_model.rb @@ -0,0 +1,1212 @@ +# frozen_string_literal: true + +module Lithic + # @api private + module Converter + # rubocop:disable Lint/UnusedMethodArgument + + # @api private + # + # @param value [Object] + # + # @return [Object] + def coerce(value) = value + + # @api private + # + # @param value [Object] + # + # @return [Object] + def dump(value) = value + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) = (raise NotImplementedError) + + # rubocop:enable Lint/UnusedMethodArgument + + class << self + # @api private + # + # @param spec [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [Proc] + def type_info(spec) + case spec + in Hash + type_info(spec.slice(:const, :enum, :union).first&.last) + in Proc + spec + in Lithic::Converter | Module | Symbol + -> { spec } + in true | false + -> { Lithic::BooleanModel } + in NilClass | Integer | Float + -> { spec.class } + end + end + + # @api private + # + # Based on `target`, transform `value` into `target`, to the extent possible: + # + # 1. if the given `value` conforms to `target` already, return the given `value` + # 2. if it's possible and safe to convert the given `value` to `target`, then the + # converted value + # 3. otherwise, the given `value` unaltered + # + # @param target [Lithic::Converter, Class] + # @param value [Object] + # + # @return [Object] + def coerce(target, value) + case target + in Lithic::Converter + target.coerce(value) + in Symbol + case value + in Symbol | String if (val = value.to_sym) == target + val + else + value + end + in Module + case target + in -> { _1 <= NilClass } + nil + in -> { _1 <= Integer } + value.is_a?(Numeric) ? Integer(value) : value + in -> { _1 <= Float } + value.is_a?(Numeric) ? Float(value) : value + in -> { _1 <= Symbol } + value.is_a?(String) ? value.to_sym : value + in -> { _1 <= String } + value.is_a?(Symbol) ? value.to_s : value + in -> { _1 <= Date || _1 <= Time } + value.is_a?(String) ? target.parse(value) : value + in -> { _1 <= IO } + value.is_a?(String) ? StringIO.new(value) : value + else + value + end + end + end + + # @api private + # + # @param target [Lithic::Converter, Class] + # @param value [Object] + # + # @return [Object] + def dump(target, value) + case target + in Lithic::Converter + target.dump(value) + else + value + end + end + + # @api private + # + # The underlying algorithm for computing maximal compatibility is subject to + # future improvements. + # + # Similar to `#.coerce`, used to determine the best union variant to decode into. + # + # 1. determine if strict-ish coercion is possible + # 2. return either result of successful coercion or if loose coercion is possible + # 3. return a score for recursively tallied count for fields that can be coerced + # + # @param target [Lithic::Converter, Class] + # @param value [Object] + # + # @return [Object] + def try_strict_coerce(target, value) + case target + in Lithic::Converter + target.try_strict_coerce(value) + in Symbol + case value + in Symbol | String if (val = value.to_sym) == target + [true, val, 1] + else + [false, false, 0] + end + in Module + case [target, value] + in [-> { _1 <= NilClass }, _] + [true, nil, value.nil? ? 1 : 0] + in [-> { _1 <= Integer }, Numeric] + [true, Integer(value), 1] + in [-> { _1 <= Float }, Numeric] + [true, Float(value), 1] + in [-> { _1 <= Symbol }, String] + [true, value.to_sym, 1] + in [-> { _1 <= String }, Symbol] + [true, value.to_s, 1] + in [-> { _1 <= Date || _1 <= Time }, String] + Kernel.then do + [true, target.parse(value), 1] + rescue ArgumentError + [false, false, 0] + end + in [_, ^target] + [true, value, 1] + else + [false, false, 0] + end + end + end + end + end + + # @api private + # + # @abstract + # + # When we don't know what to expect for the value. + class Unknown + extend Lithic::Converter + + # rubocop:disable Lint/UnusedMethodArgument + + # @param other [Object] + # + # @return [Boolean] + def self.===(other) = true + + # @param other [Object] + # + # @return [Boolean] + def self.==(other) = other.is_a?(Class) && other <= Lithic::Unknown + + class << self + # @!parse + # # @api private + # # + # # @param value [Object] + # # + # # @return [Object] + # def coerce(value) = super + + # @!parse + # # @api private + # # + # # @param value [Object] + # # + # # @return [Object] + # def dump(value) = super + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + # prevent unknown variant from being chosen during the first coercion pass + [false, true, 0] + end + end + + # rubocop:enable Lint/UnusedMethodArgument + end + + # @api private + # + # @abstract + # + # Ruby has no Boolean class; this is something for models to refer to. + class BooleanModel + extend Lithic::Converter + + # @param other [Object] + # + # @return [Boolean] + def self.===(other) = other == true || other == false + + # @param other [Object] + # + # @return [Boolean] + def self.==(other) = other.is_a?(Class) && other <= Lithic::BooleanModel + + class << self + # @!parse + # # @api private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # def coerce(value) = super + + # @!parse + # # @api private + # # + # # @param value [Boolean, Object] + # # + # # @return [Boolean, Object] + # def dump(value) = super + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + case value + in true | false + [true, value, 1] + else + [false, false, 0] + end + end + end + end + + # @api private + # + # A value from among a specified list of options. OpenAPI enum values map to Ruby + # values in the SDK as follows: + # + # 1. boolean => true | false + # 2. integer => Integer + # 3. float => Float + # 4. string => Symbol + # + # We can therefore convert string values to Symbols, but can't convert other + # values safely. + # + # @example + # # `account_financial_account_type` is a `Lithic::Models::AccountFinancialAccountType` + # case account_financial_account_type + # when Lithic::Models::AccountFinancialAccountType::ISSUING + # # ... + # when Lithic::Models::AccountFinancialAccountType::OPERATING + # # ... + # else + # puts(account_financial_account_type) + # end + # + # @example + # case account_financial_account_type + # in :ISSUING + # # ... + # in :OPERATING + # # ... + # else + # puts(account_financial_account_type) + # end + module Enum + include Lithic::Converter + + # All of the valid Symbol values for this enum. + # + # @return [Array] + def values = (@values ||= constants.map { const_get(_1) }) + + # @api private + # + # Guard against thread safety issues by instantiating `@values`. + private def finalize! = values + + # @param other [Object] + # + # @return [Boolean] + def ===(other) = values.include?(other) + + # @param other [Object] + # + # @return [Boolean] + def ==(other) + other.is_a?(Module) && other.singleton_class.ancestors.include?(Lithic::Enum) && other.values.to_set == values.to_set + end + + # @api private + # + # @param value [String, Symbol, Object] + # + # @return [Symbol, Object] + def coerce(value) + case value + in Symbol | String if values.include?(val = value.to_sym) + val + else + value + end + end + + # @!parse + # # @api private + # # + # # @param value [Symbol, Object] + # # + # # @return [Symbol, Object] + # def dump(value) = super + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + return [true, value, 1] if values.include?(value) + + case value + in Symbol | String if values.include?(val = value.to_sym) + [true, val, 1] + else + case [value, values.first] + in [true | false, true | false] | [Integer, Integer] | [Symbol | String, Symbol] + [false, true, 0] + else + [false, false, 0] + end + end + end + end + + # @api private + # + # @example + # # `account_holder_update_response` is a `Lithic::Models::AccountHolderUpdateResponse` + # case account_holder_update_response + # when Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse + # puts(account_holder_update_response.token) + # when Lithic::Models::AccountHolderUpdateResponse::PatchResponse + # puts(account_holder_update_response.address) + # else + # puts(account_holder_update_response) + # end + module Union + include Lithic::Converter + + # @api private + # + # All of the specified variant info for this union. + # + # @return [Array] + private def known_variants = (@known_variants ||= []) + + # @api private + # + # @return [Array] + protected def derefed_variants + @known_variants.map { |key, variant_fn| [key, variant_fn.call] } + end + + # All of the specified variants for this union. + # + # @return [Array] + def variants + derefed_variants.map(&:last) + end + + # @api private + # + # @param property [Symbol] + private def discriminator(property) + case property + in Symbol + @discriminator = property + end + end + + # @api private + # + # @param key [Symbol, Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + private def variant(key, spec = nil) + variant_info = + case key + in Symbol + [key, Lithic::Converter.type_info(spec)] + in Proc | Lithic::Converter | Module | Hash + [nil, Lithic::Converter.type_info(key)] + end + + known_variants << variant_info + end + + # @api private + # + # @param value [Object] + # + # @return [Lithic::Converter, Class, nil] + private def resolve_variant(value) + case [@discriminator, value] + in [_, Lithic::BaseModel] + value.class + in [Symbol, Hash] + key = + if value.key?(@discriminator) + value.fetch(@discriminator) + elsif value.key?((discriminator = @discriminator.to_s)) + value.fetch(discriminator) + end + + key = key.to_sym if key.is_a?(String) + _, resolved = known_variants.find { |k,| k == key } + resolved.nil? ? Lithic::Unknown : resolved.call + else + nil + end + end + + # rubocop:disable Style/HashEachMethods + # rubocop:disable Style/CaseEquality + + # @param other [Object] + # + # @return [Boolean] + def ===(other) + known_variants.any? do |_, variant_fn| + variant_fn.call === other + end + end + + # @param other [Object] + # + # @return [Boolean] + def ==(other) + other.is_a?(Module) && other.singleton_class.ancestors.include?(Lithic::Union) && other.derefed_variants == derefed_variants + end + + # @api private + # + # @param value [Object] + # + # @return [Object] + def coerce(value) + if (variant = resolve_variant(value)) + return Lithic::Converter.coerce(variant, value) + end + + matches = [] + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + + case Lithic::Converter.try_strict_coerce(variant, value) + in [true, coerced, _] + return coerced + in [false, true, score] + matches << [score, variant] + in [false, false, _] + nil + end + end + + _, variant = matches.sort! { _2.first <=> _1.first }.find { |score,| !score.zero? } + variant.nil? ? value : Lithic::Converter.coerce(variant, value) + end + + # @api private + # + # @param value [Object] + # + # @return [Object] + def dump(value) + if (variant = resolve_variant(value)) + return Lithic::Converter.dump(variant, value) + end + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + if variant === value + return Lithic::Converter.dump(variant, value) + end + end + value + end + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + # TODO(ruby) this will result in super linear decoding behaviour for nested unions + # follow up with a decoding context that captures current strictness levels + if (variant = resolve_variant(value)) + return Converter.try_strict_coerce(variant, value) + end + + coercible = false + max_score = 0 + + known_variants.each do |_, variant_fn| + variant = variant_fn.call + + case Lithic::Converter.try_strict_coerce(variant, value) + in [true, coerced, score] + return [true, coerced, score] + in [false, true, score] + coercible = true + max_score = [max_score, score].max + in [false, false, _] + nil + end + end + + [false, coercible, max_score] + end + + # rubocop:enable Style/CaseEquality + # rubocop:enable Style/HashEachMethods + end + + # @api private + # + # @abstract + # + # Array of items of a given type. + class ArrayOf + include Lithic::Converter + + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def self.[](type_info, spec = {}) = new(type_info, spec) + + # @param other [Object] + # + # @return [Boolean] + def ===(other) + type = item_type + case other + in Array + # rubocop:disable Style/CaseEquality + other.all? { type === _1 } + # rubocop:enable Style/CaseEquality + else + false + end + end + + # @param other [Object] + # + # @return [Boolean] + def ==(other) = other.is_a?(Lithic::ArrayOf) && other.item_type == item_type + + # @api private + # + # @param value [Enumerable, Object] + # + # @return [Array, Object] + def coerce(value) + type = item_type + case value + in Enumerable unless value.is_a?(Hash) + value.map { Lithic::Converter.coerce(type, _1) } + else + value + end + end + + # @api private + # + # @param value [Enumerable, Object] + # + # @return [Array, Object] + def dump(value) + type = item_type + case value + in Enumerable unless value.is_a?(Hash) + value.map { Lithic::Converter.dump(type, _1) }.to_a + else + value + end + end + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + case value + in Array + type = item_type + great_success = true + tally = 0 + + mapped = + value.map do |item| + case Lithic::Converter.try_strict_coerce(type, item) + in [true, coerced, score] + tally += score + coerced + in [false, true, score] + great_success = false + tally += score + item + in [false, false, _] + great_success &&= item.nil? + item + end + end + + if great_success + [true, mapped, tally] + else + [false, true, tally] + end + else + [false, false, 0] + end + end + + # @api private + # + # @return [Lithic::Converter, Class] + protected def item_type = @item_type_fn.call + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def initialize(type_info, spec = {}) + @item_type_fn = Lithic::Converter.type_info(type_info || spec) + end + end + + # @api private + # + # @abstract + # + # Hash of items of a given type. + class HashOf + include Lithic::Converter + + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def self.[](type_info, spec = {}) = new(type_info, spec) + + # @param other [Object] + # + # @return [Boolean] + def ===(other) + type = item_type + case other + in Hash + other.all? do |key, val| + case [key, val] + in [Symbol | String, ^type] + true + else + false + end + end + else + false + end + end + + # @param other [Object] + # + # @return [Boolean] + def ==(other) = other.is_a?(Lithic::HashOf) && other.item_type == item_type + + # @api private + # + # @param value [Hash{Object=>Object}, Object] + # + # @return [Hash{Symbol=>Object}, Object] + def coerce(value) + type = item_type + case value + in Hash + value.to_h do |key, val| + coerced = Lithic::Converter.coerce(type, val) + [key.is_a?(String) ? key.to_sym : key, coerced] + end + else + value + end + end + + # @api private + # + # @param value [Hash{Object=>Object}, Object] + # + # @return [Hash{Symbol=>Object}, Object] + def dump(value) + type = item_type + case value + in Hash + value.transform_values do |val| + Lithic::Converter.dump(type, val) + end + else + value + end + end + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + case value + in Hash + type = item_type + great_success = true + tally = 0 + + mapped = + value.transform_values do |val| + case Lithic::Converter.try_strict_coerce(type, val) + in [true, coerced, score] + tally += score + coerced + in [false, true, score] + great_success = false + tally += score + val + in [false, false, _] + great_success &&= val.nil? + val + end + end + + if great_success + [true, mapped, tally] + else + [false, true, tally] + end + else + [false, false, 0] + end + end + + # @api private + # + # @return [Lithic::Converter, Class] + protected def item_type = @item_type_fn.call + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def initialize(type_info, spec = {}) + @item_type_fn = Lithic::Converter.type_info(type_info || spec) + end + end + + # @abstract + # + # @example + # # `address` is a `Lithic::Models::Address` + # address => { + # address1: address1, + # city: city, + # country: country + # } + class BaseModel + extend Lithic::Converter + + class << self + # @api private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + def known_fields + @known_fields ||= (self < Lithic::BaseModel ? superclass.known_fields.dup : {}) + end + + # @api private + # + # @return [Hash{Symbol=>Symbol}] + def reverse_map + @reverse_map ||= (self < Lithic::BaseModel ? superclass.reverse_map.dup : {}) + end + + # @api private + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + def fields + known_fields.transform_values do |field| + {**field.except(:type_fn), type: field.fetch(:type_fn).call} + end + end + + # @api private + # + # @return [Hash{Symbol=>Proc}] + def defaults = (@defaults ||= {}) + + # @api private + # + # @param name_sym [Symbol] + # + # @param required [Boolean] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + private def add_field(name_sym, required:, type_info:, spec:) + type_fn, info = + case type_info + in Proc | Module | Lithic::Converter + [Lithic::Converter.type_info({**spec, union: type_info}), spec] + in Hash + [Lithic::Converter.type_info(type_info), type_info] + end + + fallback = info[:const] + defaults[name_sym] = fallback if required && !info[:nil?] && info.key?(:const) + + key = info[:api_name]&.tap { reverse_map[_1] = name_sym } || name_sym + setter = "#{name_sym}=" + + if known_fields.key?(name_sym) + [name_sym, setter].each { undef_method(_1) } + end + + known_fields[name_sym] = {mode: @mode, key: key, required: required, type_fn: type_fn} + + define_method(setter) do |val| + @data[key] = val + end + + define_method(name_sym) do + field_type = type_fn.call + value = @data.fetch(key) { self.class.defaults[key] } + Lithic::Converter.coerce(field_type, value) + rescue StandardError + name = self.class.name.split("::").last + raise Lithic::ConversionError.new( + "Failed to parse #{name}.#{name_sym} as #{field_type.inspect}. " \ + "To get the unparsed API response, use #{name}[:#{key}]." + ) + end + end + + # @api private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def required(name_sym, type_info, spec = {}) + add_field(name_sym, required: true, type_info: type_info, spec: spec) + end + + # @api private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def optional(name_sym, type_info, spec = {}) + add_field(name_sym, required: false, type_info: type_info, spec: spec) + end + + # @api private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + # + # @param blk [Proc] + private def request_only(&blk) + @mode = :dump + blk.call + ensure + @mode = nil + end + + # @api private + # + # `response_only` attributes are omitted from `.#dump` when making requests + # + # @param blk [Proc] + private def response_only(&blk) + @mode = :coerce + blk.call + ensure + @mode = nil + end + end + + # @param other [Object] + # + # @return [Boolean] + def ==(other) + case other + in Lithic::BaseModel + self.class.fields == other.class.fields && @data == other.to_h + else + false + end + end + + class << self + # @api private + # + # @param value [Lithic::BaseModel, Hash{Object=>Object}, Object] + # + # @return [Lithic::BaseModel, Object] + def coerce(value) + case Lithic::Util.coerce_hash(value) + in Hash => coerced + new(coerced) + else + value + end + end + + # @api private + # + # @param value [Lithic::BaseModel, Object] + # + # @return [Hash{Object=>Object}, Object] + def dump(value) + unless (coerced = Lithic::Util.coerce_hash(value)).is_a?(Hash) + return value + end + + values = coerced.filter_map do |key, val| + name = key.to_sym + case (field = known_fields[name]) + in nil + [name, val] + else + mode, type_fn, api_name = field.fetch_values(:mode, :type_fn, :key) + case mode + in :coerce + next + else + target = type_fn.call + [api_name, Lithic::Converter.dump(target, val)] + end + end + end.to_h + + defaults.each do |key, val| + next if values.key?(key) + + values[key] = val + end + + values + end + + # @api private + # + # @param value [Object] + # + # @return [Array(true, Object, nil), Array(false, Boolean, Integer)] + def try_strict_coerce(value) + case value + in Hash | Lithic::BaseModel + value = value.to_h + else + return [false, false, 0] + end + + keys = value.keys.to_set + great_success = true + tally = 0 + acc = {} + + known_fields.each_value do |field| + mode, required, type_fn, api_name = field.fetch_values(:mode, :required, :type_fn, :key) + keys.delete(api_name) + + case [required && mode != :dump, value.key?(api_name)] + in [_, true] + target = type_fn.call + item = value.fetch(api_name) + case Lithic::Converter.try_strict_coerce(target, item) + in [true, coerced, score] + tally += score + acc[api_name] = coerced + in [false, true, score] + great_success = false + tally += score + acc[api_name] = item + in [false, false, _] + great_success &&= item.nil? + end + in [true, false] + great_success = false + in [false, false] + nil + end + end + + keys.each do |key| + acc[key] = value.fetch(key) + end + + great_success ? [true, new(acc), tally] : [false, true, tally] + end + end + + # Returns the raw value associated with the given key, if found. Otherwise, nil is + # returned. + # + # It is valid to lookup keys that are not in the API spec, for example to access + # undocumented features. This method does not parse response data into + # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. + # + # @param key [Symbol] + # + # @return [Object, nil] + def [](key) + unless key.instance_of?(Symbol) + raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") + end + + @data[key] + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + # + # @return [Hash{Symbol=>Object}] + def to_h = @data + + alias_method :to_hash, :to_h + + # @param keys [Array, nil] + # + # @return [Hash{Symbol=>Object}] + def deconstruct_keys(keys) + (keys || self.class.known_fields.keys).filter_map do |k| + unless self.class.known_fields.key?(k) + next + end + + [k, method(k).call] + end + .to_h + end + + # Create a new instance of a model. + # + # @param data [Hash{Symbol=>Object}, Lithic::BaseModel] + def initialize(data = {}) + case Lithic::Util.coerce_hash(data) + in Hash => coerced + @data = coerced.to_h do |key, value| + name = key.to_sym + mapped = self.class.reverse_map.fetch(name, name) + type = self.class.fields[mapped]&.fetch(:type) + stored = + case [type, value] + in [Module, Hash] if type <= Lithic::BaseModel + type.new(value) + in [Lithic::ArrayOf, Array] | [Lithic::HashOf, Hash] + type.coerce(value) + else + value + end + [name, stored] + end + else + raise ArgumentError.new("Expected a #{Hash} or #{Lithic::BaseModel}, got #{data.inspect}") + end + end + + # @return [String] + def to_s = @data.to_s + + # @return [String] + def inspect + "#<#{self.class.name}:0x#{object_id.to_s(16)} #{deconstruct_keys(nil).map do |k, v| + "#{k}=#{v.inspect}" + end.join(' ')}>" + end + end +end diff --git a/lib/lithic/base_page.rb b/lib/lithic/base_page.rb new file mode 100644 index 00000000..2ec27e61 --- /dev/null +++ b/lib/lithic/base_page.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Lithic + # @example + # if page.has_next? + # page = page.next_page + # end + # + # @example + # page.auto_paging_each do |client| + # puts(client) + # end + # + # @example + # clients = + # page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a + # + # clients => Array + module BasePage + # rubocop:disable Lint/UnusedMethodArgument + + # @return [Boolean] + def next_page? = (raise NotImplementedError) + + # @raise [Lithic::APIError] + # @return [Lithic::BasePage] + def next_page = (raise NotImplementedError) + + # @param blk [Proc] + # + # @return [void] + def auto_paging_each(&) = (raise NotImplementedError) + + # @return [Enumerable] + def to_enum = super(:auto_paging_each) + + alias_method :enum_for, :to_enum + + # @api private + # + # @param client [Lithic::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Object] + def initialize(client:, req:, headers:, page_data:) + @client = client + @req = req + super() + end + + # rubocop:enable Lint/UnusedMethodArgument + end +end diff --git a/lib/lithic/client.rb b/lib/lithic/client.rb new file mode 100644 index 00000000..d9dc6949 --- /dev/null +++ b/lib/lithic/client.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +module Lithic + class Client < Lithic::BaseClient + # Default max number of retries to attempt after a failed retryable request. + DEFAULT_MAX_RETRIES = 2 + + # Default per-request timeout. + DEFAULT_TIMEOUT_IN_SECONDS = 60.0 + + # Default initial retry delay in seconds. + # Overall delay is calculated using exponential backoff + jitter. + DEFAULT_INITIAL_RETRY_DELAY = 0.5 + + # Default max retry delay in seconds. + DEFAULT_MAX_RETRY_DELAY = 8.0 + + # rubocop:disable Style/MutableConstant + # @type [Hash{Symbol=>String}] + ENVIRONMENTS = {production: "https://api.lithic.com", sandbox: "https://sandbox.lithic.com"} + # rubocop:enable Style/MutableConstant + + # @return [String] + attr_reader :api_key + + # @return [Lithic::Resources::Accounts] + attr_reader :accounts + + # @return [Lithic::Resources::AccountHolders] + attr_reader :account_holders + + # @return [Lithic::Resources::AuthRules] + attr_reader :auth_rules + + # @return [Lithic::Resources::AuthStreamEnrollment] + attr_reader :auth_stream_enrollment + + # @return [Lithic::Resources::TokenizationDecisioning] + attr_reader :tokenization_decisioning + + # @return [Lithic::Resources::Tokenizations] + attr_reader :tokenizations + + # @return [Lithic::Resources::Cards] + attr_reader :cards + + # @return [Lithic::Resources::Balances] + attr_reader :balances + + # @return [Lithic::Resources::AggregateBalances] + attr_reader :aggregate_balances + + # @return [Lithic::Resources::Disputes] + attr_reader :disputes + + # @return [Lithic::Resources::Events] + attr_reader :events + + # @return [Lithic::Resources::Transfers] + attr_reader :transfers + + # @return [Lithic::Resources::FinancialAccounts] + attr_reader :financial_accounts + + # @return [Lithic::Resources::Transactions] + attr_reader :transactions + + # @return [Lithic::Resources::ResponderEndpoints] + attr_reader :responder_endpoints + + # @return [Lithic::Resources::ExternalBankAccounts] + attr_reader :external_bank_accounts + + # @return [Lithic::Resources::Payments] + attr_reader :payments + + # @return [Lithic::Resources::ThreeDS] + attr_reader :three_ds + + # @return [Lithic::Resources::Reports] + attr_reader :reports + + # @return [Lithic::Resources::CardPrograms] + attr_reader :card_programs + + # @return [Lithic::Resources::DigitalCardArt] + attr_reader :digital_card_art + + # @return [Lithic::Resources::BookTransfers] + attr_reader :book_transfers + + # @return [Lithic::Resources::CreditProducts] + attr_reader :credit_products + + # @return [Lithic::Resources::ExternalPayments] + attr_reader :external_payments + + # @return [Lithic::Resources::ManagementOperations] + attr_reader :management_operations + + # Status of api + # + # @param params [Lithic::Models::ClientAPIStatusParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::APIStatus] + def api_status(params = {}) + request( + method: :get, + path: "v1/status", + model: Lithic::Models::APIStatus, + options: params[:request_options] + ) + end + + # @api private + # + # @return [Hash{String=>String}] + private def auth_headers + {"authorization" => @api_key} + end + + # Creates and returns a new client for interacting with the API. + # + # @param environment [:production, :sandbox, nil] Specifies the environment to use for the API. + # + # Each environment maps to a different base URL: + # + # - `production` corresponds to `https://api.lithic.com` + # - `sandbox` corresponds to `https://sandbox.lithic.com` + # + # @param base_url [String, nil] Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` + # + # @param api_key [String, nil] Defaults to `ENV["LITHIC_API_KEY"]` + # + # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request. + # + # @param timeout [Float] + # + # @param initial_retry_delay [Float] + # + # @param max_retry_delay [Float] + def initialize( + environment: nil, + base_url: nil, + api_key: ENV["LITHIC_API_KEY"], + max_retries: DEFAULT_MAX_RETRIES, + timeout: DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: DEFAULT_MAX_RETRY_DELAY + ) + case [environment, base_url] + in [Symbol | String, String] + raise ArgumentError.new("both environment and base_url given, expected only one") + in [Symbol | String, nil] + base_url = ENVIRONMENTS.fetch(environment.to_sym) do + raise ArgumentError.new("environment must be one of #{ENVIRONMENTS.keys}, got #{environment}") + end + else + base_url ||= ENVIRONMENTS.fetch(:production) + end + + if api_key.nil? + raise ArgumentError.new("api_key is required") + end + + headers = { + "x-lithic-pagination" => "cursor" + } + + @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, + headers: headers + ) + + @accounts = Lithic::Resources::Accounts.new(client: self) + @account_holders = Lithic::Resources::AccountHolders.new(client: self) + @auth_rules = Lithic::Resources::AuthRules.new(client: self) + @auth_stream_enrollment = Lithic::Resources::AuthStreamEnrollment.new(client: self) + @tokenization_decisioning = Lithic::Resources::TokenizationDecisioning.new(client: self) + @tokenizations = Lithic::Resources::Tokenizations.new(client: self) + @cards = Lithic::Resources::Cards.new(client: self) + @balances = Lithic::Resources::Balances.new(client: self) + @aggregate_balances = Lithic::Resources::AggregateBalances.new(client: self) + @disputes = Lithic::Resources::Disputes.new(client: self) + @events = Lithic::Resources::Events.new(client: self) + @transfers = Lithic::Resources::Transfers.new(client: self) + @financial_accounts = Lithic::Resources::FinancialAccounts.new(client: self) + @transactions = Lithic::Resources::Transactions.new(client: self) + @responder_endpoints = Lithic::Resources::ResponderEndpoints.new(client: self) + @external_bank_accounts = Lithic::Resources::ExternalBankAccounts.new(client: self) + @payments = Lithic::Resources::Payments.new(client: self) + @three_ds = Lithic::Resources::ThreeDS.new(client: self) + @reports = Lithic::Resources::Reports.new(client: self) + @card_programs = Lithic::Resources::CardPrograms.new(client: self) + @digital_card_art = Lithic::Resources::DigitalCardArt.new(client: self) + @book_transfers = Lithic::Resources::BookTransfers.new(client: self) + @credit_products = Lithic::Resources::CreditProducts.new(client: self) + @external_payments = Lithic::Resources::ExternalPayments.new(client: self) + @management_operations = Lithic::Resources::ManagementOperations.new(client: self) + end + end +end diff --git a/lib/lithic/cursor_page.rb b/lib/lithic/cursor_page.rb new file mode 100644 index 00000000..5c8fb1f9 --- /dev/null +++ b/lib/lithic/cursor_page.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +module Lithic + # @example + # if cursor_page.has_next? + # cursor_page = cursor_page.next_page + # end + # + # @example + # cursor_page.auto_paging_each do |account| + # puts(account) + # end + # + # @example + # accounts = + # cursor_page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a + # + # accounts => Array + class CursorPage + include Lithic::BasePage + + # @return [Array, nil] + attr_accessor :data + + # @return [Boolean] + attr_accessor :has_more + + # @api private + # + # @param client [Lithic::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Hash{Symbol=>Object}] + def initialize(client:, req:, headers:, page_data:) + super + model = req.fetch(:model) + + case page_data + in {data: Array | nil => data} + @data = data&.map { Lithic::Converter.coerce(model, _1) } + else + end + + case page_data + in {has_more: true | false => has_more} + @has_more = has_more + else + end + end + + # @return [Boolean] + def next_page? + has_more + end + + # @raise [Lithic::HTTP::Error] + # @return [Lithic::CursorPage] + def next_page + unless next_page? + message = "No more pages available. Please check #next_page? before calling ##{__method__}" + raise RuntimeError.new(message) + end + + req = Lithic::Util.deep_merge(@req, {query: {starting_after: data&.last&.token}}) + @client.request(req) + end + + # @param blk [Proc] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + page = self + loop do + page.data&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} has_more=#{has_more.inspect}>" + end + end +end diff --git a/lib/lithic/errors.rb b/lib/lithic/errors.rb new file mode 100644 index 00000000..d3b26da8 --- /dev/null +++ b/lib/lithic/errors.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +module Lithic + class Error < StandardError + # @!parse + # # @return [StandardError, nil] + # attr_accessor :cause + end + + class ConversionError < Lithic::Error + end + + class APIError < Lithic::Error + # @return [URI::Generic] + attr_accessor :url + + # @return [Integer, nil] + attr_accessor :status + + # @return [Object, nil] + attr_accessor :body + + # @api private + # + # @param url [URI::Generic] + # @param status [Integer, nil] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + @url = url + @status = status + @body = body + @request = request + @response = response + super(message) + end + end + + class APIConnectionError < Lithic::APIError + # @!parse + # # @return [nil] + # attr_accessor :status + + # @!parse + # # @return [nil] + # attr_accessor :body + + # @api private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Connection error." + ) + super + end + end + + class APITimeoutError < Lithic::APIConnectionError + # @api private + # + # @param url [URI::Generic] + # @param status [nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize( + url:, + status: nil, + body: nil, + request: nil, + response: nil, + message: "Request timed out." + ) + super + end + end + + class APIStatusError < Lithic::APIError + # @api private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + # @return [Lithic::APIStatusError] + def self.for(url:, status:, body:, request:, response:, message: nil) + kwargs = {url: url, status: status, body: body, request: request, response: response, message: message} + + case status + in 400 + Lithic::BadRequestError.new(**kwargs) + in 401 + Lithic::AuthenticationError.new(**kwargs) + in 403 + Lithic::PermissionDeniedError.new(**kwargs) + in 404 + Lithic::NotFoundError.new(**kwargs) + in 409 + Lithic::ConflictError.new(**kwargs) + in 422 + Lithic::UnprocessableEntityError.new(**kwargs) + in 429 + Lithic::RateLimitError.new(**kwargs) + in (500..) + Lithic::InternalServerError.new(**kwargs) + else + Lithic::APIStatusError.new(**kwargs) + end + end + + # @!parse + # # @return [Integer] + # attr_accessor :status + + # @api private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize(url:, status:, body:, request:, response:, message: nil) + message ||= {url: url.to_s, status: status, body: body} + super( + url: url, + status: status, + body: body, + request: request, + response: response, + message: message&.to_s + ) + end + end + + class BadRequestError < Lithic::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Lithic::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Lithic::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Lithic::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Lithic::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Lithic::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Lithic::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Lithic::APIStatusError + HTTP_STATUS = (500..) + end +end diff --git a/lib/lithic/extern.rb b/lib/lithic/extern.rb new file mode 100644 index 00000000..35a2c57e --- /dev/null +++ b/lib/lithic/extern.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Lithic + # @api private + module Extern + end +end diff --git a/lib/lithic/models/account.rb b/lib/lithic/models/account.rb new file mode 100644 index 00000000..39f297a6 --- /dev/null +++ b/lib/lithic/models/account.rb @@ -0,0 +1,271 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Account < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the account. This is the same as the + # account_token returned by the enroll endpoint. If using this parameter, do not + # include pagination. + # + # @return [String] + required :token, String + + # @!attribute created + # Timestamp of when the account was created. For accounts created before + # 2023-05-11, this field will be null. + # + # @return [Time, nil] + required :created, Time, nil?: true + + # @!attribute spend_limit + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + # + # @return [Lithic::Models::Account::SpendLimit] + required :spend_limit, -> { Lithic::Models::Account::SpendLimit } + + # @!attribute state + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are also unable to be transitioned to `ACTIVE` or `PAUSED` states. + # `CLOSED` accounts result from failing to pass KYB/KYC or Lithic closing for + # risk/compliance reasons. Please contact + # [support@lithic.com](mailto:support@lithic.com) if you believe this was in + # error. + # + # @return [Symbol, Lithic::Models::Account::State] + required :state, enum: -> { Lithic::Models::Account::State } + + # @!attribute [r] account_holder + # + # @return [Lithic::Models::Account::AccountHolder, nil] + optional :account_holder, -> { Lithic::Models::Account::AccountHolder } + + # @!parse + # # @return [Lithic::Models::Account::AccountHolder] + # attr_writer :account_holder + + # @!attribute [r] auth_rule_tokens + # List of identifiers for the Auth Rule(s) that are applied on the account. This + # field is deprecated and will no longer be populated in the `account_holder` + # object. The key will be removed from the schema in a future release. Use the + # `/auth_rules` endpoints to fetch Auth Rule information instead. + # + # @return [Array, nil] + optional :auth_rule_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :auth_rule_tokens + + # @!attribute [r] cardholder_currency + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @return [String, nil] + optional :cardholder_currency, String + + # @!parse + # # @return [String] + # attr_writer :cardholder_currency + + # @!attribute [r] verification_address + # + # @return [Lithic::Models::Account::VerificationAddress, nil] + optional :verification_address, -> { Lithic::Models::Account::VerificationAddress } + + # @!parse + # # @return [Lithic::Models::Account::VerificationAddress] + # attr_writer :verification_address + + # @!parse + # # @param token [String] + # # @param created [Time, nil] + # # @param spend_limit [Lithic::Models::Account::SpendLimit] + # # @param state [Symbol, Lithic::Models::Account::State] + # # @param account_holder [Lithic::Models::Account::AccountHolder] + # # @param auth_rule_tokens [Array] + # # @param cardholder_currency [String] + # # @param verification_address [Lithic::Models::Account::VerificationAddress] + # # + # def initialize( + # token:, + # created:, + # spend_limit:, + # state:, + # account_holder: nil, + # auth_rule_tokens: nil, + # cardholder_currency: nil, + # verification_address: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class SpendLimit < Lithic::BaseModel + # @!attribute daily + # Daily spend limit (in cents). + # + # @return [Integer] + required :daily, Integer + + # @!attribute lifetime + # Total spend limit over account lifetime (in cents). + # + # @return [Integer] + required :lifetime, Integer + + # @!attribute monthly + # Monthly spend limit (in cents). + # + # @return [Integer] + required :monthly, Integer + + # @!parse + # # Spend limit information for the user containing the daily, monthly, and lifetime + # # spend limit of the account. Any charges to a card owned by this account will be + # # declined once their transaction volume has surpassed the value in the applicable + # # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # # feature is disabled. + # # + # # @param daily [Integer] + # # @param lifetime [Integer] + # # @param monthly [Integer] + # # + # def initialize(daily:, lifetime:, monthly:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are also unable to be transitioned to `ACTIVE` or `PAUSED` states. + # `CLOSED` accounts result from failing to pass KYB/KYC or Lithic closing for + # risk/compliance reasons. Please contact + # [support@lithic.com](mailto:support@lithic.com) if you believe this was in + # error. + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + PAUSED = :PAUSED + CLOSED = :CLOSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class AccountHolder < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String] + required :token, String + + # @!attribute business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Account_token of the enrolled business associated with an + # enrolled AUTHORIZED_USER individual. + # + # @return [String] + required :business_account_token, String + + # @!attribute email + # Email address. + # + # @return [String] + required :email, String + + # @!attribute phone_number + # Phone number of the individual. + # + # @return [String] + required :phone_number, String + + # @!parse + # # @param token [String] + # # @param business_account_token [String] + # # @param email [String] + # # @param phone_number [String] + # # + # def initialize(token:, business_account_token:, email:, phone_number:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # @deprecated + class VerificationAddress < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # City name. + # + # @return [String] + required :city, String + + # @!attribute country + # Country name. Only USA is currently supported. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA postal codes (ZIP codes) are currently supported, + # entered as a five-digit postal code or nine-digit postal code (ZIP+4) using the + # format 12345-1234. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/account_financial_account_type.rb b/lib/lithic/models/account_financial_account_type.rb new file mode 100644 index 00000000..d2908582 --- /dev/null +++ b/lib/lithic/models/account_financial_account_type.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Type of account financial account + module AccountFinancialAccountType + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end +end diff --git a/lib/lithic/models/account_holder.rb b/lib/lithic/models/account_holder.rb new file mode 100644 index 00000000..4d681fb9 --- /dev/null +++ b/lib/lithic/models/account_holder.rb @@ -0,0 +1,801 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolder < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String] + required :token, String + + # @!attribute created + # Timestamp of when the account holder was created. + # + # @return [Time] + required :created, Time + + # @!attribute [r] account_token + # Globally unique identifier for the account. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] beneficial_owner_entities + # Only present when user_type == "BUSINESS". List of all entities with >25% + # ownership in the company. + # + # @return [Array, nil] + optional :beneficial_owner_entities, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolder::BeneficialOwnerEntity] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_entities + + # @!attribute [r] beneficial_owner_individuals + # Only present when user_type == "BUSINESS". List of all individuals with >25% + # ownership in the company. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolder::BeneficialOwnerIndividual] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_individuals + + # @!attribute [r] business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] business_entity + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + # + # @return [Lithic::Models::AccountHolder::BusinessEntity, nil] + optional :business_entity, -> { Lithic::Models::AccountHolder::BusinessEntity } + + # @!parse + # # @return [Lithic::Models::AccountHolder::BusinessEntity] + # attr_writer :business_entity + + # @!attribute [r] control_person + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + # + # @return [Lithic::Models::AccountHolder::ControlPerson, nil] + optional :control_person, -> { Lithic::Models::AccountHolder::ControlPerson } + + # @!parse + # # @return [Lithic::Models::AccountHolder::ControlPerson] + # attr_writer :control_person + + # @!attribute [r] email + # < Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary email of Account Holder. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] exemption_type + # The type of KYC exemption for a KYC-Exempt Account Holder. + # + # @return [Symbol, Lithic::Models::AccountHolder::ExemptionType, nil] + optional :exemption_type, enum: -> { Lithic::Models::AccountHolder::ExemptionType } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolder::ExemptionType] + # attr_writer :exemption_type + + # @!attribute [r] external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] individual + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @return [Lithic::Models::AccountHolder::Individual, nil] + optional :individual, -> { Lithic::Models::AccountHolder::Individual } + + # @!parse + # # @return [Lithic::Models::AccountHolder::Individual] + # attr_writer :individual + + # @!attribute [r] nature_of_business + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + # + # @return [String, nil] + optional :nature_of_business, String + + # @!parse + # # @return [String] + # attr_writer :nature_of_business + + # @!attribute [r] phone_number + # < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary phone of Account Holder, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!attribute [r] required_documents + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::ArrayOf[Lithic::Models::RequiredDocument] } + + # @!parse + # # @return [Array] + # attr_writer :required_documents + + # @!attribute [r] status + # + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolder::Status, nil] + optional :status, enum: -> { Lithic::Models::AccountHolder::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolder::Status] + # attr_writer :status + + # @!attribute [r] status_reasons + # Reason for the + # evaluation status. + # + # @return [Array, nil] + optional :status_reasons, -> { Lithic::ArrayOf[enum: Lithic::Models::AccountHolder::StatusReason] } + + # @!parse + # # @return [Array] + # attr_writer :status_reasons + + # @!attribute [r] user_type + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "beneficial_owner_entities", + # "nature_of_business", and "website_url" attributes will be present. + # + # @return [Symbol, Lithic::Models::AccountHolder::UserType, nil] + optional :user_type, enum: -> { Lithic::Models::AccountHolder::UserType } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolder::UserType] + # attr_writer :user_type + + # @!attribute [r] verification_application + # Information about the most recent identity verification attempt + # + # @return [Lithic::Models::AccountHolder::VerificationApplication, nil] + optional :verification_application, -> { Lithic::Models::AccountHolder::VerificationApplication } + + # @!parse + # # @return [Lithic::Models::AccountHolder::VerificationApplication] + # attr_writer :verification_application + + # @!attribute [r] website_url + # Only present when user_type == "BUSINESS". Business's primary website. + # + # @return [String, nil] + optional :website_url, String + + # @!parse + # # @return [String] + # attr_writer :website_url + + # @!parse + # # @param token [String] + # # @param created [Time] + # # @param account_token [String] + # # @param beneficial_owner_entities [Array] + # # @param beneficial_owner_individuals [Array] + # # @param business_account_token [String] + # # @param business_entity [Lithic::Models::AccountHolder::BusinessEntity] + # # @param control_person [Lithic::Models::AccountHolder::ControlPerson] + # # @param email [String] + # # @param exemption_type [Symbol, Lithic::Models::AccountHolder::ExemptionType] + # # @param external_id [String] + # # @param individual [Lithic::Models::AccountHolder::Individual] + # # @param nature_of_business [String] + # # @param phone_number [String] + # # @param required_documents [Array] + # # @param status [Symbol, Lithic::Models::AccountHolder::Status] + # # @param status_reasons [Array] + # # @param user_type [Symbol, Lithic::Models::AccountHolder::UserType] + # # @param verification_application [Lithic::Models::AccountHolder::VerificationApplication] + # # @param website_url [String] + # # + # def initialize( + # token:, + # created:, + # account_token: nil, + # beneficial_owner_entities: nil, + # beneficial_owner_individuals: nil, + # business_account_token: nil, + # business_entity: nil, + # control_person: nil, + # email: nil, + # exemption_type: nil, + # external_id: nil, + # individual: nil, + # nature_of_business: nil, + # phone_number: nil, + # required_documents: nil, + # status: nil, + # status_reasons: nil, + # user_type: nil, + # verification_application: nil, + # website_url: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class BeneficialOwnerEntity < Lithic::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String] + required :dba_business_name, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::ArrayOf[String] + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!parse + # # @param address [Lithic::Models::Address] + # # @param dba_business_name [String] + # # @param entity_token [String] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param phone_numbers [Array] + # # @param parent_company [String] + # # + # def initialize( + # address:, + # dba_business_name:, + # entity_token:, + # government_id:, + # legal_business_name:, + # phone_numbers:, + # parent_company: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # @!attribute address + # Individual's current address + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. + # + # @return [String] + required :email, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!parse + # # Information about an individual associated with an account holder. A subset of + # # the information provided via KYC. For example, we do not return the government + # # id. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param entity_token [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BusinessEntity < Lithic::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String] + required :dba_business_name, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::ArrayOf[String] + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!parse + # # Only present when user_type == "BUSINESS". Information about the business for + # # which the account is being opened and KYB is being run. + # # + # # @param address [Lithic::Models::Address] + # # @param dba_business_name [String] + # # @param entity_token [String] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param phone_numbers [Array] + # # @param parent_company [String] + # # + # def initialize( + # address:, + # dba_business_name:, + # entity_token:, + # government_id:, + # legal_business_name:, + # phone_numbers:, + # parent_company: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class ControlPerson < Lithic::BaseModel + # @!attribute address + # Individual's current address + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. + # + # @return [String] + required :email, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!parse + # # Only present when user_type == "BUSINESS". An individual with significant + # # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # # Partner, President, Vice President, or Treasurer). This can be an executive, or + # # someone who will have program-wide access to the cards that Lithic will provide. + # # In some cases, this individual could also be a beneficial owner listed above. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param entity_token [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. + module ExemptionType + extend Lithic::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Individual < Lithic::BaseModel + # @!attribute address + # Individual's current address + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. + # + # @return [String] + required :email, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!parse + # # Only present when user_type == "INDIVIDUAL". Information about the individual + # # for which the account is being opened and KYC is being run. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param entity_token [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "beneficial_owner_entities", + # "nature_of_business", and "website_url" attributes will be present. + module UserType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class VerificationApplication < Lithic::BaseModel + # @!attribute [r] created + # Timestamp of when the application was created. + # + # @return [Time, nil] + optional :created, Time + + # @!parse + # # @return [Time] + # attr_writer :created + + # @!attribute [r] status + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolder::VerificationApplication::Status, nil] + optional :status, enum: -> { Lithic::Models::AccountHolder::VerificationApplication::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolder::VerificationApplication::Status] + # attr_writer :status + + # @!attribute [r] status_reasons + # Reason for the evaluation status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::ArrayOf[enum: Lithic::Models::AccountHolder::VerificationApplication::StatusReason] } + + # @!parse + # # @return [Array] + # attr_writer :status_reasons + + # @!attribute [r] updated + # Timestamp of when the application was last updated. + # + # @return [Time, nil] + optional :updated, Time + + # @!parse + # # @return [Time] + # attr_writer :updated + + # @!parse + # # Information about the most recent identity verification attempt + # # + # # @param created [Time] + # # @param status [Symbol, Lithic::Models::AccountHolder::VerificationApplication::Status] + # # @param status_reasons [Array] + # # @param updated [Time] + # # + # def initialize(created: nil, status: nil, status_reasons: nil, updated: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/account_holder_create_params.rb b/lib/lithic/models/account_holder_create_params.rb new file mode 100644 index 00000000..ef65b7b7 --- /dev/null +++ b/lib/lithic/models/account_holder_create_params.rb @@ -0,0 +1,615 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute beneficial_owner_entities + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background. If no business owner is an entity, pass in an + # empty list. However, either this parameter or `beneficial_owner_individuals` + # must be populated. on entities that should be included. + # + # @return [Array] + required :beneficial_owner_entities, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity] } + + # @!attribute beneficial_owner_individuals + # List of all direct and indirect individuals with >25% ownership in the company. + # If no entity or individual owns >25% of the company, and the largest shareholder + # is an individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. If no + # individual is an entity, pass in an empty list. However, either this parameter + # or `beneficial_owner_entities` must be populated. + # + # @return [Array] + required :beneficial_owner_individuals, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::AccountHolderCreateParams::BusinessEntity] + required :business_entity, -> { Lithic::Models::AccountHolderCreateParams::BusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::AccountHolderCreateParams::ControlPerson] + required :control_person, -> { Lithic::Models::AccountHolderCreateParams::ControlPerson } + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). + # + # @return [String] + required :nature_of_business, String + + # @!attribute tos_timestamp + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + # + # @return [String] + required :tos_timestamp, String + + # @!attribute workflow + # Specifies the workflow type. This must be 'KYC_EXEMPT' + # + # @return [Symbol, Lithic::Models::AccountHolderCreateParams::Workflow] + required :workflow, enum: -> { Lithic::Models::AccountHolderCreateParams::Workflow } + + # @!attribute [r] external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] kyb_passed_timestamp + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + # + # @return [String, nil] + optional :kyb_passed_timestamp, String + + # @!parse + # # @return [String] + # attr_writer :kyb_passed_timestamp + + # @!attribute [r] website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!parse + # # @return [String] + # attr_writer :website_url + + # @!attribute individual + # Information on individual for whom the account is being opened and KYC is being + # run. + # + # @return [Lithic::Models::AccountHolderCreateParams::Individual] + required :individual, -> { Lithic::Models::AccountHolderCreateParams::Individual } + + # @!attribute [r] kyc_passed_timestamp + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + # + # @return [String, nil] + optional :kyc_passed_timestamp, String + + # @!parse + # # @return [String] + # attr_writer :kyc_passed_timestamp + + # @!attribute address + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute email + # The KYC Exempt user's email + # + # @return [String] + required :email, String + + # @!attribute first_name + # The KYC Exempt user's first name + # + # @return [String] + required :first_name, String + + # @!attribute kyc_exemption_type + # Specifies the type of KYC Exempt user + # + # @return [Symbol, Lithic::Models::AccountHolderCreateParams::KYCExemptionType] + required :kyc_exemption_type, enum: -> { Lithic::Models::AccountHolderCreateParams::KYCExemptionType } + + # @!attribute last_name + # The KYC Exempt user's last name + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # The KYC Exempt user's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!attribute [r] business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!parse + # # @param beneficial_owner_entities [Array] + # # @param beneficial_owner_individuals [Array] + # # @param business_entity [Lithic::Models::AccountHolderCreateParams::BusinessEntity] + # # @param control_person [Lithic::Models::AccountHolderCreateParams::ControlPerson] + # # @param nature_of_business [String] + # # @param tos_timestamp [String] + # # @param workflow [Symbol, Lithic::Models::AccountHolderCreateParams::Workflow] + # # @param individual [Lithic::Models::AccountHolderCreateParams::Individual] + # # @param address [Lithic::Models::Address] + # # @param email [String] + # # @param first_name [String] + # # @param kyc_exemption_type [Symbol, Lithic::Models::AccountHolderCreateParams::KYCExemptionType] + # # @param last_name [String] + # # @param phone_number [String] + # # @param external_id [String] + # # @param kyb_passed_timestamp [String] + # # @param website_url [String] + # # @param kyc_passed_timestamp [String] + # # @param business_account_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # beneficial_owner_entities:, + # beneficial_owner_individuals:, + # business_entity:, + # control_person:, + # nature_of_business:, + # tos_timestamp:, + # workflow:, + # individual:, + # address:, + # email:, + # first_name:, + # kyc_exemption_type:, + # last_name:, + # phone_number:, + # external_id: nil, + # kyb_passed_timestamp: nil, + # website_url: nil, + # kyc_passed_timestamp: nil, + # business_account_token: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class BeneficialOwnerEntity < Lithic::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::ArrayOf[String] + + # @!attribute [r] dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!parse + # # @return [String] + # attr_writer :dba_business_name + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!parse + # # @param address [Lithic::Models::Address] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param phone_numbers [Array] + # # @param dba_business_name [String] + # # @param parent_company [String] + # # + # def initialize( + # address:, + # government_id:, + # legal_business_name:, + # phone_numbers:, + # dba_business_name: nil, + # parent_company: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # Individuals associated with a KYB application. Phone number is optional. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BusinessEntity < Lithic::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::ArrayOf[String] + + # @!attribute [r] dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!parse + # # @return [String] + # attr_writer :dba_business_name + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!parse + # # Information for business for which the account is being opened and KYB is being + # # run. + # # + # # @param address [Lithic::Models::Address] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param phone_numbers [Array] + # # @param dba_business_name [String] + # # @param parent_company [String] + # # + # def initialize( + # address:, + # government_id:, + # legal_business_name:, + # phone_numbers:, + # dba_business_name: nil, + # parent_company: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class ControlPerson < Lithic::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # An individual with significant responsibility for managing the legal entity + # # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # # Officer, Managing Member, General Partner, President, Vice President, or + # # Treasurer). This can be an executive, or someone who will have program-wide + # # access to the cards that Lithic will provide. In some cases, this individual + # # could also be a beneficial owner listed above. See + # # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # # (Section II) for more background. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + module Workflow + extend Lithic::Enum + + KYC_EXEMPT = :KYC_EXEMPT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Individual < Lithic::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!parse + # # Information on individual for whom the account is being opened and KYC is being + # # run. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Specifies the type of KYC Exempt user + module KYCExemptionType + extend Lithic::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/account_holder_create_response.rb b/lib/lithic/models/account_holder_create_response.rb new file mode 100644 index 00000000..6c501e17 --- /dev/null +++ b/lib/lithic/models/account_holder_create_response.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderCreateResponse < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String] + required :token, String + + # @!attribute account_token + # Globally unique identifier for the account. + # + # @return [String] + required :account_token, String + + # @!attribute status + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderCreateResponse::Status] + required :status, enum: -> { Lithic::Models::AccountHolderCreateResponse::Status } + + # @!attribute status_reasons + # Reason for the evaluation status. + # + # @return [Array] + required :status_reasons, + -> { Lithic::ArrayOf[enum: Lithic::Models::AccountHolderCreateResponse::StatusReason] } + + # @!attribute [r] created + # Timestamp of when the account holder was created. + # + # @return [Time, nil] + optional :created, Time + + # @!parse + # # @return [Time] + # attr_writer :created + + # @!attribute [r] external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] required_documents + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::ArrayOf[Lithic::Models::RequiredDocument] } + + # @!parse + # # @return [Array] + # attr_writer :required_documents + + # @!parse + # # @param token [String] + # # @param account_token [String] + # # @param status [Symbol, Lithic::Models::AccountHolderCreateResponse::Status] + # # @param status_reasons [Array] + # # @param created [Time] + # # @param external_id [String] + # # @param required_documents [Array] + # # + # def initialize( + # token:, + # account_token:, + # status:, + # status_reasons:, + # created: nil, + # external_id: nil, + # required_documents: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/account_holder_list_documents_params.rb b/lib/lithic/models/account_holder_list_documents_params.rb new file mode 100644 index 00000000..9c6b880c --- /dev/null +++ b/lib/lithic/models/account_holder_list_documents_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderListDocumentsParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_holder_list_documents_response.rb b/lib/lithic/models/account_holder_list_documents_response.rb new file mode 100644 index 00000000..fe7921e7 --- /dev/null +++ b/lib/lithic/models/account_holder_list_documents_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderListDocumentsResponse < Lithic::BaseModel + # @!attribute [r] data + # + # @return [Array, nil] + optional :data, -> { Lithic::ArrayOf[Lithic::Models::Document] } + + # @!parse + # # @return [Array] + # attr_writer :data + + # @!parse + # # @param data [Array] + # # + # def initialize(data: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_holder_list_params.rb b/lib/lithic/models/account_holder_list_params.rb new file mode 100644 index 00000000..db92dba3 --- /dev/null +++ b/lib/lithic/models/account_holder_list_params.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] email + # Email address of the account holder. The query must be an exact match, case + # insensitive. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] external_id + # If applicable, represents the external_id associated with the account_holder. + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] first_name + # (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] legal_business_name + # (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!parse + # # @return [String] + # attr_writer :legal_business_name + + # @!attribute [r] limit + # The number of account_holders to limit the response to. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :limit + + # @!attribute [r] phone_number + # Phone number of the account holder. The query must be an exact match. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param begin_ [Time] + # # @param email [String] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param external_id [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param legal_business_name [String] + # # @param limit [Integer] + # # @param phone_number [String] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # email: nil, + # end_: nil, + # ending_before: nil, + # external_id: nil, + # first_name: nil, + # last_name: nil, + # legal_business_name: nil, + # limit: nil, + # phone_number: nil, + # starting_after: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_holder_retrieve_document_params.rb b/lib/lithic/models/account_holder_retrieve_document_params.rb new file mode 100644 index 00000000..50c40b16 --- /dev/null +++ b/lib/lithic/models/account_holder_retrieve_document_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderRetrieveDocumentParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!parse + # # @param account_holder_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(account_holder_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_holder_retrieve_params.rb b/lib/lithic/models/account_holder_retrieve_params.rb new file mode 100644 index 00000000..4b4221dd --- /dev/null +++ b/lib/lithic/models/account_holder_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rb b/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rb new file mode 100644 index 00000000..471566be --- /dev/null +++ b/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderSimulateEnrollmentDocumentReviewParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute document_upload_token + # The account holder document upload which to perform the simulation upon. + # + # @return [String] + required :document_upload_token, String + + # @!attribute status + # An account holder document's upload status for use within the simulation. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status] + required :status, enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status } + + # @!attribute [r] accepted_entity_status_reasons + # A list of status reasons associated with a KYB account holder in PENDING_REVIEW + # + # @return [Array, nil] + optional :accepted_entity_status_reasons, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :accepted_entity_status_reasons + + # @!attribute [r] status_reason + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason, nil] + optional :status_reason, + enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason] + # attr_writer :status_reason + + # @!parse + # # @param document_upload_token [String] + # # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status] + # # @param accepted_entity_status_reasons [Array] + # # @param status_reason [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # document_upload_token:, + # status:, + # accepted_entity_status_reasons: nil, + # status_reason: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # An account holder document's upload status for use within the simulation. + module Status + extend Lithic::Enum + + UPLOADED = :UPLOADED + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + PARTIAL_APPROVAL = :PARTIAL_APPROVAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + module StatusReason + extend Lithic::Enum + + DOCUMENT_MISSING_REQUIRED_DATA = :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY = :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE = :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE = :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD = :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY = :INVALID_ENTITY + DOCUMENT_EXPIRED = :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED = :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON = :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR = :UNKNOWN_ERROR + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/account_holder_simulate_enrollment_review_params.rb b/lib/lithic/models/account_holder_simulate_enrollment_review_params.rb new file mode 100644 index 00000000..6103c8de --- /dev/null +++ b/lib/lithic/models/account_holder_simulate_enrollment_review_params.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderSimulateEnrollmentReviewParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_holder_token + # The account holder which to perform the simulation upon. + # + # @return [String, nil] + optional :account_holder_token, String + + # @!parse + # # @return [String] + # attr_writer :account_holder_token + + # @!attribute [r] status + # An account holder's status for use within the simulation. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status, nil] + optional :status, enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status] + # attr_writer :status + + # @!attribute [r] status_reasons + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::ArrayOf[enum: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason] } + + # @!parse + # # @return [Array] + # attr_writer :status_reasons + + # @!parse + # # @param account_holder_token [String] + # # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status] + # # @param status_reasons [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(account_holder_token: nil, status: nil, status_reasons: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # An account holder's status for use within the simulation. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module StatusReason + extend Lithic::Enum + + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb b/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb new file mode 100644 index 00000000..ce050184 --- /dev/null +++ b/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb @@ -0,0 +1,920 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderSimulateEnrollmentReviewResponse < Lithic::BaseModel + # @!attribute [r] token + # Globally unique identifier for the account holder. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] account_token + # Globally unique identifier for the account. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] beneficial_owner_entities + # Only present when user_type == "BUSINESS". List of all entities with >25% + # ownership in the company. + # + # @return [Array, nil] + optional :beneficial_owner_entities, -> { Lithic::ArrayOf[Lithic::Models::KYBBusinessEntity] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_entities + + # @!attribute [r] beneficial_owner_individuals + # Only present when user_type == "BUSINESS". List of all individuals with >25% + # ownership in the company. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_individuals + + # @!attribute [r] business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] business_entity + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::Models::KYBBusinessEntity } + + # @!parse + # # @return [Lithic::Models::KYBBusinessEntity] + # attr_writer :business_entity + + # @!attribute [r] control_person + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, nil] + optional :control_person, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson } + + # @!parse + # # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson] + # attr_writer :control_person + + # @!attribute [r] created + # Timestamp of when the account holder was created. + # + # @return [Time, nil] + optional :created, Time + + # @!parse + # # @return [Time] + # attr_writer :created + + # @!attribute [r] email + # < Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary email of Account Holder. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] exemption_type + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType, nil] + optional :exemption_type, + enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType] + # attr_writer :exemption_type + + # @!attribute [r] external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] individual + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, nil] + optional :individual, -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual } + + # @!parse + # # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual] + # attr_writer :individual + + # @!attribute [r] nature_of_business + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + # + # @return [String, nil] + optional :nature_of_business, String + + # @!parse + # # @return [String] + # attr_writer :nature_of_business + + # @!attribute [r] phone_number + # < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary phone of Account Holder, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!attribute [r] required_documents + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::ArrayOf[Lithic::Models::RequiredDocument] } + + # @!parse + # # @return [Array] + # attr_writer :required_documents + + # @!attribute [r] status + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status, nil] + optional :status, enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status] + # attr_writer :status + + # @!attribute [r] status_reasons + # Reason for the + # evaluation status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::ArrayOf[enum: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason] } + + # @!parse + # # @return [Array] + # attr_writer :status_reasons + + # @!attribute [r] user_type + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType, nil] + optional :user_type, enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType] + # attr_writer :user_type + + # @!attribute [r] verification_application + # Information about the most recent identity verification attempt + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, nil] + optional :verification_application, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication } + + # @!parse + # # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication] + # attr_writer :verification_application + + # @!attribute [r] website_url + # Only present when user_type == "BUSINESS". Business's primary website. + # + # @return [String, nil] + optional :website_url, String + + # @!parse + # # @return [String] + # attr_writer :website_url + + # @!parse + # # @param token [String] + # # @param account_token [String] + # # @param beneficial_owner_entities [Array] + # # @param beneficial_owner_individuals [Array] + # # @param business_account_token [String] + # # @param business_entity [Lithic::Models::KYBBusinessEntity] + # # @param control_person [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson] + # # @param created [Time] + # # @param email [String] + # # @param exemption_type [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType] + # # @param external_id [String] + # # @param individual [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual] + # # @param nature_of_business [String] + # # @param phone_number [String] + # # @param required_documents [Array] + # # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status] + # # @param status_reasons [Array] + # # @param user_type [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType] + # # @param verification_application [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication] + # # @param website_url [String] + # # + # def initialize( + # token: nil, + # account_token: nil, + # beneficial_owner_entities: nil, + # beneficial_owner_individuals: nil, + # business_account_token: nil, + # business_entity: nil, + # control_person: nil, + # created: nil, + # email: nil, + # exemption_type: nil, + # external_id: nil, + # individual: nil, + # nature_of_business: nil, + # phone_number: nil, + # required_documents: nil, + # status: nil, + # status_reasons: nil, + # user_type: nil, + # verification_application: nil, + # website_url: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class BeneficialOwnerIndividual < Lithic::BaseModel + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address } + + # @!parse + # # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # @param address [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + class ControlPerson < Lithic::BaseModel + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address } + + # @!parse + # # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # Only present when user_type == "BUSINESS". + # # + # # An individual with significant responsibility for managing the legal entity + # # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # # Officer, + # # + # # Managing Member, General Partner, President, Vice President, or Treasurer). This + # # can be an executive, or someone who will have program-wide access + # # + # # to the cards that Lithic will provide. In some cases, this individual could also + # # be a beneficial owner listed above. + # # + # # @param address [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + module ExemptionType + extend Lithic::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Individual < Lithic::BaseModel + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address } + + # @!parse + # # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # Only present when user_type == "INDIVIDUAL". Information about the individual + # # for which the account is being opened and KYC is being run. + # # + # # @param address [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + module UserType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class VerificationApplication < Lithic::BaseModel + # @!attribute created + # Timestamp of when the application was created. + # + # @return [Time] + required :created, Time + + # @!attribute status + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status] + required :status, + enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status } + + # @!attribute status_reasons + # Reason for the evaluation status. + # + # @return [Array] + required :status_reasons, + -> { Lithic::ArrayOf[enum: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason] } + + # @!attribute updated + # Timestamp of when the application was last updated. + # + # @return [Time] + required :updated, Time + + # @!parse + # # Information about the most recent identity verification attempt + # # + # # @param created [Time] + # # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status] + # # @param status_reasons [Array] + # # @param updated [Time] + # # + # def initialize(created:, status:, status_reasons:, updated:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/account_holder_update_params.rb b/lib/lithic/models/account_holder_update_params.rb new file mode 100644 index 00000000..92b706f8 --- /dev/null +++ b/lib/lithic/models/account_holder_update_params.rb @@ -0,0 +1,777 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] beneficial_owner_entities + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background. If no business owner is an entity, pass in an empty + # list. However, either this parameter or `beneficial_owner_individuals` must be + # populated. on entities that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_entities, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_entities + + # @!attribute [r] beneficial_owner_individuals + # List of all individuals with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an + # individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background on individuals that should be included. If no individual + # is an entity, pass in an empty list. However, either this parameter or + # `beneficial_owner_entities` must be populated. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_individuals + + # @!attribute [r] business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::AccountHolderUpdateParams::BusinessEntity, nil] + optional :business_entity, -> { Lithic::Models::AccountHolderUpdateParams::BusinessEntity } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateParams::BusinessEntity] + # attr_writer :business_entity + + # @!attribute [r] control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::AccountHolderUpdateParams::ControlPerson, nil] + optional :control_person, -> { Lithic::Models::AccountHolderUpdateParams::ControlPerson } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateParams::ControlPerson] + # attr_writer :control_person + + # @!attribute [r] external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). + # + # @return [String, nil] + optional :nature_of_business, String + + # @!parse + # # @return [String] + # attr_writer :nature_of_business + + # @!attribute [r] website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!parse + # # @return [String] + # attr_writer :website_url + + # @!attribute [r] individual + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @return [Lithic::Models::AccountHolderUpdateParams::Individual, nil] + optional :individual, -> { Lithic::Models::AccountHolderUpdateParams::Individual } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateParams::Individual] + # attr_writer :individual + + # @!attribute [r] address + # Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::Models::AddressUpdate } + + # @!parse + # # @return [Lithic::Models::AddressUpdate] + # attr_writer :address + + # @!attribute [r] business_account_token + # Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # account holder is associated. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] email + # Allowed for all Account Holders. Account holder's email address. The primary + # purpose of this field is for cardholder identification and verification during + # the digital wallet tokenization process. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] legal_business_name + # Allowed for BYO-KYB. Legal business name of the account holder. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!parse + # # @return [String] + # attr_writer :legal_business_name + + # @!attribute [r] phone_number + # Allowed for all Account Holders. Account holder's phone number, entered in E.164 + # format. The primary purpose of this field is for cardholder identification and + # verification during the digital wallet tokenization process. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # @param beneficial_owner_entities [Array] + # # @param beneficial_owner_individuals [Array] + # # @param business_entity [Lithic::Models::AccountHolderUpdateParams::BusinessEntity] + # # @param control_person [Lithic::Models::AccountHolderUpdateParams::ControlPerson] + # # @param external_id [String] + # # @param nature_of_business [String] + # # @param website_url [String] + # # @param individual [Lithic::Models::AccountHolderUpdateParams::Individual] + # # @param address [Lithic::Models::AddressUpdate] + # # @param business_account_token [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param legal_business_name [String] + # # @param phone_number [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # beneficial_owner_entities: nil, + # beneficial_owner_individuals: nil, + # business_entity: nil, + # control_person: nil, + # external_id: nil, + # nature_of_business: nil, + # website_url: nil, + # individual: nil, + # address: nil, + # business_account_token: nil, + # email: nil, + # first_name: nil, + # last_name: nil, + # legal_business_name: nil, + # phone_number: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class BeneficialOwnerEntity < Lithic::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute [r] address + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::Models::AddressUpdate } + + # @!parse + # # @return [Lithic::Models::AddressUpdate] + # attr_writer :address + + # @!attribute [r] dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!parse + # # @return [String] + # attr_writer :dba_business_name + + # @!attribute [r] government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String, nil] + optional :government_id, String + + # @!parse + # # @return [String] + # attr_writer :government_id + + # @!attribute [r] legal_business_name + # Legal (formal) business name. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!parse + # # @return [String] + # attr_writer :legal_business_name + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!attribute [r] phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array, nil] + optional :phone_numbers, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :phone_numbers + + # @!parse + # # @param entity_token [String] + # # @param address [Lithic::Models::AddressUpdate] + # # @param dba_business_name [String] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param parent_company [String] + # # @param phone_numbers [Array] + # # + # def initialize( + # entity_token:, + # address: nil, + # dba_business_name: nil, + # government_id: nil, + # legal_business_name: nil, + # parent_company: nil, + # phone_numbers: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::Models::AddressUpdate } + + # @!parse + # # @return [Lithic::Models::AddressUpdate] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + request_only do + # @!attribute [r] government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + + # @!parse + # # @return [String] + # attr_writer :government_id + end + + # @!parse + # # Individuals associated with a KYB application. Phone number is optional. + # # + # # @param entity_token [String] + # # @param address [Lithic::Models::AddressUpdate] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize( + # entity_token:, + # address: nil, + # dob: nil, + # email: nil, + # first_name: nil, + # government_id: nil, + # last_name: nil, + # phone_number: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BusinessEntity < Lithic::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute [r] address + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::Models::AddressUpdate } + + # @!parse + # # @return [Lithic::Models::AddressUpdate] + # attr_writer :address + + # @!attribute [r] dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!parse + # # @return [String] + # attr_writer :dba_business_name + + # @!attribute [r] government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String, nil] + optional :government_id, String + + # @!parse + # # @return [String] + # attr_writer :government_id + + # @!attribute [r] legal_business_name + # Legal (formal) business name. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!parse + # # @return [String] + # attr_writer :legal_business_name + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!attribute [r] phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array, nil] + optional :phone_numbers, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :phone_numbers + + # @!parse + # # Information for business for which the account is being opened and KYB is being + # # run. + # # + # # @param entity_token [String] + # # @param address [Lithic::Models::AddressUpdate] + # # @param dba_business_name [String] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param parent_company [String] + # # @param phone_numbers [Array] + # # + # def initialize( + # entity_token:, + # address: nil, + # dba_business_name: nil, + # government_id: nil, + # legal_business_name: nil, + # parent_company: nil, + # phone_numbers: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class ControlPerson < Lithic::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::Models::AddressUpdate } + + # @!parse + # # @return [Lithic::Models::AddressUpdate] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + request_only do + # @!attribute [r] government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + + # @!parse + # # @return [String] + # attr_writer :government_id + end + + # @!parse + # # An individual with significant responsibility for managing the legal entity + # # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # # Officer, Managing Member, General Partner, President, Vice President, or + # # Treasurer). This can be an executive, or someone who will have program-wide + # # access to the cards that Lithic will provide. In some cases, this individual + # # could also be a beneficial owner listed above. See + # # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # # (Section II) for more background. + # # + # # @param entity_token [String] + # # @param address [Lithic::Models::AddressUpdate] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize( + # entity_token:, + # address: nil, + # dob: nil, + # email: nil, + # first_name: nil, + # government_id: nil, + # last_name: nil, + # phone_number: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Individual < Lithic::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::Models::AddressUpdate } + + # @!parse + # # @return [Lithic::Models::AddressUpdate] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + request_only do + # @!attribute [r] government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + + # @!parse + # # @return [String] + # attr_writer :government_id + end + + # @!parse + # # Information on the individual for whom the account is being opened and KYC is + # # being run. + # # + # # @param entity_token [String] + # # @param address [Lithic::Models::AddressUpdate] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize( + # entity_token:, + # address: nil, + # dob: nil, + # email: nil, + # first_name: nil, + # government_id: nil, + # last_name: nil, + # phone_number: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/account_holder_update_response.rb b/lib/lithic/models/account_holder_update_response.rb new file mode 100644 index 00000000..f15c2242 --- /dev/null +++ b/lib/lithic/models/account_holder_update_response.rb @@ -0,0 +1,1104 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AccountHolderUpdateResponse + extend Lithic::Union + + variant -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse } + + variant -> { Lithic::Models::AccountHolderUpdateResponse::PatchResponse } + + class KYBKYCPatchResponse < Lithic::BaseModel + # @!attribute [r] token + # Globally unique identifier for the account holder. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] account_token + # Globally unique identifier for the account. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] beneficial_owner_entities + # Only present when user_type == "BUSINESS". List of all entities with >25% + # ownership in the company. + # + # @return [Array, nil] + optional :beneficial_owner_entities, -> { Lithic::ArrayOf[Lithic::Models::KYBBusinessEntity] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_entities + + # @!attribute [r] beneficial_owner_individuals + # Only present when user_type == "BUSINESS". List of all individuals with >25% + # ownership in the company. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::ArrayOf[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual] } + + # @!parse + # # @return [Array] + # attr_writer :beneficial_owner_individuals + + # @!attribute [r] business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] business_entity + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::Models::KYBBusinessEntity } + + # @!parse + # # @return [Lithic::Models::KYBBusinessEntity] + # attr_writer :business_entity + + # @!attribute [r] control_person + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, nil] + optional :control_person, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson] + # attr_writer :control_person + + # @!attribute [r] created + # Timestamp of when the account holder was created. + # + # @return [Time, nil] + optional :created, Time + + # @!parse + # # @return [Time] + # attr_writer :created + + # @!attribute [r] email + # < Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary email of Account Holder. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] exemption_type + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType, nil] + optional :exemption_type, + enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType] + # attr_writer :exemption_type + + # @!attribute [r] external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] individual + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, nil] + optional :individual, -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual] + # attr_writer :individual + + # @!attribute [r] nature_of_business + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + # + # @return [String, nil] + optional :nature_of_business, String + + # @!parse + # # @return [String] + # attr_writer :nature_of_business + + # @!attribute [r] phone_number + # < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary phone of Account Holder, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!attribute [r] required_documents + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::ArrayOf[Lithic::Models::RequiredDocument] } + + # @!parse + # # @return [Array] + # attr_writer :required_documents + + # @!attribute [r] status + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status, nil] + optional :status, enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status] + # attr_writer :status + + # @!attribute [r] status_reasons + # Reason for the + # evaluation status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::ArrayOf[enum: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason] } + + # @!parse + # # @return [Array] + # attr_writer :status_reasons + + # @!attribute [r] user_type + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType, nil] + optional :user_type, + enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType] + # attr_writer :user_type + + # @!attribute [r] verification_application + # Information about the most recent identity verification attempt + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, nil] + optional :verification_application, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication] + # attr_writer :verification_application + + # @!attribute [r] website_url + # Only present when user_type == "BUSINESS". Business's primary website. + # + # @return [String, nil] + optional :website_url, String + + # @!parse + # # @return [String] + # attr_writer :website_url + + # @!parse + # # @param token [String] + # # @param account_token [String] + # # @param beneficial_owner_entities [Array] + # # @param beneficial_owner_individuals [Array] + # # @param business_account_token [String] + # # @param business_entity [Lithic::Models::KYBBusinessEntity] + # # @param control_person [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson] + # # @param created [Time] + # # @param email [String] + # # @param exemption_type [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType] + # # @param external_id [String] + # # @param individual [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual] + # # @param nature_of_business [String] + # # @param phone_number [String] + # # @param required_documents [Array] + # # @param status [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status] + # # @param status_reasons [Array] + # # @param user_type [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType] + # # @param verification_application [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication] + # # @param website_url [String] + # # + # def initialize( + # token: nil, + # account_token: nil, + # beneficial_owner_entities: nil, + # beneficial_owner_individuals: nil, + # business_account_token: nil, + # business_entity: nil, + # control_person: nil, + # created: nil, + # email: nil, + # exemption_type: nil, + # external_id: nil, + # individual: nil, + # nature_of_business: nil, + # phone_number: nil, + # required_documents: nil, + # status: nil, + # status_reasons: nil, + # user_type: nil, + # verification_application: nil, + # website_url: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class BeneficialOwnerIndividual < Lithic::BaseModel + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # @param address [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + class ControlPerson < Lithic::BaseModel + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # Only present when user_type == "BUSINESS". + # # + # # An individual with significant responsibility for managing the legal entity + # # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # # Officer, + # # + # # Managing Member, General Partner, President, Vice President, or Treasurer). This + # # can be an executive, or someone who will have program-wide access + # # + # # to the cards that Lithic will provide. In some cases, this individual could also + # # be a beneficial owner listed above. + # # + # # @param address [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + module ExemptionType + extend Lithic::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Individual < Lithic::BaseModel + # @!attribute [r] address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address] + # attr_writer :address + + # @!attribute [r] dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!parse + # # @return [String] + # attr_writer :dob + + # @!attribute [r] email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # Only present when user_type == "INDIVIDUAL". Information about the individual + # # for which the account is being opened and KYC is being run. + # # + # # @param address [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + module UserType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class VerificationApplication < Lithic::BaseModel + # @!attribute created + # Timestamp of when the application was created. + # + # @return [Time] + required :created, Time + + # @!attribute status + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status] + required :status, + enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status } + + # @!attribute status_reasons + # Reason for the evaluation status. + # + # @return [Array] + required :status_reasons, + -> do + Lithic::ArrayOf[ + enum: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason + ] + end + + # @!attribute updated + # Timestamp of when the application was last updated. + # + # @return [Time] + required :updated, Time + + # @!parse + # # Information about the most recent identity verification attempt + # # + # # @param created [Time] + # # @param status [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status] + # # @param status_reasons [Array] + # # @param updated [Time] + # # + # def initialize(created:, status:, status_reasons:, updated:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + + class PatchResponse < Lithic::BaseModel + # @!attribute [r] token + # The token for the account holder that was updated + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] address + # The address for the account holder + # + # @return [Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, nil] + optional :address, -> { Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address } + + # @!parse + # # @return [Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address] + # attr_writer :address + + # @!attribute [r] business_account_token + # The token for the business account that the account holder is associated with + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] email + # The email for the account holder + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] first_name + # The first name for the account holder + # + # @return [String, nil] + optional :first_name, String + + # @!parse + # # @return [String] + # attr_writer :first_name + + # @!attribute [r] last_name + # The last name for the account holder + # + # @return [String, nil] + optional :last_name, String + + # @!parse + # # @return [String] + # attr_writer :last_name + + # @!attribute [r] legal_business_name + # The legal business name for the account holder + # + # @return [String, nil] + optional :legal_business_name, String + + # @!parse + # # @return [String] + # attr_writer :legal_business_name + + # @!attribute [r] phone_number + # The phone_number for the account holder + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # @param token [String] + # # @param address [Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address] + # # @param business_account_token [String] + # # @param email [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param legal_business_name [String] + # # @param phone_number [String] + # # + # def initialize( + # token: nil, + # address: nil, + # business_account_token: nil, + # email: nil, + # first_name: nil, + # last_name: nil, + # legal_business_name: nil, + # phone_number: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # The address for the account holder + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + # @!parse + # # @return [Array(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, Lithic::Models::AccountHolderUpdateResponse::PatchResponse)] + # def self.variants; end + end + end +end diff --git a/lib/lithic/models/account_holder_upload_document_params.rb b/lib/lithic/models/account_holder_upload_document_params.rb new file mode 100644 index 00000000..41e5c661 --- /dev/null +++ b/lib/lithic/models/account_holder_upload_document_params.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderUploadDocumentParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute document_type + # The type of document to upload + # + # @return [Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType] + required :document_type, enum: -> { Lithic::Models::AccountHolderUploadDocumentParams::DocumentType } + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!parse + # # @param document_type [Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType] + # # @param entity_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(document_type:, entity_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The type of document to upload + module DocumentType + extend Lithic::Enum + + EIN_LETTER = :EIN_LETTER + TAX_RETURN = :TAX_RETURN + OPERATING_AGREEMENT = :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION = :CERTIFICATE_OF_FORMATION + DRIVERS_LICENSE = :DRIVERS_LICENSE + PASSPORT = :PASSPORT + PASSPORT_CARD = :PASSPORT_CARD + CERTIFICATE_OF_GOOD_STANDING = :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION = :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION = :ARTICLES_OF_ORGANIZATION + BYLAWS = :BYLAWS + GOVERNMENT_BUSINESS_LICENSE = :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT = :PARTNERSHIP_AGREEMENT + SS4_FORM = :SS4_FORM + BANK_STATEMENT = :BANK_STATEMENT + UTILITY_BILL_STATEMENT = :UTILITY_BILL_STATEMENT + SSN_CARD = :SSN_CARD + ITIN_LETTER = :ITIN_LETTER + FINCEN_BOI_REPORT = :FINCEN_BOI_REPORT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/account_list_params.rb b/lib/lithic/models/account_list_params.rb new file mode 100644 index 00000000..f279df15 --- /dev/null +++ b/lib/lithic/models/account_list_params.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_retrieve_params.rb b/lib/lithic/models/account_retrieve_params.rb new file mode 100644 index 00000000..da0142b2 --- /dev/null +++ b/lib/lithic/models/account_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_retrieve_spend_limits_params.rb b/lib/lithic/models/account_retrieve_spend_limits_params.rb new file mode 100644 index 00000000..3ad74d03 --- /dev/null +++ b/lib/lithic/models/account_retrieve_spend_limits_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountRetrieveSpendLimitsParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/account_spend_limits.rb b/lib/lithic/models/account_spend_limits.rb new file mode 100644 index 00000000..3b26f560 --- /dev/null +++ b/lib/lithic/models/account_spend_limits.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountSpendLimits < Lithic::BaseModel + # @!attribute available_spend_limit + # + # @return [Lithic::Models::AccountSpendLimits::AvailableSpendLimit] + required :available_spend_limit, -> { Lithic::Models::AccountSpendLimits::AvailableSpendLimit } + + # @!attribute [r] spend_limit + # + # @return [Lithic::Models::AccountSpendLimits::SpendLimit, nil] + optional :spend_limit, -> { Lithic::Models::AccountSpendLimits::SpendLimit } + + # @!parse + # # @return [Lithic::Models::AccountSpendLimits::SpendLimit] + # attr_writer :spend_limit + + # @!attribute [r] spend_velocity + # + # @return [Lithic::Models::AccountSpendLimits::SpendVelocity, nil] + optional :spend_velocity, -> { Lithic::Models::AccountSpendLimits::SpendVelocity } + + # @!parse + # # @return [Lithic::Models::AccountSpendLimits::SpendVelocity] + # attr_writer :spend_velocity + + # @!parse + # # @param available_spend_limit [Lithic::Models::AccountSpendLimits::AvailableSpendLimit] + # # @param spend_limit [Lithic::Models::AccountSpendLimits::SpendLimit] + # # @param spend_velocity [Lithic::Models::AccountSpendLimits::SpendVelocity] + # # + # def initialize(available_spend_limit:, spend_limit: nil, spend_velocity: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class AvailableSpendLimit < Lithic::BaseModel + # @!attribute [r] daily + # The available spend limit (in cents) relative to the daily limit configured on + # the Account (e.g. 100000 would be a $1,000 limit). + # + # @return [Integer, nil] + optional :daily, Integer + + # @!parse + # # @return [Integer] + # attr_writer :daily + + # @!attribute [r] lifetime + # The available spend limit (in cents) relative to the lifetime limit configured + # on the Account. + # + # @return [Integer, nil] + optional :lifetime, Integer + + # @!parse + # # @return [Integer] + # attr_writer :lifetime + + # @!attribute [r] monthly + # The available spend limit (in cents) relative to the monthly limit configured on + # the Account. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!parse + # # @return [Integer] + # attr_writer :monthly + + # @!parse + # # @param daily [Integer] + # # @param lifetime [Integer] + # # @param monthly [Integer] + # # + # def initialize(daily: nil, lifetime: nil, monthly: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class SpendLimit < Lithic::BaseModel + # @!attribute [r] daily + # The configured daily spend limit (in cents) on the Account. + # + # @return [Integer, nil] + optional :daily, Integer + + # @!parse + # # @return [Integer] + # attr_writer :daily + + # @!attribute [r] lifetime + # The configured lifetime spend limit (in cents) on the Account. + # + # @return [Integer, nil] + optional :lifetime, Integer + + # @!parse + # # @return [Integer] + # attr_writer :lifetime + + # @!attribute [r] monthly + # The configured monthly spend limit (in cents) on the Account. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!parse + # # @return [Integer] + # attr_writer :monthly + + # @!parse + # # @param daily [Integer] + # # @param lifetime [Integer] + # # @param monthly [Integer] + # # + # def initialize(daily: nil, lifetime: nil, monthly: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class SpendVelocity < Lithic::BaseModel + # @!attribute [r] daily + # Current daily spend velocity (in cents) on the Account. Present if daily spend + # limit is set. + # + # @return [Integer, nil] + optional :daily, Integer + + # @!parse + # # @return [Integer] + # attr_writer :daily + + # @!attribute [r] lifetime + # Current lifetime spend velocity (in cents) on the Account. Present if lifetime + # spend limit is set. + # + # @return [Integer, nil] + optional :lifetime, Integer + + # @!parse + # # @return [Integer] + # attr_writer :lifetime + + # @!attribute [r] monthly + # Current monthly spend velocity (in cents) on the Account. Present if monthly + # spend limit is set. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!parse + # # @return [Integer] + # attr_writer :monthly + + # @!parse + # # @param daily [Integer] + # # @param lifetime [Integer] + # # @param monthly [Integer] + # # + # def initialize(daily: nil, lifetime: nil, monthly: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/account_update_params.rb b/lib/lithic/models/account_update_params.rb new file mode 100644 index 00000000..bef21813 --- /dev/null +++ b/lib/lithic/models/account_update_params.rb @@ -0,0 +1,182 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] daily_spend_limit + # Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + # + # @return [Integer, nil] + optional :daily_spend_limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :daily_spend_limit + + # @!attribute [r] lifetime_spend_limit + # Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + # + # @return [Integer, nil] + optional :lifetime_spend_limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :lifetime_spend_limit + + # @!attribute [r] monthly_spend_limit + # Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + # + # @return [Integer, nil] + optional :monthly_spend_limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :monthly_spend_limit + + # @!attribute [r] state + # Account states. + # + # @return [Symbol, Lithic::Models::AccountUpdateParams::State, nil] + optional :state, enum: -> { Lithic::Models::AccountUpdateParams::State } + + # @!parse + # # @return [Symbol, Lithic::Models::AccountUpdateParams::State] + # attr_writer :state + + # @!attribute [r] verification_address + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Authorization Rules. The field will be removed from + # the schema in a future release. + # + # @return [Lithic::Models::AccountUpdateParams::VerificationAddress, nil] + optional :verification_address, -> { Lithic::Models::AccountUpdateParams::VerificationAddress } + + # @!parse + # # @return [Lithic::Models::AccountUpdateParams::VerificationAddress] + # attr_writer :verification_address + + # @!parse + # # @param daily_spend_limit [Integer] + # # @param lifetime_spend_limit [Integer] + # # @param monthly_spend_limit [Integer] + # # @param state [Symbol, Lithic::Models::AccountUpdateParams::State] + # # @param verification_address [Lithic::Models::AccountUpdateParams::VerificationAddress] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # daily_spend_limit: nil, + # lifetime_spend_limit: nil, + # monthly_spend_limit: nil, + # state: nil, + # verification_address: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Account states. + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # @deprecated + class VerificationAddress < Lithic::BaseModel + # @!attribute [r] address1 + # + # @return [String, nil] + optional :address1, String + + # @!parse + # # @return [String] + # attr_writer :address1 + + # @!attribute [r] address2 + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!attribute [r] city + # + # @return [String, nil] + optional :city, String + + # @!parse + # # @return [String] + # attr_writer :city + + # @!attribute [r] country + # + # @return [String, nil] + optional :country, String + + # @!parse + # # @return [String] + # attr_writer :country + + # @!attribute [r] postal_code + # + # @return [String, nil] + optional :postal_code, String + + # @!parse + # # @return [String] + # attr_writer :postal_code + + # @!attribute [r] state + # + # @return [String, nil] + optional :state, String + + # @!parse + # # @return [String] + # attr_writer :state + + # @!parse + # # Address used during Address Verification Service (AVS) checks during + # # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # # are no longer supported by Authorization Rules. The field will be removed from + # # the schema in a future release. + # # + # # @param address1 [String] + # # @param address2 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # + # def initialize(address1: nil, address2: nil, city: nil, country: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/address.rb b/lib/lithic/models/address.rb new file mode 100644 index 00000000..b37e9ed3 --- /dev/null +++ b/lib/lithic/models/address.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character + # format. Only USA is currently supported for all workflows. KYC_EXEMPT supports + # CAN additionally. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. USA postal codes (ZIP codes) are supported, entered as a + # five-digit postal code or nine-digit postal code (ZIP+4) using the format + # 12345-1234. KYC_EXEMPT supports Canadian postal codes. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. USA state codes are supported, entered in uppercase ISO 3166-2 + # two-character format. KYC_EXEMPT supports Canadian province codes. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/address_update.rb b/lib/lithic/models/address_update.rb new file mode 100644 index 00000000..27a9c582 --- /dev/null +++ b/lib/lithic/models/address_update.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AddressUpdate < Lithic::BaseModel + # @!attribute [r] address1 + # Valid deliverable address (no PO boxes). + # + # @return [String, nil] + optional :address1, String + + # @!parse + # # @return [String] + # attr_writer :address1 + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!attribute [r] city + # Name of city. + # + # @return [String, nil] + optional :city, String + + # @!parse + # # @return [String] + # attr_writer :city + + # @!attribute [r] country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String, nil] + optional :country, String + + # @!parse + # # @return [String] + # attr_writer :country + + # @!attribute [r] postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String, nil] + optional :postal_code, String + + # @!parse + # # @return [String] + # attr_writer :postal_code + + # @!attribute [r] state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String, nil] + optional :state, String + + # @!parse + # # @return [String] + # attr_writer :state + + # @!parse + # # @param address1 [String] + # # @param address2 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # + # def initialize(address1: nil, address2: nil, city: nil, country: nil, postal_code: nil, state: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/aggregate_balance.rb b/lib/lithic/models/aggregate_balance.rb new file mode 100644 index 00000000..ef3d7445 --- /dev/null +++ b/lib/lithic/models/aggregate_balance.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AggregateBalance < Lithic::BaseModel + # @!attribute available_amount + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :available_amount, Integer + + # @!attribute created + # Date and time for when the balance was first created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @return [String] + required :currency, String + + # @!attribute financial_account_type + # Type of financial account + # + # @return [Symbol, Lithic::Models::AggregateBalance::FinancialAccountType] + required :financial_account_type, enum: -> { Lithic::Models::AggregateBalance::FinancialAccountType } + + # @!attribute last_financial_account_token + # Globally unique identifier for the financial account that had its balance + # updated most recently + # + # @return [String] + required :last_financial_account_token, String + + # @!attribute last_transaction_event_token + # Globally unique identifier for the last transaction event that impacted this + # balance + # + # @return [String] + required :last_transaction_event_token, String + + # @!attribute last_transaction_token + # Globally unique identifier for the last transaction that impacted this balance + # + # @return [String] + required :last_transaction_token, String + + # @!attribute pending_amount + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute total_amount + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD) + # + # @return [Integer] + required :total_amount, Integer + + # @!attribute updated + # Date and time for when the balance was last updated. + # + # @return [Time] + required :updated, Time + + # @!parse + # # Aggregate Balance across all end-user accounts + # # + # # @param available_amount [Integer] + # # @param created [Time] + # # @param currency [String] + # # @param financial_account_type [Symbol, Lithic::Models::AggregateBalance::FinancialAccountType] + # # @param last_financial_account_token [String] + # # @param last_transaction_event_token [String] + # # @param last_transaction_token [String] + # # @param pending_amount [Integer] + # # @param total_amount [Integer] + # # @param updated [Time] + # # + # def initialize( + # available_amount:, + # created:, + # currency:, + # financial_account_type:, + # last_financial_account_token:, + # last_transaction_event_token:, + # last_transaction_token:, + # pending_amount:, + # total_amount:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of financial account + module FinancialAccountType + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/aggregate_balance_list_params.rb b/lib/lithic/models/aggregate_balance_list_params.rb new file mode 100644 index 00000000..60380bda --- /dev/null +++ b/lib/lithic/models/aggregate_balance_list_params.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AggregateBalanceListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] financial_account_type + # Get the aggregate balance for a given Financial Account type. + # + # @return [Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType, nil] + optional :financial_account_type, + enum: -> { Lithic::Models::AggregateBalanceListParams::FinancialAccountType } + + # @!parse + # # @return [Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType] + # attr_writer :financial_account_type + + # @!parse + # # @param financial_account_type [Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(financial_account_type: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Get the aggregate balance for a given Financial Account type. + module FinancialAccountType + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/api_status.rb b/lib/lithic/models/api_status.rb new file mode 100644 index 00000000..edd4c2ab --- /dev/null +++ b/lib/lithic/models/api_status.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class APIStatus < Lithic::BaseModel + # @!attribute [r] message + # + # @return [String, nil] + optional :message, String + + # @!parse + # # @return [String] + # attr_writer :message + + # @!parse + # # @param message [String] + # # + # def initialize(message: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/auth_rules/auth_rule.rb b/lib/lithic/models/auth_rules/auth_rule.rb new file mode 100644 index 00000000..76cfbaab --- /dev/null +++ b/lib/lithic/models/auth_rules/auth_rule.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class AuthRule < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute state + # Indicates whether the Auth Rule is ACTIVE or INACTIVE + # + # @return [Symbol, Lithic::Models::AuthRules::AuthRule::State] + required :state, enum: -> { Lithic::Models::AuthRules::AuthRule::State } + + # @!attribute [r] account_tokens + # Array of account_token(s) identifying the accounts that the Auth Rule applies + # to. Note that only this field or `card_tokens` can be provided for a given Auth + # Rule. + # + # @return [Array, nil] + optional :account_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :account_tokens + + # @!attribute [r] allowed_countries + # Countries in which the Auth Rule permits transactions. Note that Lithic + # maintains a list of countries in which all transactions are blocked; "allowing" + # those countries in an Auth Rule does not override the Lithic-wide restrictions. + # + # @return [Array, nil] + optional :allowed_countries, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :allowed_countries + + # @!attribute [r] allowed_mcc + # Merchant category codes for which the Auth Rule permits transactions. + # + # @return [Array, nil] + optional :allowed_mcc, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :allowed_mcc + + # @!attribute [r] blocked_countries + # Countries in which the Auth Rule automatically declines transactions. + # + # @return [Array, nil] + optional :blocked_countries, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :blocked_countries + + # @!attribute [r] blocked_mcc + # Merchant category codes for which the Auth Rule automatically declines + # transactions. + # + # @return [Array, nil] + optional :blocked_mcc, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :blocked_mcc + + # @!attribute [r] card_tokens + # Array of card_token(s) identifying the cards that the Auth Rule applies to. Note + # that only this field or `account_tokens` can be provided for a given Auth Rule. + # + # @return [Array, nil] + optional :card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :card_tokens + + # @!attribute [r] program_level + # Boolean indicating whether the Auth Rule is applied at the program level. + # + # @return [Boolean, nil] + optional :program_level, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :program_level + + # @!parse + # # @param token [String] + # # @param state [Symbol, Lithic::Models::AuthRules::AuthRule::State] + # # @param account_tokens [Array] + # # @param allowed_countries [Array] + # # @param allowed_mcc [Array] + # # @param blocked_countries [Array] + # # @param blocked_mcc [Array] + # # @param card_tokens [Array] + # # @param program_level [Boolean] + # # + # def initialize( + # token:, + # state:, + # account_tokens: nil, + # allowed_countries: nil, + # allowed_mcc: nil, + # blocked_countries: nil, + # blocked_mcc: nil, + # card_tokens: nil, + # program_level: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Indicates whether the Auth Rule is ACTIVE or INACTIVE + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + + AuthRule = AuthRules::AuthRule + end +end diff --git a/lib/lithic/models/auth_rules/auth_rule_condition.rb b/lib/lithic/models/auth_rules/auth_rule_condition.rb new file mode 100644 index 00000000..489bb760 --- /dev/null +++ b/lib/lithic/models/auth_rules/auth_rule_condition.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class AuthRuleCondition < Lithic::BaseModel + # @!attribute [r] attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAttribute, nil] + optional :attribute, enum: -> { Lithic::Models::AuthRules::ConditionalAttribute } + + # @!parse + # # @return [Symbol, Lithic::Models::AuthRules::ConditionalAttribute] + # attr_writer :attribute + + # @!attribute [r] operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::AuthRuleCondition::Operation, nil] + optional :operation, enum: -> { Lithic::Models::AuthRules::AuthRuleCondition::Operation } + + # @!parse + # # @return [Symbol, Lithic::Models::AuthRules::AuthRuleCondition::Operation] + # attr_writer :operation + + # @!attribute [r] value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Array, nil] + optional :value, union: -> { Lithic::Models::AuthRules::AuthRuleCondition::Value } + + # @!parse + # # @return [String, Integer, Array] + # attr_writer :value + + # @!parse + # # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalAttribute] + # # @param operation [Symbol, Lithic::Models::AuthRules::AuthRuleCondition::Operation] + # # @param value [String, Integer, Array] + # # + # def initialize(attribute: nil, operation: nil, value: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The operation to apply to the attribute + module Operation + extend Lithic::Enum + + IS_ONE_OF = :IS_ONE_OF + IS_NOT_ONE_OF = :IS_NOT_ONE_OF + MATCHES = :MATCHES + DOES_NOT_MATCH = :DOES_NOT_MATCH + IS_GREATER_THAN = :IS_GREATER_THAN + IS_LESS_THAN = :IS_LESS_THAN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + module Value + extend Lithic::Union + + StringArray = Lithic::ArrayOf[String] + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + variant String + + # A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` + variant Integer + + # An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` + variant Lithic::Models::AuthRules::AuthRuleCondition::Value::StringArray + + # @!parse + # # @return [Array(String, Integer, Array)] + # def self.variants; end + end + end + end + + AuthRuleCondition = AuthRules::AuthRuleCondition + end +end diff --git a/lib/lithic/models/auth_rules/conditional_attribute.rb b/lib/lithic/models/auth_rules/conditional_attribute.rb new file mode 100644 index 00000000..64b93afd --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_attribute.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + module ConditionalAttribute + extend Lithic::Enum + + MCC = :MCC + COUNTRY = :COUNTRY + CURRENCY = :CURRENCY + MERCHANT_ID = :MERCHANT_ID + DESCRIPTOR = :DESCRIPTOR + LIABILITY_SHIFT = :LIABILITY_SHIFT + PAN_ENTRY_MODE = :PAN_ENTRY_MODE + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT + RISK_SCORE = :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H = :CARD_TRANSACTION_COUNT_24H + CARD_STATE = :CARD_STATE + PIN_ENTERED = :PIN_ENTERED + PIN_STATUS = :PIN_STATUS + WALLET_TYPE = :WALLET_TYPE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_block_parameters.rb b/lib/lithic/models/auth_rules/conditional_block_parameters.rb new file mode 100644 index 00000000..eb4423ea --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_block_parameters.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class ConditionalBlockParameters < Lithic::BaseModel + # @!attribute conditions + # + # @return [Array] + required :conditions, -> { Lithic::ArrayOf[Lithic::Models::AuthRules::AuthRuleCondition] } + + # @!parse + # # @param conditions [Array] + # # + # def initialize(conditions:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_create_params.rb b/lib/lithic/models/auth_rules/v2/backtest_create_params.rb new file mode 100644 index 00000000..4797231f --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_create_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + class BacktestCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] end_ + # The end time of the backtest. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] start + # The start time of the backtest. + # + # @return [Time, nil] + optional :start, Time + + # @!parse + # # @return [Time] + # attr_writer :start + + # @!parse + # # @param end_ [Time] + # # @param start [Time] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(end_: nil, start: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_create_response.rb b/lib/lithic/models/auth_rules/v2/backtest_create_response.rb new file mode 100644 index 00000000..df116cdc --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_create_response.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + class BacktestCreateResponse < Lithic::BaseModel + # @!attribute [r] backtest_token + # Auth Rule Backtest Token + # + # @return [String, nil] + optional :backtest_token, String + + # @!parse + # # @return [String] + # attr_writer :backtest_token + + # @!parse + # # @param backtest_token [String] + # # + # def initialize(backtest_token: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_results.rb b/lib/lithic/models/auth_rules/v2/backtest_results.rb new file mode 100644 index 00000000..8a99f97e --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_results.rb @@ -0,0 +1,304 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + class BacktestResults < Lithic::BaseModel + # @!attribute backtest_token + # Auth Rule Backtest Token + # + # @return [String] + required :backtest_token, String + + # @!attribute results + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults::Results] + required :results, -> { Lithic::Models::AuthRules::V2::BacktestResults::Results } + + # @!attribute simulation_parameters + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters] + required :simulation_parameters, + -> { Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters } + + # @!parse + # # @param backtest_token [String] + # # @param results [Lithic::Models::AuthRules::V2::BacktestResults::Results] + # # @param simulation_parameters [Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters] + # # + # def initialize(backtest_token:, results:, simulation_parameters:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Results < Lithic::BaseModel + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion, nil] + optional :current_version, + -> { Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion }, + nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion, nil] + optional :draft_version, + -> { Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion }, + nil?: true + + # @!parse + # # @param current_version [Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion, nil] + # # + # def initialize(current_version: nil, draft_version: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute [r] approved + # The total number of historical transactions approved by this rule during the + # backtest period, or the number of transactions that would have been approved if + # the rule was evaluated in shadow mode. + # + # @return [Integer, nil] + optional :approved, Integer + + # @!parse + # # @return [Integer] + # attr_writer :approved + + # @!attribute [r] declined + # The total number of historical transactions declined by this rule during the + # backtest period, or the number of transactions that would have been declined if + # the rule was evaluated in shadow mode. + # + # @return [Integer, nil] + optional :declined, Integer + + # @!parse + # # @return [Integer] + # attr_writer :declined + + # @!attribute [r] examples + # Example authorization request events that would have been approved or declined. + # + # @return [Array, nil] + optional :examples, + -> { Lithic::ArrayOf[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example] } + + # @!parse + # # @return [Array] + # attr_writer :examples + + response_only do + # @!attribute [r] version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer, nil] + optional :version, Integer + + # @!parse + # # @return [Integer] + # attr_writer :version + end + + # @!parse + # # @param approved [Integer] + # # @param declined [Integer] + # # @param examples [Array] + # # @param version [Integer] + # # + # def initialize(approved: nil, declined: nil, examples: nil, version: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Example < Lithic::BaseModel + # @!attribute [r] approved + # Whether the rule would have approved the authorization request. + # + # @return [Boolean, nil] + optional :approved, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :approved + + # @!attribute [r] event_token + # The authorization request event token. + # + # @return [String, nil] + optional :event_token, String + + # @!parse + # # @return [String] + # attr_writer :event_token + + # @!attribute [r] timestamp + # The timestamp of the authorization request event. + # + # @return [Time, nil] + optional :timestamp, Time + + # @!parse + # # @return [Time] + # attr_writer :timestamp + + # @!parse + # # @param approved [Boolean] + # # @param event_token [String] + # # @param timestamp [Time] + # # + # def initialize(approved: nil, event_token: nil, timestamp: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute [r] approved + # The total number of historical transactions approved by this rule during the + # backtest period, or the number of transactions that would have been approved if + # the rule was evaluated in shadow mode. + # + # @return [Integer, nil] + optional :approved, Integer + + # @!parse + # # @return [Integer] + # attr_writer :approved + + # @!attribute [r] declined + # The total number of historical transactions declined by this rule during the + # backtest period, or the number of transactions that would have been declined if + # the rule was evaluated in shadow mode. + # + # @return [Integer, nil] + optional :declined, Integer + + # @!parse + # # @return [Integer] + # attr_writer :declined + + # @!attribute [r] examples + # Example authorization request events that would have been approved or declined. + # + # @return [Array, nil] + optional :examples, + -> { Lithic::ArrayOf[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example] } + + # @!parse + # # @return [Array] + # attr_writer :examples + + response_only do + # @!attribute [r] version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer, nil] + optional :version, Integer + + # @!parse + # # @return [Integer] + # attr_writer :version + end + + # @!parse + # # @param approved [Integer] + # # @param declined [Integer] + # # @param examples [Array] + # # @param version [Integer] + # # + # def initialize(approved: nil, declined: nil, examples: nil, version: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Example < Lithic::BaseModel + # @!attribute [r] approved + # Whether the rule would have approved the authorization request. + # + # @return [Boolean, nil] + optional :approved, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :approved + + # @!attribute [r] event_token + # The authorization request event token. + # + # @return [String, nil] + optional :event_token, String + + # @!parse + # # @return [String] + # attr_writer :event_token + + # @!attribute [r] timestamp + # The timestamp of the authorization request event. + # + # @return [Time, nil] + optional :timestamp, Time + + # @!parse + # # @return [Time] + # attr_writer :timestamp + + # @!parse + # # @param approved [Boolean] + # # @param event_token [String] + # # @param timestamp [Time] + # # + # def initialize(approved: nil, event_token: nil, timestamp: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + + class SimulationParameters < Lithic::BaseModel + # @!attribute [r] auth_rule_token + # Auth Rule Token + # + # @return [String, nil] + optional :auth_rule_token, String + + # @!parse + # # @return [String] + # attr_writer :auth_rule_token + + # @!attribute [r] end_ + # The end time of the simulation. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] start + # The start time of the simulation. + # + # @return [Time, nil] + optional :start, Time + + # @!parse + # # @return [Time] + # attr_writer :start + + # @!parse + # # @param auth_rule_token [String] + # # @param end_ [Time] + # # @param start [Time] + # # + # def initialize(auth_rule_token: nil, end_: nil, start: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rb b/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rb new file mode 100644 index 00000000..672708be --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + class BacktestRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!parse + # # @param auth_rule_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(auth_rule_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_apply_params.rb b/lib/lithic/models/auth_rules/v2_apply_params.rb new file mode 100644 index 00000000..ade0b6a4 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_apply_params.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2ApplyParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param program_level [Boolean] + # # @param excluded_card_tokens [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(account_tokens:, card_tokens:, program_level:, excluded_card_tokens: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_apply_response.rb b/lib/lithic/models/auth_rules/v2_apply_response.rb new file mode 100644 index 00000000..c414a9cf --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_apply_response.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2ApplyResponse < Lithic::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion, nil] + required :current_version, -> { Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion, nil] + required :draft_version, -> { Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion }, nil?: true + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ApplyResponse::State] + required :state, enum: -> { Lithic::Models::AuthRules::V2ApplyResponse::State } + + # @!attribute type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ApplyResponse::Type] + required :type, enum: -> { Lithic::Models::AuthRules::V2ApplyResponse::Type } + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param token [String] + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param current_version [Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion, nil] + # # @param name [String, nil] + # # @param program_level [Boolean] + # # @param state [Symbol, Lithic::Models::AuthRules::V2ApplyResponse::State] + # # @param type [Symbol, Lithic::Models::AuthRules::V2ApplyResponse::Type] + # # @param excluded_card_tokens [Array] + # # + # def initialize( + # token:, + # account_tokens:, + # card_tokens:, + # current_version:, + # draft_version:, + # name:, + # program_level:, + # state:, + # type:, + # excluded_card_tokens: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_create_params.rb b/lib/lithic/models/auth_rules/v2_create_params.rb new file mode 100644 index 00000000..f7492832 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_create_params.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2CreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute [r] parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, nil] + optional :parameters, union: -> { Lithic::Models::AuthRules::V2CreateParams::Parameters } + + # @!parse + # # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # attr_writer :parameters + + # @!attribute [r] type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Type, nil] + optional :type, enum: -> { Lithic::Models::AuthRules::V2CreateParams::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Type] + # attr_writer :type + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param program_level [Boolean] + # # @param name [String, nil] + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param type [Symbol, Lithic::Models::AuthRules::V2CreateParams::Type] + # # @param excluded_card_tokens [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_tokens:, + # card_tokens:, + # program_level:, + # name: nil, + # parameters: nil, + # type: nil, + # excluded_card_tokens: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_create_response.rb b/lib/lithic/models/auth_rules/v2_create_response.rb new file mode 100644 index 00000000..0f68eac8 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_create_response.rb @@ -0,0 +1,206 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2CreateResponse < Lithic::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion, nil] + required :current_version, -> { Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2CreateResponse::DraftVersion, nil] + required :draft_version, -> { Lithic::Models::AuthRules::V2CreateResponse::DraftVersion }, nil?: true + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2CreateResponse::State] + required :state, enum: -> { Lithic::Models::AuthRules::V2CreateResponse::State } + + # @!attribute type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2CreateResponse::Type] + required :type, enum: -> { Lithic::Models::AuthRules::V2CreateResponse::Type } + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param token [String] + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param current_version [Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2CreateResponse::DraftVersion, nil] + # # @param name [String, nil] + # # @param program_level [Boolean] + # # @param state [Symbol, Lithic::Models::AuthRules::V2CreateResponse::State] + # # @param type [Symbol, Lithic::Models::AuthRules::V2CreateResponse::Type] + # # @param excluded_card_tokens [Array] + # # + # def initialize( + # token:, + # account_tokens:, + # card_tokens:, + # current_version:, + # draft_version:, + # name:, + # program_level:, + # state:, + # type:, + # excluded_card_tokens: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, + union: -> { Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_delete_params.rb b/lib/lithic/models/auth_rules/v2_delete_params.rb new file mode 100644 index 00000000..d26b220b --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2DeleteParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_draft_params.rb b/lib/lithic/models/auth_rules/v2_draft_params.rb new file mode 100644 index 00000000..ba51fd84 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_draft_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2DraftParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, nil] + optional :parameters, union: -> { Lithic::Models::AuthRules::V2DraftParams::Parameters }, nil?: true + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, nil] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(parameters: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_draft_response.rb b/lib/lithic/models/auth_rules/v2_draft_response.rb new file mode 100644 index 00000000..fb2161f5 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_draft_response.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2DraftResponse < Lithic::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion, nil] + required :current_version, -> { Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2DraftResponse::DraftVersion, nil] + required :draft_version, -> { Lithic::Models::AuthRules::V2DraftResponse::DraftVersion }, nil?: true + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2DraftResponse::State] + required :state, enum: -> { Lithic::Models::AuthRules::V2DraftResponse::State } + + # @!attribute type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2DraftResponse::Type] + required :type, enum: -> { Lithic::Models::AuthRules::V2DraftResponse::Type } + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param token [String] + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param current_version [Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2DraftResponse::DraftVersion, nil] + # # @param name [String, nil] + # # @param program_level [Boolean] + # # @param state [Symbol, Lithic::Models::AuthRules::V2DraftResponse::State] + # # @param type [Symbol, Lithic::Models::AuthRules::V2DraftResponse::Type] + # # @param excluded_card_tokens [Array] + # # + # def initialize( + # token:, + # account_tokens:, + # card_tokens:, + # current_version:, + # draft_version:, + # name:, + # program_level:, + # state:, + # type:, + # excluded_card_tokens: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_list_params.rb b/lib/lithic/models/auth_rules/v2_list_params.rb new file mode 100644 index 00000000..02bd9d05 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_list_params.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2ListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # Only return Authorization Rules that are bound to the provided account token. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] card_token + # Only return Authorization Rules that are bound to the provided card token. + # + # @return [String, nil] + optional :card_token, String + + # @!parse + # # @return [String] + # attr_writer :card_token + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param account_token [String] + # # @param card_token [String] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # card_token: nil, + # ending_before: nil, + # page_size: nil, + # starting_after: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_list_response.rb b/lib/lithic/models/auth_rules/v2_list_response.rb new file mode 100644 index 00000000..c97c2df8 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_list_response.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2ListResponse < Lithic::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2ListResponse::CurrentVersion, nil] + required :current_version, -> { Lithic::Models::AuthRules::V2ListResponse::CurrentVersion }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2ListResponse::DraftVersion, nil] + required :draft_version, -> { Lithic::Models::AuthRules::V2ListResponse::DraftVersion }, nil?: true + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResponse::State] + required :state, enum: -> { Lithic::Models::AuthRules::V2ListResponse::State } + + # @!attribute type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResponse::Type] + required :type, enum: -> { Lithic::Models::AuthRules::V2ListResponse::Type } + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param token [String] + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param current_version [Lithic::Models::AuthRules::V2ListResponse::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2ListResponse::DraftVersion, nil] + # # @param name [String, nil] + # # @param program_level [Boolean] + # # @param state [Symbol, Lithic::Models::AuthRules::V2ListResponse::State] + # # @param type [Symbol, Lithic::Models::AuthRules::V2ListResponse::Type] + # # @param excluded_card_tokens [Array] + # # + # def initialize( + # token:, + # account_tokens:, + # card_tokens:, + # current_version:, + # draft_version:, + # name:, + # program_level:, + # state:, + # type:, + # excluded_card_tokens: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2ListResponse::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2ListResponse::DraftVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_promote_params.rb b/lib/lithic/models/auth_rules/v2_promote_params.rb new file mode 100644 index 00000000..dbee4e1f --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_promote_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2PromoteParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_promote_response.rb b/lib/lithic/models/auth_rules/v2_promote_response.rb new file mode 100644 index 00000000..ce3ec31d --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_promote_response.rb @@ -0,0 +1,206 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2PromoteResponse < Lithic::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion, nil] + required :current_version, -> { Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion, nil] + required :draft_version, -> { Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion }, nil?: true + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2PromoteResponse::State] + required :state, enum: -> { Lithic::Models::AuthRules::V2PromoteResponse::State } + + # @!attribute type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2PromoteResponse::Type] + required :type, enum: -> { Lithic::Models::AuthRules::V2PromoteResponse::Type } + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param token [String] + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param current_version [Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion, nil] + # # @param name [String, nil] + # # @param program_level [Boolean] + # # @param state [Symbol, Lithic::Models::AuthRules::V2PromoteResponse::State] + # # @param type [Symbol, Lithic::Models::AuthRules::V2PromoteResponse::Type] + # # @param excluded_card_tokens [Array] + # # + # def initialize( + # token:, + # account_tokens:, + # card_tokens:, + # current_version:, + # draft_version:, + # name:, + # program_level:, + # state:, + # type:, + # excluded_card_tokens: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, + union: -> { Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_report_params.rb b/lib/lithic/models/auth_rules/v2_report_params.rb new file mode 100644 index 00000000..e514dd46 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_report_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2ReportParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_report_response.rb b/lib/lithic/models/auth_rules/v2_report_response.rb new file mode 100644 index 00000000..7d58dec7 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_report_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2ReportResponse < Lithic::BaseModel + # @!attribute [r] report_token + # + # @return [String, nil] + optional :report_token, String + + # @!parse + # # @return [String] + # attr_writer :report_token + + # @!parse + # # @param report_token [String] + # # + # def initialize(report_token: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_params.rb b/lib/lithic/models/auth_rules/v2_retrieve_params.rb new file mode 100644 index 00000000..cb9833e0 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2RetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_response.rb b/lib/lithic/models/auth_rules/v2_retrieve_response.rb new file mode 100644 index 00000000..31719ff1 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_retrieve_response.rb @@ -0,0 +1,209 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2RetrieveResponse < Lithic::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion, nil] + required :current_version, + -> { Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion }, + nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion, nil] + required :draft_version, -> { Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion }, nil?: true + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::State] + required :state, enum: -> { Lithic::Models::AuthRules::V2RetrieveResponse::State } + + # @!attribute type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::Type] + required :type, enum: -> { Lithic::Models::AuthRules::V2RetrieveResponse::Type } + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param token [String] + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param current_version [Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion, nil] + # # @param name [String, nil] + # # @param program_level [Boolean] + # # @param state [Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::State] + # # @param type [Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::Type] + # # @param excluded_card_tokens [Array] + # # + # def initialize( + # token:, + # account_tokens:, + # card_tokens:, + # current_version:, + # draft_version:, + # name:, + # program_level:, + # state:, + # type:, + # excluded_card_tokens: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, + union: -> { Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, + union: -> { Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_update_params.rb b/lib/lithic/models/auth_rules/v2_update_params.rb new file mode 100644 index 00000000..440bbe6c --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_update_params.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2UpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array, nil] + optional :account_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :account_tokens + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute [r] state + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @return [Symbol, Lithic::Models::AuthRules::V2UpdateParams::State, nil] + optional :state, enum: -> { Lithic::Models::AuthRules::V2UpdateParams::State } + + # @!parse + # # @return [Symbol, Lithic::Models::AuthRules::V2UpdateParams::State] + # attr_writer :state + + # @!attribute [r] card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array, nil] + optional :card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :card_tokens + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!attribute [r] program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean, nil] + optional :program_level, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :program_level + + # @!parse + # # @param account_tokens [Array] + # # @param name [String, nil] + # # @param state [Symbol, Lithic::Models::AuthRules::V2UpdateParams::State] + # # @param card_tokens [Array] + # # @param excluded_card_tokens [Array] + # # @param program_level [Boolean] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_tokens: nil, + # name: nil, + # state: nil, + # card_tokens: nil, + # excluded_card_tokens: nil, + # program_level: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + module State + extend Lithic::Enum + + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_update_response.rb b/lib/lithic/models/auth_rules/v2_update_response.rb new file mode 100644 index 00000000..d430f82f --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_update_response.rb @@ -0,0 +1,206 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class V2UpdateResponse < Lithic::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion, nil] + required :current_version, -> { Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion, nil] + required :draft_version, -> { Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion }, nil?: true + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::BooleanModel + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2UpdateResponse::State] + required :state, enum: -> { Lithic::Models::AuthRules::V2UpdateResponse::State } + + # @!attribute type + # The type of Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2UpdateResponse::Type] + required :type, enum: -> { Lithic::Models::AuthRules::V2UpdateResponse::Type } + + # @!attribute [r] excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :excluded_card_tokens + + # @!parse + # # @param token [String] + # # @param account_tokens [Array] + # # @param card_tokens [Array] + # # @param current_version [Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion, nil] + # # @param draft_version [Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion, nil] + # # @param name [String, nil] + # # @param program_level [Boolean] + # # @param state [Symbol, Lithic::Models::AuthRules::V2UpdateResponse::State] + # # @param type [Symbol, Lithic::Models::AuthRules::V2UpdateResponse::Type] + # # @param excluded_card_tokens [Array] + # # + # def initialize( + # token:, + # account_tokens:, + # card_tokens:, + # current_version:, + # draft_version:, + # name:, + # program_level:, + # state:, + # type:, + # excluded_card_tokens: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CurrentVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, + union: -> { Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + class DraftVersion < Lithic::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + required :parameters, union: -> { Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!parse + # # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + # # @param version [Integer] + # # + # def initialize(parameters:, version:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + variant -> { Lithic::Models::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::Models::AuthRules::VelocityLimitParams } + + # @!parse + # # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams)] + # def self.variants; end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/velocity_limit_params.rb b/lib/lithic/models/auth_rules/velocity_limit_params.rb new file mode 100644 index 00000000..b90454ac --- /dev/null +++ b/lib/lithic/models/auth_rules/velocity_limit_params.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class VelocityLimitParams < Lithic::BaseModel + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters] + required :filters, -> { Lithic::Models::AuthRules::VelocityLimitParams::Filters } + + # @!attribute period + # The size of the trailing window to calculate Spend Velocity over in seconds. The + # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + # + # @return [Integer, Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow] + required :period, union: -> { Lithic::Models::AuthRules::VelocityLimitParams::Period } + + # @!attribute scope + # + # @return [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] + required :scope, enum: -> { Lithic::Models::AuthRules::VelocityLimitParams::Scope } + + # @!attribute limit_amount + # The maximum amount of spend velocity allowed in the period in minor units (the + # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this + # limit will be declined. + # + # @return [Integer, nil] + optional :limit_amount, Integer, nil?: true + + # @!attribute limit_count + # The number of spend velocity impacting transactions may not exceed this limit in + # the period. Transactions exceeding this limit will be declined. A spend velocity + # impacting transaction is a transaction that has been authorized, and optionally + # settled, or a force post (a transaction that settled without prior + # authorization). + # + # @return [Integer, nil] + optional :limit_count, Integer, nil?: true + + # @!parse + # # @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters] + # # @param period [Integer, Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow] + # # @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] + # # @param limit_amount [Integer, nil] + # # @param limit_count [Integer, nil] + # # + # def initialize(filters:, period:, scope:, limit_amount: nil, limit_count: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Filters < Lithic::BaseModel + # @!attribute exclude_countries + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + # + # @return [Array, nil] + optional :exclude_countries, Lithic::ArrayOf[String], nil?: true + + # @!attribute exclude_mccs + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + # + # @return [Array, nil] + optional :exclude_mccs, Lithic::ArrayOf[String], nil?: true + + # @!attribute include_countries + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + # + # @return [Array, nil] + optional :include_countries, Lithic::ArrayOf[String], nil?: true + + # @!attribute include_mccs + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + # + # @return [Array, nil] + optional :include_mccs, Lithic::ArrayOf[String], nil?: true + + # @!parse + # # @param exclude_countries [Array, nil] + # # @param exclude_mccs [Array, nil] + # # @param include_countries [Array, nil] + # # @param include_mccs [Array, nil] + # # + # def initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # The size of the trailing window to calculate Spend Velocity over in seconds. The + # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + module Period + extend Lithic::Union + + # The size of the trailing window to calculate Spend Velocity over in seconds. The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + variant Integer + + # The window of time to calculate Spend Velocity over. + # + # * `DAY`: Velocity over the current day since midnight Eastern Time. + # * `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in Eastern Time. + # * `MONTH`: Velocity over the current month since 00:00 / 12 AM on the first of the month in Eastern Time. + variant enum: -> { Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow } + + # @!parse + # # @return [Array(Integer, Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow)] + # def self.variants; end + end + + module Scope + extend Lithic::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/velocity_limit_params_period_window.rb b/lib/lithic/models/auth_rules/velocity_limit_params_period_window.rb new file mode 100644 index 00000000..362aa6b7 --- /dev/null +++ b/lib/lithic/models/auth_rules/velocity_limit_params_period_window.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # The window of time to calculate Spend Velocity over. + # + # - `DAY`: Velocity over the current day since midnight Eastern Time. + # - `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in + # Eastern Time. + # - `MONTH`: Velocity over the current month since 00:00 / 12 AM on the first of + # the month in Eastern Time. + module VelocityLimitParamsPeriodWindow + extend Lithic::Enum + + DAY = :DAY + WEEK = :WEEK + MONTH = :MONTH + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rb b/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rb new file mode 100644 index 00000000..a2f457e8 --- /dev/null +++ b/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AuthStreamEnrollmentRetrieveSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rb b/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rb new file mode 100644 index 00000000..3d518768 --- /dev/null +++ b/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AuthStreamEnrollmentRotateSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/auth_stream_secret.rb b/lib/lithic/models/auth_stream_secret.rb new file mode 100644 index 00000000..f6a1b1e6 --- /dev/null +++ b/lib/lithic/models/auth_stream_secret.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AuthStreamSecret < Lithic::BaseModel + # @!attribute [r] secret + # The shared HMAC ASA secret + # + # @return [String, nil] + optional :secret, String + + # @!parse + # # @return [String] + # attr_writer :secret + + # @!parse + # # @param secret [String] + # # + # def initialize(secret: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/balance.rb b/lib/lithic/models/balance.rb new file mode 100644 index 00000000..f33ccee2 --- /dev/null +++ b/lib/lithic/models/balance.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Balance < Lithic::BaseModel + # @!attribute available_amount + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :available_amount, Integer + + # @!attribute created + # Date and time for when the balance was first created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @return [String] + required :currency, String + + # @!attribute financial_account_token + # Globally unique identifier for the financial account that holds this balance. + # + # @return [String] + required :financial_account_token, String + + # @!attribute financial_account_type + # Type of financial account. + # + # @return [Symbol, Lithic::Models::Balance::FinancialAccountType] + required :financial_account_type, enum: -> { Lithic::Models::Balance::FinancialAccountType } + + # @!attribute last_transaction_event_token + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + # + # @return [String] + required :last_transaction_event_token, String + + # @!attribute last_transaction_token + # Globally unique identifier for the last financial transaction that impacted this + # balance. + # + # @return [String] + required :last_transaction_token, String + + # @!attribute pending_amount + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute total_amount + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + # + # @return [Integer] + required :total_amount, Integer + + # @!attribute updated + # Date and time for when the balance was last updated. + # + # @return [Time] + required :updated, Time + + # @!parse + # # Balance + # # + # # @param available_amount [Integer] + # # @param created [Time] + # # @param currency [String] + # # @param financial_account_token [String] + # # @param financial_account_type [Symbol, Lithic::Models::Balance::FinancialAccountType] + # # @param last_transaction_event_token [String] + # # @param last_transaction_token [String] + # # @param pending_amount [Integer] + # # @param total_amount [Integer] + # # @param updated [Time] + # # + # def initialize( + # available_amount:, + # created:, + # currency:, + # financial_account_token:, + # financial_account_type:, + # last_transaction_event_token:, + # last_transaction_token:, + # pending_amount:, + # total_amount:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of financial account. + module FinancialAccountType + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/balance_list_params.rb b/lib/lithic/models/balance_list_params.rb new file mode 100644 index 00000000..9692dc60 --- /dev/null +++ b/lib/lithic/models/balance_list_params.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BalanceListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # List balances for all financial accounts of a given account_token. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] balance_date + # UTC date and time of the balances to retrieve. Defaults to latest available + # balances + # + # @return [Time, nil] + optional :balance_date, Time + + # @!parse + # # @return [Time] + # attr_writer :balance_date + + # @!attribute [r] business_account_token + # List balances for all financial accounts of a given business_account_token. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] financial_account_type + # List balances for a given Financial Account type. + # + # @return [Symbol, Lithic::Models::BalanceListParams::FinancialAccountType, nil] + optional :financial_account_type, enum: -> { Lithic::Models::BalanceListParams::FinancialAccountType } + + # @!parse + # # @return [Symbol, Lithic::Models::BalanceListParams::FinancialAccountType] + # attr_writer :financial_account_type + + # @!parse + # # @param account_token [String] + # # @param balance_date [Time] + # # @param business_account_token [String] + # # @param financial_account_type [Symbol, Lithic::Models::BalanceListParams::FinancialAccountType] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # balance_date: nil, + # business_account_token: nil, + # financial_account_type: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # List balances for a given Financial Account type. + module FinancialAccountType + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/book_transfer_create_params.rb b/lib/lithic/models/book_transfer_create_params.rb new file mode 100644 index 00000000..28550ced --- /dev/null +++ b/lib/lithic/models/book_transfer_create_params.rb @@ -0,0 +1,162 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # Category of the book transfer + # + # @return [Symbol, Lithic::Models::BookTransferCreateParams::Category] + required :category, enum: -> { Lithic::Models::BookTransferCreateParams::Category } + + # @!attribute from_financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :from_financial_account_token, String + + # @!attribute subtype + # The program specific subtype code for the specified category/type. + # + # @return [String] + required :subtype, String + + # @!attribute to_financial_account_token + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :to_financial_account_token, String + + # @!attribute type + # Type of book_transfer + # + # @return [Symbol, Lithic::Models::BookTransferCreateParams::Type] + required :type, enum: -> { Lithic::Models::BookTransferCreateParams::Type } + + # @!attribute [r] token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] memo + # Optional descriptor for the transfer. + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param amount [Integer] + # # @param category [Symbol, Lithic::Models::BookTransferCreateParams::Category] + # # @param from_financial_account_token [String] + # # @param subtype [String] + # # @param to_financial_account_token [String] + # # @param type [Symbol, Lithic::Models::BookTransferCreateParams::Type] + # # @param token [String] + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # category:, + # from_financial_account_token:, + # subtype:, + # to_financial_account_token:, + # type:, + # token: nil, + # memo: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Category of the book transfer + module Category + extend Lithic::Enum + + ADJUSTMENT = :ADJUSTMENT + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + FEE = :FEE + REWARD = :REWARD + TRANSFER = :TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Type of book_transfer + module Type + extend Lithic::Enum + + ATM_WITHDRAWAL = :ATM_WITHDRAWAL + ATM_DECLINE = :ATM_DECLINE + INTERNATIONAL_ATM_WITHDRAWAL = :INTERNATIONAL_ATM_WITHDRAWAL + INACTIVITY = :INACTIVITY + STATEMENT = :STATEMENT + MONTHLY = :MONTHLY + QUARTERLY = :QUARTERLY + ANNUAL = :ANNUAL + CUSTOMER_SERVICE = :CUSTOMER_SERVICE + ACCOUNT_MAINTENANCE = :ACCOUNT_MAINTENANCE + ACCOUNT_ACTIVATION = :ACCOUNT_ACTIVATION + ACCOUNT_CLOSURE = :ACCOUNT_CLOSURE + CARD_REPLACEMENT = :CARD_REPLACEMENT + CARD_DELIVERY = :CARD_DELIVERY + CARD_CREATE = :CARD_CREATE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + INTEREST = :INTEREST + LATE_PAYMENT = :LATE_PAYMENT + BILL_PAYMENT = :BILL_PAYMENT + CASH_BACK = :CASH_BACK + ACCOUNT_TO_ACCOUNT = :ACCOUNT_TO_ACCOUNT + CARD_TO_CARD = :CARD_TO_CARD + DISBURSE = :DISBURSE + BILLING_ERROR = :BILLING_ERROR + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + EXPIRED_CARD = :EXPIRED_CARD + EARLY_DERECOGNITION = :EARLY_DERECOGNITION + ESCHEATMENT = :ESCHEATMENT + INACTIVITY_FEE_DOWN = :INACTIVITY_FEE_DOWN + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + DISPUTE_WON = :DISPUTE_WON + TRANSFER = :TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/book_transfer_list_params.rb b/lib/lithic/models/book_transfer_list_params.rb new file mode 100644 index 00000000..366c6386 --- /dev/null +++ b/lib/lithic/models/book_transfer_list_params.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] category + # Book Transfer category to be returned. + # + # @return [Symbol, Lithic::Models::BookTransferListParams::Category, nil] + optional :category, enum: -> { Lithic::Models::BookTransferListParams::Category } + + # @!parse + # # @return [Symbol, Lithic::Models::BookTransferListParams::Category] + # attr_writer :category + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] result + # Book transfer result to be returned. + # + # @return [Symbol, Lithic::Models::BookTransferListParams::Result, nil] + optional :result, enum: -> { Lithic::Models::BookTransferListParams::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::BookTransferListParams::Result] + # attr_writer :result + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # Book transfer status to be returned. + # + # @return [Symbol, Lithic::Models::BookTransferListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::BookTransferListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::BookTransferListParams::Status] + # attr_writer :status + + # @!parse + # # @param account_token [String] + # # @param begin_ [Time] + # # @param business_account_token [String] + # # @param category [Symbol, Lithic::Models::BookTransferListParams::Category] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param financial_account_token [String] + # # @param page_size [Integer] + # # @param result [Symbol, Lithic::Models::BookTransferListParams::Result] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::BookTransferListParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # begin_: nil, + # business_account_token: nil, + # category: nil, + # end_: nil, + # ending_before: nil, + # financial_account_token: nil, + # page_size: nil, + # result: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Book Transfer category to be returned. + module Category + extend Lithic::Enum + + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + FEE = :FEE + REWARD = :REWARD + ADJUSTMENT = :ADJUSTMENT + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + INTERNAL = :INTERNAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Book transfer result to be returned. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Book transfer status to be returned. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + SETTLED = :SETTLED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/book_transfer_response.rb b/lib/lithic/models/book_transfer_response.rb new file mode 100644 index 00000000..985feb3b --- /dev/null +++ b/lib/lithic/models/book_transfer_response.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferResponse < Lithic::BaseModel + # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String] + required :token, String + + # @!attribute category + # Category of the book transfer + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Category] + required :category, enum: -> { Lithic::Models::BookTransferResponse::Category } + + # @!attribute created + # Date and time when the transfer occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + # + # @return [String] + required :currency, String + + # @!attribute events + # A list of all financial events that have modified this transfer. + # + # @return [Array] + required :events, -> { Lithic::ArrayOf[Lithic::Models::BookTransferResponse::Event] } + + # @!attribute from_financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :from_financial_account_token, String + + # @!attribute pending_amount + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Result] + required :result, enum: -> { Lithic::Models::BookTransferResponse::Result } + + # @!attribute settled_amount + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents). + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The + # transfer was reversed \* `SETTLED` - The transfer is completed. + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Status] + required :status, enum: -> { Lithic::Models::BookTransferResponse::Status } + + # @!attribute to_financial_account_token + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + # + # @return [Object] + required :to_financial_account_token, Lithic::Unknown + + # @!attribute updated + # Date and time when the financial transaction was last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!parse + # # @param token [String] + # # @param category [Symbol, Lithic::Models::BookTransferResponse::Category] + # # @param created [Time] + # # @param currency [String] + # # @param events [Array] + # # @param from_financial_account_token [String] + # # @param pending_amount [Integer] + # # @param result [Symbol, Lithic::Models::BookTransferResponse::Result] + # # @param settled_amount [Integer] + # # @param status [Symbol, Lithic::Models::BookTransferResponse::Status] + # # @param to_financial_account_token [Object] + # # @param updated [Time] + # # + # def initialize( + # token:, + # category:, + # created:, + # currency:, + # events:, + # from_financial_account_token:, + # pending_amount:, + # result:, + # settled_amount:, + # status:, + # to_financial_account_token:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Category of the book transfer + module Category + extend Lithic::Enum + + ADJUSTMENT = :ADJUSTMENT + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + FEE = :FEE + REWARD = :REWARD + TRANSFER = :TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Event < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # Date and time when the financial event occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # Detailed Results + # + # @return [Array] + required :detailed_results, + -> { Lithic::ArrayOf[enum: Lithic::Models::BookTransferResponse::Event::DetailedResult] } + + # @!attribute memo + # Memo for the transfer. + # + # @return [String] + required :memo, String + + # @!attribute result + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Event::Result] + required :result, enum: -> { Lithic::Models::BookTransferResponse::Event::Result } + + # @!attribute subtype + # The program specific subtype code for the specified category/type. + # + # @return [String] + required :subtype, String + + # @!attribute type + # Type of the book transfer + # + # @return [String] + required :type, String + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param created [Time] + # # @param detailed_results [Array] + # # @param memo [String] + # # @param result [Symbol, Lithic::Models::BookTransferResponse::Event::Result] + # # @param subtype [String] + # # @param type [String] + # # + # def initialize(token:, amount:, created:, detailed_results:, memo:, result:, subtype:, type:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module DetailedResult + extend Lithic::Enum + + APPROVED = :APPROVED + FUNDS_INSUFFICIENT = :FUNDS_INSUFFICIENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The + # transfer was reversed \* `SETTLED` - The transfer is completed. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + REVERSED = :REVERSED + SETTLED = :SETTLED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/book_transfer_retrieve_params.rb b/lib/lithic/models/book_transfer_retrieve_params.rb new file mode 100644 index 00000000..d7c79d9e --- /dev/null +++ b/lib/lithic/models/book_transfer_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/book_transfer_reverse_params.rb b/lib/lithic/models/book_transfer_reverse_params.rb new file mode 100644 index 00000000..a2a60a80 --- /dev/null +++ b/lib/lithic/models/book_transfer_reverse_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferReverseParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] memo + # Optional descriptor for the reversal. + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(memo: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card.rb b/lib/lithic/models/card.rb new file mode 100644 index 00000000..2b3245a6 --- /dev/null +++ b/lib/lithic/models/card.rb @@ -0,0 +1,512 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Card < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute account_token + # Globally unique identifier for the account to which the card belongs. + # + # @return [String] + required :account_token, String + + # @!attribute card_program_token + # Globally unique identifier for the card program on which the card exists. + # + # @return [String] + required :card_program_token, String + + # @!attribute created + # An RFC 3339 timestamp for when the card was created. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute funding + # Deprecated: Funding account for the card. + # + # @return [Lithic::Models::Card::Funding] + required :funding, -> { Lithic::Models::Card::Funding } + + # @!attribute last_four + # Last four digits of the card number. + # + # @return [String] + required :last_four, String + + # @!attribute pin_status + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + # + # @return [Symbol, Lithic::Models::Card::PinStatus] + required :pin_status, enum: -> { Lithic::Models::Card::PinStatus } + + # @!attribute spend_limit + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. + # + # @return [Integer] + required :spend_limit, Integer + + # @!attribute spend_limit_duration + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @return [Symbol, Lithic::Models::SpendLimitDuration] + required :spend_limit_duration, enum: -> { Lithic::Models::SpendLimitDuration } + + # @!attribute state + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The + # card is provisioned pending manufacturing and fulfillment. Cards in this state + # can accept authorizations for e-commerce purchases, but not for "Card Present" + # purchases where the physical card itself is present. + # - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state + # `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to + # state `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this + # state can be used for e-commerce transactions or can be added to mobile + # wallets. API clients should update the card's state to `OPEN` only after the + # cardholder confirms receipt of the card. + # + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + # + # @return [Symbol, Lithic::Models::Card::State] + required :state, enum: -> { Lithic::Models::Card::State } + + # @!attribute type + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + # + # @return [Symbol, Lithic::Models::Card::Type] + required :type, enum: -> { Lithic::Models::Card::Type } + + # @!attribute [r] auth_rule_tokens + # List of identifiers for the Auth Rule(s) that are applied on the card. This + # field is deprecated and will no longer be populated in the `Card` object. The + # key will be removed from the schema in a future release. Use the `/auth_rules` + # endpoints to fetch Auth Rule information instead. + # + # @return [Array, nil] + optional :auth_rule_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :auth_rule_tokens + + # @!attribute [r] cardholder_currency + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @return [String, nil] + optional :cardholder_currency, String + + # @!parse + # # @return [String] + # attr_writer :cardholder_currency + + # @!attribute [r] cvv + # Three digit cvv printed on the back of the card. + # + # @return [String, nil] + optional :cvv, String + + # @!parse + # # @return [String] + # attr_writer :cvv + + # @!attribute [r] digital_card_art_token + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!parse + # # @return [String] + # attr_writer :digital_card_art_token + + # @!attribute [r] exp_month + # Two digit (MM) expiry month. + # + # @return [String, nil] + optional :exp_month, String + + # @!parse + # # @return [String] + # attr_writer :exp_month + + # @!attribute [r] exp_year + # Four digit (yyyy) expiry year. + # + # @return [String, nil] + optional :exp_year, String + + # @!parse + # # @return [String] + # attr_writer :exp_year + + # @!attribute [r] hostname + # Hostname of card’s locked merchant (will be empty if not applicable). + # + # @return [String, nil] + optional :hostname, String + + # @!parse + # # @return [String] + # attr_writer :hostname + + # @!attribute [r] memo + # Friendly name to identify the card. + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!attribute [r] pan + # Primary Account Number (PAN) (i.e. the card number). Customers must be PCI + # compliant to have PAN returned as a field in production. Please contact + # [support@lithic.com](mailto:support@lithic.com) for questions. + # + # @return [String, nil] + optional :pan, String + + # @!parse + # # @return [String] + # attr_writer :pan + + # @!attribute [r] pending_commands + # Indicates if there are offline PIN changes pending card interaction with an + # offline PIN terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable + # only to cards issued in markets supporting offline PINs. + # + # @return [Array, nil] + optional :pending_commands, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :pending_commands + + # @!attribute [r] product_id + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + # + # @return [String, nil] + optional :product_id, String + + # @!parse + # # @return [String] + # attr_writer :product_id + + # @!attribute replacement_for + # If the card is a replacement for another card, the globally unique identifier + # for the card that was replaced. + # + # @return [String, nil] + optional :replacement_for, String, nil?: true + + # @!parse + # # @param token [String] + # # @param account_token [String] + # # @param card_program_token [String] + # # @param created [Time] + # # @param funding [Lithic::Models::Card::Funding] + # # @param last_four [String] + # # @param pin_status [Symbol, Lithic::Models::Card::PinStatus] + # # @param spend_limit [Integer] + # # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] + # # @param state [Symbol, Lithic::Models::Card::State] + # # @param type [Symbol, Lithic::Models::Card::Type] + # # @param auth_rule_tokens [Array] + # # @param cardholder_currency [String] + # # @param cvv [String] + # # @param digital_card_art_token [String] + # # @param exp_month [String] + # # @param exp_year [String] + # # @param hostname [String] + # # @param memo [String] + # # @param pan [String] + # # @param pending_commands [Array] + # # @param product_id [String] + # # @param replacement_for [String, nil] + # # + # def initialize( + # token:, + # account_token:, + # card_program_token:, + # created:, + # funding:, + # last_four:, + # pin_status:, + # spend_limit:, + # spend_limit_duration:, + # state:, + # type:, + # auth_rule_tokens: nil, + # cardholder_currency: nil, + # cvv: nil, + # digital_card_art_token: nil, + # exp_month: nil, + # exp_year: nil, + # hostname: nil, + # memo: nil, + # pan: nil, + # pending_commands: nil, + # product_id: nil, + # replacement_for: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Funding < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this FundingAccount. + # + # @return [String] + required :token, String + + # @!attribute created + # An RFC 3339 string representing when this funding source was added to the Lithic + # account. This may be `null`. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute last_four + # The last 4 digits of the account (e.g. bank account, debit card) associated with + # this FundingAccount. This may be null. + # + # @return [String] + required :last_four, String + + # @!attribute state + # State of funding source. + # + # Funding source states: + # + # - `ENABLED` - The funding account is available to use for card creation and + # transactions. + # - `PENDING` - The funding account is still being verified e.g. bank + # micro-deposits verification. + # - `DELETED` - The founding account has been deleted. + # + # @return [Symbol, Lithic::Models::Card::Funding::State] + required :state, enum: -> { Lithic::Models::Card::Funding::State } + + # @!attribute type + # Types of funding source: + # + # - `DEPOSITORY_CHECKING` - Bank checking account. + # - `DEPOSITORY_SAVINGS` - Bank savings account. + # + # @return [Symbol, Lithic::Models::Card::Funding::Type] + required :type, enum: -> { Lithic::Models::Card::Funding::Type } + + # @!attribute [r] account_name + # Account name identifying the funding source. This may be `null`. + # + # @return [String, nil] + optional :account_name, String + + # @!parse + # # @return [String] + # attr_writer :account_name + + # @!attribute [r] nickname + # The nickname given to the `FundingAccount` or `null` if it has no nickname. + # + # @return [String, nil] + optional :nickname, String + + # @!parse + # # @return [String] + # attr_writer :nickname + + # @!parse + # # Deprecated: Funding account for the card. + # # + # # @param token [String] + # # @param created [Time] + # # @param last_four [String] + # # @param state [Symbol, Lithic::Models::Card::Funding::State] + # # @param type [Symbol, Lithic::Models::Card::Funding::Type] + # # @param account_name [String] + # # @param nickname [String] + # # + # def initialize(token:, created:, last_four:, state:, type:, account_name: nil, nickname: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # State of funding source. + # + # Funding source states: + # + # - `ENABLED` - The funding account is available to use for card creation and + # transactions. + # - `PENDING` - The funding account is still being verified e.g. bank + # micro-deposits verification. + # - `DELETED` - The founding account has been deleted. + module State + extend Lithic::Enum + + DELETED = :DELETED + ENABLED = :ENABLED + PENDING = :PENDING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Types of funding source: + # + # - `DEPOSITORY_CHECKING` - Bank checking account. + # - `DEPOSITORY_SAVINGS` - Bank savings account. + module Type + extend Lithic::Enum + + DEPOSITORY_CHECKING = :DEPOSITORY_CHECKING + DEPOSITORY_SAVINGS = :DEPOSITORY_SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + module PinStatus + extend Lithic::Enum + + OK = :OK + BLOCKED = :BLOCKED + NOT_SET = :NOT_SET + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The + # card is provisioned pending manufacturing and fulfillment. Cards in this state + # can accept authorizations for e-commerce purchases, but not for "Card Present" + # purchases where the physical card itself is present. + # - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state + # `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to + # state `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this + # state can be used for e-commerce transactions or can be added to mobile + # wallets. API clients should update the card's state to `OPEN` only after the + # cardholder confirms receipt of the card. + # + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + module State + extend Lithic::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + PENDING_ACTIVATION = :PENDING_ACTIVATION + PENDING_FULFILLMENT = :PENDING_FULFILLMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + module Type + extend Lithic::Enum + + MERCHANT_LOCKED = :MERCHANT_LOCKED + PHYSICAL = :PHYSICAL + SINGLE_USE = :SINGLE_USE + VIRTUAL = :VIRTUAL + UNLOCKED = :UNLOCKED + DIGITAL_WALLET = :DIGITAL_WALLET + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/card_convert_physical_params.rb b/lib/lithic/models/card_convert_physical_params.rb new file mode 100644 index 00000000..76f3ab2f --- /dev/null +++ b/lib/lithic/models/card_convert_physical_params.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardConvertPhysicalParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute shipping_address + # The shipping address this card will be sent to. + # + # @return [Lithic::Models::ShippingAddress] + required :shipping_address, -> { Lithic::Models::ShippingAddress } + + # @!attribute [r] carrier + # If omitted, the previous carrier will be used. + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Models::Carrier } + + # @!parse + # # @return [Lithic::Models::Carrier] + # attr_writer :carrier + + # @!attribute [r] product_id + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @return [String, nil] + optional :product_id, String + + # @!parse + # # @return [String] + # attr_writer :product_id + + # @!attribute [r] shipping_method + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @return [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::Models::CardConvertPhysicalParams::ShippingMethod } + + # @!parse + # # @return [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod] + # attr_writer :shipping_method + + # @!parse + # # @param shipping_address [Lithic::Models::ShippingAddress] + # # @param carrier [Lithic::Models::Carrier] + # # @param product_id [String] + # # @param shipping_method [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(shipping_address:, carrier: nil, product_id: nil, shipping_method: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY = :"2-DAY" + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/card_create_params.rb b/lib/lithic/models/card_create_params.rb new file mode 100644 index 00000000..a483a163 --- /dev/null +++ b/lib/lithic/models/card_create_params.rb @@ -0,0 +1,371 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute type + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + # + # @return [Symbol, Lithic::Models::CardCreateParams::Type] + required :type, enum: -> { Lithic::Models::CardCreateParams::Type } + + # @!attribute [r] account_token + # Globally unique identifier for the account that the card will be associated + # with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] card_program_token + # For card programs with more than one BIN range. This must be configured with + # Lithic before use. Identifies the card program/BIN range under which to create + # the card. If omitted, will utilize the program's default `card_program_token`. + # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + # + # @return [String, nil] + optional :card_program_token, String + + # @!parse + # # @return [String] + # attr_writer :card_program_token + + # @!attribute [r] carrier + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Models::Carrier } + + # @!parse + # # @return [Lithic::Models::Carrier] + # attr_writer :carrier + + # @!attribute [r] digital_card_art_token + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!parse + # # @return [String] + # attr_writer :digital_card_art_token + + # @!attribute [r] exp_month + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date will be generated. + # + # @return [String, nil] + optional :exp_month, String + + # @!parse + # # @return [String] + # attr_writer :exp_month + + # @!attribute [r] exp_year + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date will be generated. + # + # @return [String, nil] + optional :exp_year, String + + # @!parse + # # @return [String] + # attr_writer :exp_year + + # @!attribute [r] memo + # Friendly name to identify the card. + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!attribute [r] pin + # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and + # `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + # + # @return [String, nil] + optional :pin, String + + # @!parse + # # @return [String] + # attr_writer :pin + + # @!attribute [r] product_id + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + # + # @return [String, nil] + optional :product_id, String + + # @!parse + # # @return [String] + # attr_writer :product_id + + # @!attribute [r] replacement_account_token + # Restricted field limited to select use cases. Lithic will reach out directly if + # this field should be used. Globally unique identifier for the replacement card's + # account. If this field is specified, `replacement_for` must also be specified. + # If `replacement_for` is specified and this field is omitted, the replacement + # card's account will be inferred from the card being replaced. + # + # @return [String, nil] + optional :replacement_account_token, String + + # @!parse + # # @return [String] + # attr_writer :replacement_account_token + + # @!attribute [r] replacement_for + # Globally unique identifier for the card that this card will replace. If the card + # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is + # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + # + # @return [String, nil] + optional :replacement_for, String + + # @!parse + # # @return [String] + # attr_writer :replacement_for + + # @!attribute [r] shipping_address + # + # @return [Lithic::Models::ShippingAddress, nil] + optional :shipping_address, -> { Lithic::Models::ShippingAddress } + + # @!parse + # # @return [Lithic::Models::ShippingAddress] + # attr_writer :shipping_address + + # @!attribute [r] shipping_method + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @return [Symbol, Lithic::Models::CardCreateParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::Models::CardCreateParams::ShippingMethod } + + # @!parse + # # @return [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] + # attr_writer :shipping_method + + # @!attribute [r] spend_limit + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + # + # @return [Integer, nil] + optional :spend_limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :spend_limit + + # @!attribute [r] spend_limit_duration + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @return [Symbol, Lithic::Models::SpendLimitDuration, nil] + optional :spend_limit_duration, enum: -> { Lithic::Models::SpendLimitDuration } + + # @!parse + # # @return [Symbol, Lithic::Models::SpendLimitDuration] + # attr_writer :spend_limit_duration + + # @!attribute [r] state + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # + # @return [Symbol, Lithic::Models::CardCreateParams::State, nil] + optional :state, enum: -> { Lithic::Models::CardCreateParams::State } + + # @!parse + # # @return [Symbol, Lithic::Models::CardCreateParams::State] + # attr_writer :state + + # @!parse + # # @param type [Symbol, Lithic::Models::CardCreateParams::Type] + # # @param account_token [String] + # # @param card_program_token [String] + # # @param carrier [Lithic::Models::Carrier] + # # @param digital_card_art_token [String] + # # @param exp_month [String] + # # @param exp_year [String] + # # @param memo [String] + # # @param pin [String] + # # @param product_id [String] + # # @param replacement_account_token [String] + # # @param replacement_for [String] + # # @param shipping_address [Lithic::Models::ShippingAddress] + # # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] + # # @param spend_limit [Integer] + # # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] + # # @param state [Symbol, Lithic::Models::CardCreateParams::State] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # type:, + # account_token: nil, + # card_program_token: nil, + # carrier: nil, + # digital_card_art_token: nil, + # exp_month: nil, + # exp_year: nil, + # memo: nil, + # pin: nil, + # product_id: nil, + # replacement_account_token: nil, + # replacement_for: nil, + # shipping_address: nil, + # shipping_method: nil, + # spend_limit: nil, + # spend_limit_duration: nil, + # state: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + module Type + extend Lithic::Enum + + MERCHANT_LOCKED = :MERCHANT_LOCKED + PHYSICAL = :PHYSICAL + SINGLE_USE = :SINGLE_USE + VIRTUAL = :VIRTUAL + UNLOCKED = :UNLOCKED + DIGITAL_WALLET = :DIGITAL_WALLET + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY = :"2_DAY" + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Enum + + OPEN = :OPEN + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/card_embed_params.rb b/lib/lithic/models/card_embed_params.rb new file mode 100644 index 00000000..03cb0b33 --- /dev/null +++ b/lib/lithic/models/card_embed_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardEmbedParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute embed_request + # A base64 encoded JSON string of an EmbedRequest to specify which card to load. + # + # @return [String] + required :embed_request, String + + # @!attribute hmac + # SHA256 HMAC of the embed_request JSON string with base64 digest. + # + # @return [String] + required :hmac, String + + # @!parse + # # @param embed_request [String] + # # @param hmac [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(embed_request:, hmac:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_list_params.rb b/lib/lithic/models/card_list_params.rb new file mode 100644 index 00000000..2b7a69cb --- /dev/null +++ b/lib/lithic/models/card_list_params.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # Returns cards associated with the specified account. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] state + # Returns cards with the specified state. + # + # @return [Symbol, Lithic::Models::CardListParams::State, nil] + optional :state, enum: -> { Lithic::Models::CardListParams::State } + + # @!parse + # # @return [Symbol, Lithic::Models::CardListParams::State] + # attr_writer :state + + # @!parse + # # @param account_token [String] + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param state [Symbol, Lithic::Models::CardListParams::State] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # begin_: nil, + # end_: nil, + # ending_before: nil, + # page_size: nil, + # starting_after: nil, + # state: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Returns cards with the specified state. + module State + extend Lithic::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + PENDING_ACTIVATION = :PENDING_ACTIVATION + PENDING_FULFILLMENT = :PENDING_FULFILLMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/card_program.rb b/lib/lithic/models/card_program.rb new file mode 100644 index 00000000..5f669fc2 --- /dev/null +++ b/lib/lithic/models/card_program.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardProgram < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute created + # Timestamp of when the card program was created. + # + # @return [Time] + required :created, Time + + # @!attribute name + # The name of the card program. + # + # @return [String] + required :name, String + + # @!attribute pan_range_end + # The first digits of the card number that this card program ends with. + # + # @return [String] + required :pan_range_end, String + + # @!attribute pan_range_start + # The first digits of the card number that this card program starts with. + # + # @return [String] + required :pan_range_start, String + + # @!attribute [r] cardholder_currency + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @return [String, nil] + optional :cardholder_currency, String + + # @!parse + # # @return [String] + # attr_writer :cardholder_currency + + # @!attribute [r] settlement_currencies + # List of 3-character alphabetic ISO 4217 codes for the currencies that the card + # program supports for settlement. + # + # @return [Array, nil] + optional :settlement_currencies, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :settlement_currencies + + # @!parse + # # @param token [String] + # # @param created [Time] + # # @param name [String] + # # @param pan_range_end [String] + # # @param pan_range_start [String] + # # @param cardholder_currency [String] + # # @param settlement_currencies [Array] + # # + # def initialize( + # token:, + # created:, + # name:, + # pan_range_end:, + # pan_range_start:, + # cardholder_currency: nil, + # settlement_currencies: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_program_list_params.rb b/lib/lithic/models/card_program_list_params.rb new file mode 100644 index 00000000..04031df8 --- /dev/null +++ b/lib/lithic/models/card_program_list_params.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardProgramListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_program_retrieve_params.rb b/lib/lithic/models/card_program_retrieve_params.rb new file mode 100644 index 00000000..f2860e5e --- /dev/null +++ b/lib/lithic/models/card_program_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardProgramRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_provision_params.rb b/lib/lithic/models/card_provision_params.rb new file mode 100644 index 00000000..a18a6804 --- /dev/null +++ b/lib/lithic/models/card_provision_params.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardProvisionParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] certificate + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + # + # @return [String, nil] + optional :certificate, String + + # @!parse + # # @return [String] + # attr_writer :certificate + + # @!attribute [r] client_device_id + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + # + # @return [String, nil] + optional :client_device_id, String + + # @!parse + # # @return [String] + # attr_writer :client_device_id + + # @!attribute [r] client_wallet_account_id + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + # + # @return [String, nil] + optional :client_wallet_account_id, String + + # @!parse + # # @return [String] + # attr_writer :client_wallet_account_id + + # @!attribute [r] digital_wallet + # Name of digital wallet provider. + # + # @return [Symbol, Lithic::Models::CardProvisionParams::DigitalWallet, nil] + optional :digital_wallet, enum: -> { Lithic::Models::CardProvisionParams::DigitalWallet } + + # @!parse + # # @return [Symbol, Lithic::Models::CardProvisionParams::DigitalWallet] + # attr_writer :digital_wallet + + # @!attribute [r] nonce + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + # + # @return [String, nil] + optional :nonce, String + + # @!parse + # # @return [String] + # attr_writer :nonce + + # @!attribute [r] nonce_signature + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + # + # @return [String, nil] + optional :nonce_signature, String + + # @!parse + # # @return [String] + # attr_writer :nonce_signature + + # @!parse + # # @param certificate [String] + # # @param client_device_id [String] + # # @param client_wallet_account_id [String] + # # @param digital_wallet [Symbol, Lithic::Models::CardProvisionParams::DigitalWallet] + # # @param nonce [String] + # # @param nonce_signature [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # certificate: nil, + # client_device_id: nil, + # client_wallet_account_id: nil, + # digital_wallet: nil, + # nonce: nil, + # nonce_signature: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Name of digital wallet provider. + module DigitalWallet + extend Lithic::Enum + + APPLE_PAY = :APPLE_PAY + GOOGLE_PAY = :GOOGLE_PAY + SAMSUNG_PAY = :SAMSUNG_PAY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/card_provision_response.rb b/lib/lithic/models/card_provision_response.rb new file mode 100644 index 00000000..99c238e9 --- /dev/null +++ b/lib/lithic/models/card_provision_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardProvisionResponse < Lithic::BaseModel + # @!attribute [r] provisioning_payload + # + # @return [String, nil] + optional :provisioning_payload, String + + # @!parse + # # @return [String] + # attr_writer :provisioning_payload + + # @!parse + # # @param provisioning_payload [String] + # # + # def initialize(provisioning_payload: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_reissue_params.rb b/lib/lithic/models/card_reissue_params.rb new file mode 100644 index 00000000..ccaa67fd --- /dev/null +++ b/lib/lithic/models/card_reissue_params.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardReissueParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] carrier + # If omitted, the previous carrier will be used. + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Models::Carrier } + + # @!parse + # # @return [Lithic::Models::Carrier] + # attr_writer :carrier + + # @!attribute [r] product_id + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @return [String, nil] + optional :product_id, String + + # @!parse + # # @return [String] + # attr_writer :product_id + + # @!attribute [r] shipping_address + # If omitted, the previous shipping address will be used. + # + # @return [Lithic::Models::ShippingAddress, nil] + optional :shipping_address, -> { Lithic::Models::ShippingAddress } + + # @!parse + # # @return [Lithic::Models::ShippingAddress] + # attr_writer :shipping_address + + # @!attribute [r] shipping_method + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @return [Symbol, Lithic::Models::CardReissueParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::Models::CardReissueParams::ShippingMethod } + + # @!parse + # # @return [Symbol, Lithic::Models::CardReissueParams::ShippingMethod] + # attr_writer :shipping_method + + # @!parse + # # @param carrier [Lithic::Models::Carrier] + # # @param product_id [String] + # # @param shipping_address [Lithic::Models::ShippingAddress] + # # @param shipping_method [Symbol, Lithic::Models::CardReissueParams::ShippingMethod] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(carrier: nil, product_id: nil, shipping_address: nil, shipping_method: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY = :"2-DAY" + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/card_renew_params.rb b/lib/lithic/models/card_renew_params.rb new file mode 100644 index 00000000..5783143c --- /dev/null +++ b/lib/lithic/models/card_renew_params.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardRenewParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute shipping_address + # The shipping address this card will be sent to. + # + # @return [Lithic::Models::ShippingAddress] + required :shipping_address, -> { Lithic::Models::ShippingAddress } + + # @!attribute [r] carrier + # If omitted, the previous carrier will be used. + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Models::Carrier } + + # @!parse + # # @return [Lithic::Models::Carrier] + # attr_writer :carrier + + # @!attribute [r] exp_month + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date six years in the future will be generated. + # + # @return [String, nil] + optional :exp_month, String + + # @!parse + # # @return [String] + # attr_writer :exp_month + + # @!attribute [r] exp_year + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date six years in the future will be generated. + # + # @return [String, nil] + optional :exp_year, String + + # @!parse + # # @return [String] + # attr_writer :exp_year + + # @!attribute [r] product_id + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @return [String, nil] + optional :product_id, String + + # @!parse + # # @return [String] + # attr_writer :product_id + + # @!attribute [r] shipping_method + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @return [Symbol, Lithic::Models::CardRenewParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::Models::CardRenewParams::ShippingMethod } + + # @!parse + # # @return [Symbol, Lithic::Models::CardRenewParams::ShippingMethod] + # attr_writer :shipping_method + + # @!parse + # # @param shipping_address [Lithic::Models::ShippingAddress] + # # @param carrier [Lithic::Models::Carrier] + # # @param exp_month [String] + # # @param exp_year [String] + # # @param product_id [String] + # # @param shipping_method [Symbol, Lithic::Models::CardRenewParams::ShippingMethod] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # shipping_address:, + # carrier: nil, + # exp_month: nil, + # exp_year: nil, + # product_id: nil, + # shipping_method: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY = :"2-DAY" + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/card_retrieve_params.rb b/lib/lithic/models/card_retrieve_params.rb new file mode 100644 index 00000000..1dcc75ed --- /dev/null +++ b/lib/lithic/models/card_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_retrieve_spend_limits_params.rb b/lib/lithic/models/card_retrieve_spend_limits_params.rb new file mode 100644 index 00000000..48808933 --- /dev/null +++ b/lib/lithic/models/card_retrieve_spend_limits_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardRetrieveSpendLimitsParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_search_by_pan_params.rb b/lib/lithic/models/card_search_by_pan_params.rb new file mode 100644 index 00000000..fe964d12 --- /dev/null +++ b/lib/lithic/models/card_search_by_pan_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardSearchByPanParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute pan + # The PAN for the card being retrieved. + # + # @return [String] + required :pan, String + + # @!parse + # # @param pan [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(pan:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/card_spend_limits.rb b/lib/lithic/models/card_spend_limits.rb new file mode 100644 index 00000000..c2f8494a --- /dev/null +++ b/lib/lithic/models/card_spend_limits.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardSpendLimits < Lithic::BaseModel + # @!attribute available_spend_limit + # + # @return [Lithic::Models::CardSpendLimits::AvailableSpendLimit] + required :available_spend_limit, -> { Lithic::Models::CardSpendLimits::AvailableSpendLimit } + + # @!attribute [r] spend_limit + # + # @return [Lithic::Models::CardSpendLimits::SpendLimit, nil] + optional :spend_limit, -> { Lithic::Models::CardSpendLimits::SpendLimit } + + # @!parse + # # @return [Lithic::Models::CardSpendLimits::SpendLimit] + # attr_writer :spend_limit + + # @!attribute [r] spend_velocity + # + # @return [Lithic::Models::CardSpendLimits::SpendVelocity, nil] + optional :spend_velocity, -> { Lithic::Models::CardSpendLimits::SpendVelocity } + + # @!parse + # # @return [Lithic::Models::CardSpendLimits::SpendVelocity] + # attr_writer :spend_velocity + + # @!parse + # # @param available_spend_limit [Lithic::Models::CardSpendLimits::AvailableSpendLimit] + # # @param spend_limit [Lithic::Models::CardSpendLimits::SpendLimit] + # # @param spend_velocity [Lithic::Models::CardSpendLimits::SpendVelocity] + # # + # def initialize(available_spend_limit:, spend_limit: nil, spend_velocity: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class AvailableSpendLimit < Lithic::BaseModel + # @!attribute [r] annually + # The available spend limit (in cents) relative to the annual limit configured on + # the Card (e.g. 100000 would be a $1,000 limit). + # + # @return [Integer, nil] + optional :annually, Integer + + # @!parse + # # @return [Integer] + # attr_writer :annually + + # @!attribute [r] forever + # The available spend limit (in cents) relative to the forever limit configured on + # the Card. + # + # @return [Integer, nil] + optional :forever, Integer + + # @!parse + # # @return [Integer] + # attr_writer :forever + + # @!attribute [r] monthly + # The available spend limit (in cents) relative to the monthly limit configured on + # the Card. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!parse + # # @return [Integer] + # attr_writer :monthly + + # @!parse + # # @param annually [Integer] + # # @param forever [Integer] + # # @param monthly [Integer] + # # + # def initialize(annually: nil, forever: nil, monthly: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class SpendLimit < Lithic::BaseModel + # @!attribute [r] annually + # The configured annual spend limit (in cents) on the Card. + # + # @return [Integer, nil] + optional :annually, Integer + + # @!parse + # # @return [Integer] + # attr_writer :annually + + # @!attribute [r] forever + # The configured forever spend limit (in cents) on the Card. + # + # @return [Integer, nil] + optional :forever, Integer + + # @!parse + # # @return [Integer] + # attr_writer :forever + + # @!attribute [r] monthly + # The configured monthly spend limit (in cents) on the Card. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!parse + # # @return [Integer] + # attr_writer :monthly + + # @!parse + # # @param annually [Integer] + # # @param forever [Integer] + # # @param monthly [Integer] + # # + # def initialize(annually: nil, forever: nil, monthly: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class SpendVelocity < Lithic::BaseModel + # @!attribute [r] annually + # Current annual spend velocity (in cents) on the Card. Present if annual spend + # limit is set. + # + # @return [Integer, nil] + optional :annually, Integer + + # @!parse + # # @return [Integer] + # attr_writer :annually + + # @!attribute [r] forever + # Current forever spend velocity (in cents) on the Card. Present if forever spend + # limit is set. + # + # @return [Integer, nil] + optional :forever, Integer + + # @!parse + # # @return [Integer] + # attr_writer :forever + + # @!attribute [r] monthly + # Current monthly spend velocity (in cents) on the Card. Present if monthly spend + # limit is set. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!parse + # # @return [Integer] + # attr_writer :monthly + + # @!parse + # # @param annually [Integer] + # # @param forever [Integer] + # # @param monthly [Integer] + # # + # def initialize(annually: nil, forever: nil, monthly: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/card_update_params.rb b/lib/lithic/models/card_update_params.rb new file mode 100644 index 00000000..b144b028 --- /dev/null +++ b/lib/lithic/models/card_update_params.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] digital_card_art_token + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!parse + # # @return [String] + # attr_writer :digital_card_art_token + + # @!attribute [r] memo + # Friendly name to identify the card. + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!attribute [r] pin + # Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + # + # @return [String, nil] + optional :pin, String + + # @!parse + # # @return [String] + # attr_writer :pin + + # @!attribute [r] pin_status + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + # + # @return [Symbol, Lithic::Models::CardUpdateParams::PinStatus, nil] + optional :pin_status, enum: -> { Lithic::Models::CardUpdateParams::PinStatus } + + # @!parse + # # @return [Symbol, Lithic::Models::CardUpdateParams::PinStatus] + # attr_writer :pin_status + + # @!attribute [r] spend_limit + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + # + # @return [Integer, nil] + optional :spend_limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :spend_limit + + # @!attribute [r] spend_limit_duration + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @return [Symbol, Lithic::Models::SpendLimitDuration, nil] + optional :spend_limit_duration, enum: -> { Lithic::Models::SpendLimitDuration } + + # @!parse + # # @return [Symbol, Lithic::Models::SpendLimitDuration] + # attr_writer :spend_limit_duration + + # @!attribute [r] state + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # + # @return [Symbol, Lithic::Models::CardUpdateParams::State, nil] + optional :state, enum: -> { Lithic::Models::CardUpdateParams::State } + + # @!parse + # # @return [Symbol, Lithic::Models::CardUpdateParams::State] + # attr_writer :state + + # @!parse + # # @param digital_card_art_token [String] + # # @param memo [String] + # # @param pin [String] + # # @param pin_status [Symbol, Lithic::Models::CardUpdateParams::PinStatus] + # # @param spend_limit [Integer] + # # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] + # # @param state [Symbol, Lithic::Models::CardUpdateParams::State] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # digital_card_art_token: nil, + # memo: nil, + # pin: nil, + # pin_status: nil, + # spend_limit: nil, + # spend_limit_duration: nil, + # state: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + module PinStatus + extend Lithic::Enum + + OK = :OK + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/cards/aggregate_balance_list_params.rb b/lib/lithic/models/cards/aggregate_balance_list_params.rb new file mode 100644 index 00000000..2d7aae90 --- /dev/null +++ b/lib/lithic/models/cards/aggregate_balance_list_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + class AggregateBalanceListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # Cardholder to retrieve aggregate balances for. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] business_account_token + # Business to retrieve aggregate balances for. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!parse + # # @param account_token [String] + # # @param business_account_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(account_token: nil, business_account_token: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/cards/aggregate_balance_list_response.rb b/lib/lithic/models/cards/aggregate_balance_list_response.rb new file mode 100644 index 00000000..c35e1e38 --- /dev/null +++ b/lib/lithic/models/cards/aggregate_balance_list_response.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + class AggregateBalanceListResponse < Lithic::BaseModel + # @!attribute available_amount + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :available_amount, Integer + + # @!attribute created + # Date and time for when the balance was first created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @return [String] + required :currency, String + + # @!attribute last_card_token + # Globally unique identifier for the card that had its balance updated most + # recently + # + # @return [String] + required :last_card_token, String + + # @!attribute last_transaction_event_token + # Globally unique identifier for the last transaction event that impacted this + # balance + # + # @return [String] + required :last_transaction_event_token, String + + # @!attribute last_transaction_token + # Globally unique identifier for the last transaction that impacted this balance + # + # @return [String] + required :last_transaction_token, String + + # @!attribute pending_amount + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute total_amount + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD) + # + # @return [Integer] + required :total_amount, Integer + + # @!attribute updated + # Date and time for when the balance was last updated. + # + # @return [Time] + required :updated, Time + + # @!parse + # # Card Aggregate Balance across all end-user accounts + # # + # # @param available_amount [Integer] + # # @param created [Time] + # # @param currency [String] + # # @param last_card_token [String] + # # @param last_transaction_event_token [String] + # # @param last_transaction_token [String] + # # @param pending_amount [Integer] + # # @param total_amount [Integer] + # # @param updated [Time] + # # + # def initialize( + # available_amount:, + # created:, + # currency:, + # last_card_token:, + # last_transaction_event_token:, + # last_transaction_token:, + # pending_amount:, + # total_amount:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/cards/balance_list_params.rb b/lib/lithic/models/cards/balance_list_params.rb new file mode 100644 index 00000000..3f0022d0 --- /dev/null +++ b/lib/lithic/models/cards/balance_list_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + class BalanceListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] balance_date + # UTC date of the balance to retrieve. Defaults to latest available balance + # + # @return [Time, nil] + optional :balance_date, Time + + # @!parse + # # @return [Time] + # attr_writer :balance_date + + # @!attribute [r] last_transaction_event_token + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + # + # @return [String, nil] + optional :last_transaction_event_token, String + + # @!parse + # # @return [String] + # attr_writer :last_transaction_event_token + + # @!parse + # # @param balance_date [Time] + # # @param last_transaction_event_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(balance_date: nil, last_transaction_event_token: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/cards/balance_list_response.rb b/lib/lithic/models/cards/balance_list_response.rb new file mode 100644 index 00000000..b1942eee --- /dev/null +++ b/lib/lithic/models/cards/balance_list_response.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + class BalanceListResponse < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the financial account that holds this balance. + # + # @return [String] + required :token, String + + # @!attribute available_amount + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :available_amount, Integer + + # @!attribute created + # Date and time for when the balance was first created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @return [String] + required :currency, String + + # @!attribute last_transaction_event_token + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + # + # @return [String] + required :last_transaction_event_token, String + + # @!attribute last_transaction_token + # Globally unique identifier for the last financial transaction that impacted this + # balance. + # + # @return [String] + required :last_transaction_token, String + + # @!attribute pending_amount + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute total_amount + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + # + # @return [Integer] + required :total_amount, Integer + + # @!attribute type + # Type of financial account. + # + # @return [Symbol, Lithic::Models::Cards::BalanceListResponse::Type] + required :type, enum: -> { Lithic::Models::Cards::BalanceListResponse::Type } + + # @!attribute updated + # Date and time for when the balance was last updated. + # + # @return [Time] + required :updated, Time + + # @!parse + # # Balance of a Financial Account + # # + # # @param token [String] + # # @param available_amount [Integer] + # # @param created [Time] + # # @param currency [String] + # # @param last_transaction_event_token [String] + # # @param last_transaction_token [String] + # # @param pending_amount [Integer] + # # @param total_amount [Integer] + # # @param type [Symbol, Lithic::Models::Cards::BalanceListResponse::Type] + # # @param updated [Time] + # # + # def initialize( + # token:, + # available_amount:, + # created:, + # currency:, + # last_transaction_event_token:, + # last_transaction_token:, + # pending_amount:, + # total_amount:, + # type:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of financial account. + module Type + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/cards/financial_transaction_list_params.rb b/lib/lithic/models/cards/financial_transaction_list_params.rb new file mode 100644 index 00000000..c4823b4c --- /dev/null +++ b/lib/lithic/models/cards/financial_transaction_list_params.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + class FinancialTransactionListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] category + # Financial Transaction category to be returned. + # + # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category, nil] + optional :category, enum: -> { Lithic::Models::Cards::FinancialTransactionListParams::Category } + + # @!parse + # # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category] + # attr_writer :category + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] result + # Financial Transaction result to be returned. + # + # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result, nil] + optional :result, enum: -> { Lithic::Models::Cards::FinancialTransactionListParams::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result] + # attr_writer :result + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # Financial Transaction status to be returned. + # + # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::Cards::FinancialTransactionListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status] + # attr_writer :status + + # @!parse + # # @param begin_ [Time] + # # @param category [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param result [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # category: nil, + # end_: nil, + # ending_before: nil, + # result: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Financial Transaction category to be returned. + module Category + extend Lithic::Enum + + CARD = :CARD + TRANSFER = :TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + VOIDED = :VOIDED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/cards/financial_transaction_retrieve_params.rb b/lib/lithic/models/cards/financial_transaction_retrieve_params.rb new file mode 100644 index 00000000..e9dc4656 --- /dev/null +++ b/lib/lithic/models/cards/financial_transaction_retrieve_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + class FinancialTransactionRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!parse + # # @param card_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(card_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/carrier.rb b/lib/lithic/models/carrier.rb new file mode 100644 index 00000000..06a74bef --- /dev/null +++ b/lib/lithic/models/carrier.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Carrier < Lithic::BaseModel + # @!attribute [r] qr_code_url + # QR code url to display on the card carrier + # + # @return [String, nil] + optional :qr_code_url, String + + # @!parse + # # @return [String] + # attr_writer :qr_code_url + + # @!parse + # # @param qr_code_url [String] + # # + # def initialize(qr_code_url: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/client_api_status_params.rb b/lib/lithic/models/client_api_status_params.rb new file mode 100644 index 00000000..0615b2e2 --- /dev/null +++ b/lib/lithic/models/client_api_status_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ClientAPIStatusParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/credit_products/extended_credit.rb b/lib/lithic/models/credit_products/extended_credit.rb new file mode 100644 index 00000000..bad72c93 --- /dev/null +++ b/lib/lithic/models/credit_products/extended_credit.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + class CreditProductsExtendedCredit < Lithic::BaseModel + # @!attribute credit_extended + # + # @return [Integer] + required :credit_extended, Integer + + # @!parse + # # @param credit_extended [Integer] + # # + # def initialize(credit_extended:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/credit_products/extended_credit_retrieve_params.rb b/lib/lithic/models/credit_products/extended_credit_retrieve_params.rb new file mode 100644 index 00000000..f065042a --- /dev/null +++ b/lib/lithic/models/credit_products/extended_credit_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + class ExtendedCreditRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/credit_products/prime_rate_create_params.rb b/lib/lithic/models/credit_products/prime_rate_create_params.rb new file mode 100644 index 00000000..bc8cda0b --- /dev/null +++ b/lib/lithic/models/credit_products/prime_rate_create_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + class PrimeRateCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute effective_date + # Date the rate goes into effect + # + # @return [Date] + required :effective_date, Date + + # @!attribute rate + # The rate in decimal format + # + # @return [String] + required :rate, String + + # @!parse + # # @param effective_date [Date] + # # @param rate [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(effective_date:, rate:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/credit_products/prime_rate_retrieve_params.rb b/lib/lithic/models/credit_products/prime_rate_retrieve_params.rb new file mode 100644 index 00000000..331ccce5 --- /dev/null +++ b/lib/lithic/models/credit_products/prime_rate_retrieve_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + class PrimeRateRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] ending_before + # The effective date that the prime rates ends before + # + # @return [Date, nil] + optional :ending_before, Date + + # @!parse + # # @return [Date] + # attr_writer :ending_before + + # @!attribute [r] starting_after + # The effective date that the prime rate starts after + # + # @return [Date, nil] + optional :starting_after, Date + + # @!parse + # # @return [Date] + # attr_writer :starting_after + + # @!parse + # # @param ending_before [Date] + # # @param starting_after [Date] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(ending_before: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/credit_products/prime_rate_retrieve_response.rb b/lib/lithic/models/credit_products/prime_rate_retrieve_response.rb new file mode 100644 index 00000000..27391c4d --- /dev/null +++ b/lib/lithic/models/credit_products/prime_rate_retrieve_response.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + class PrimeRateRetrieveResponse < Lithic::BaseModel + # @!attribute data + # List of prime rates + # + # @return [Array] + required :data, -> { Lithic::ArrayOf[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data] } + + # @!attribute has_more + # Whether there are more prime rates + # + # @return [Boolean] + required :has_more, Lithic::BooleanModel + + # @!parse + # # @param data [Array] + # # @param has_more [Boolean] + # # + # def initialize(data:, has_more:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Data < Lithic::BaseModel + # @!attribute effective_date + # Date the rate goes into effect + # + # @return [Date] + required :effective_date, Date + + # @!attribute rate + # The rate in decimal format + # + # @return [String] + required :rate, String + + # @!parse + # # @param effective_date [Date] + # # @param rate [String] + # # + # def initialize(effective_date:, rate:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/digital_card_art.rb b/lib/lithic/models/digital_card_art.rb new file mode 100644 index 00000000..45dcae37 --- /dev/null +++ b/lib/lithic/models/digital_card_art.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalCardArtAPI < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the card art. + # + # @return [String] + required :token, String + + # @!attribute card_program_token + # Globally unique identifier for the card program. + # + # @return [String] + required :card_program_token, String + + # @!attribute created + # Timestamp of when card art was created. + # + # @return [Time] + required :created, Time + + # @!attribute description + # Description of the card art. + # + # @return [String] + required :description, String + + # @!attribute is_enabled + # Whether the card art is enabled. + # + # @return [Boolean] + required :is_enabled, Lithic::BooleanModel + + # @!attribute network + # Card network. + # + # @return [Symbol, Lithic::Models::DigitalCardArtAPI::Network] + required :network, enum: -> { Lithic::Models::DigitalCardArtAPI::Network } + + # @!attribute [r] is_card_program_default + # Whether the card art is the default card art to be added upon tokenization. + # + # @return [Boolean, nil] + optional :is_card_program_default, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_card_program_default + + # @!parse + # # @param token [String] + # # @param card_program_token [String] + # # @param created [Time] + # # @param description [String] + # # @param is_enabled [Boolean] + # # @param network [Symbol, Lithic::Models::DigitalCardArtAPI::Network] + # # @param is_card_program_default [Boolean] + # # + # def initialize( + # token:, + # card_program_token:, + # created:, + # description:, + # is_enabled:, + # network:, + # is_card_program_default: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Card network. + module Network + extend Lithic::Enum + + MASTERCARD = :MASTERCARD + VISA = :VISA + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/digital_card_art_list_params.rb b/lib/lithic/models/digital_card_art_list_params.rb new file mode 100644 index 00000000..51212a0d --- /dev/null +++ b/lib/lithic/models/digital_card_art_list_params.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalCardArtListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/digital_card_art_retrieve_params.rb b/lib/lithic/models/digital_card_art_retrieve_params.rb new file mode 100644 index 00000000..8780456b --- /dev/null +++ b/lib/lithic/models/digital_card_art_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalCardArtRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/dispute.rb b/lib/lithic/models/dispute.rb new file mode 100644 index 00000000..aa6694c0 --- /dev/null +++ b/lib/lithic/models/dispute.rb @@ -0,0 +1,340 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Dispute < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount under dispute. May be different from the original transaction amount. + # + # @return [Integer] + required :amount, Integer + + # @!attribute arbitration_date + # Date dispute entered arbitration. + # + # @return [Time, nil] + required :arbitration_date, Time, nil?: true + + # @!attribute created + # Timestamp of when first Dispute was reported. + # + # @return [Time] + required :created, Time + + # @!attribute customer_filed_date + # Date that the dispute was filed by the customer making the dispute. + # + # @return [Time, nil] + required :customer_filed_date, Time, nil?: true + + # @!attribute customer_note + # End customer description of the reason for the dispute. + # + # @return [String, nil] + required :customer_note, String, nil?: true + + # @!attribute network_claim_ids + # Unique identifiers for the dispute from the network. + # + # @return [Array, nil] + required :network_claim_ids, Lithic::ArrayOf[String], nil?: true + + # @!attribute network_filed_date + # Date that the dispute was submitted to the network. + # + # @return [Time, nil] + required :network_filed_date, Time, nil?: true + + # @!attribute network_reason_code + # Network reason code used to file the dispute. + # + # @return [String, nil] + required :network_reason_code, String, nil?: true + + # @!attribute prearbitration_date + # Date dispute entered pre-arbitration. + # + # @return [Time, nil] + required :prearbitration_date, Time, nil?: true + + # @!attribute primary_claim_id + # Unique identifier for the dispute from the network. If there are multiple, this + # will be the first claim id set by the network + # + # @return [String, nil] + required :primary_claim_id, String, nil?: true + + # @!attribute reason + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + # + # @return [Symbol, Lithic::Models::Dispute::Reason] + required :reason, enum: -> { Lithic::Models::Dispute::Reason } + + # @!attribute representment_date + # Date the representment was received. + # + # @return [Time, nil] + required :representment_date, Time, nil?: true + + # @!attribute resolution_amount + # Resolution amount net of network fees. + # + # @return [Integer, nil] + required :resolution_amount, Integer, nil?: true + + # @!attribute resolution_date + # Date that the dispute was resolved. + # + # @return [Time, nil] + required :resolution_date, Time, nil?: true + + # @!attribute resolution_note + # Note by Dispute team on the case resolution. + # + # @return [String, nil] + required :resolution_note, String, nil?: true + + # @!attribute resolution_reason + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + # + # @return [Symbol, Lithic::Models::Dispute::ResolutionReason, nil] + required :resolution_reason, enum: -> { Lithic::Models::Dispute::ResolutionReason }, nil?: true + + # @!attribute status + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + # + # @return [Symbol, Lithic::Models::Dispute::Status] + required :status, enum: -> { Lithic::Models::Dispute::Status } + + # @!attribute transaction_token + # The transaction that is being disputed. A transaction can only be disputed once + # but may have multiple dispute cases. + # + # @return [String] + required :transaction_token, String + + # @!parse + # # Dispute. + # # + # # @param token [String] + # # @param amount [Integer] + # # @param arbitration_date [Time, nil] + # # @param created [Time] + # # @param customer_filed_date [Time, nil] + # # @param customer_note [String, nil] + # # @param network_claim_ids [Array, nil] + # # @param network_filed_date [Time, nil] + # # @param network_reason_code [String, nil] + # # @param prearbitration_date [Time, nil] + # # @param primary_claim_id [String, nil] + # # @param reason [Symbol, Lithic::Models::Dispute::Reason] + # # @param representment_date [Time, nil] + # # @param resolution_amount [Integer, nil] + # # @param resolution_date [Time, nil] + # # @param resolution_note [String, nil] + # # @param resolution_reason [Symbol, Lithic::Models::Dispute::ResolutionReason, nil] + # # @param status [Symbol, Lithic::Models::Dispute::Status] + # # @param transaction_token [String] + # # + # def initialize( + # token:, + # amount:, + # arbitration_date:, + # created:, + # customer_filed_date:, + # customer_note:, + # network_claim_ids:, + # network_filed_date:, + # network_reason_code:, + # prearbitration_date:, + # primary_claim_id:, + # reason:, + # representment_date:, + # resolution_amount:, + # resolution_date:, + # resolution_note:, + # resolution_reason:, + # status:, + # transaction_token:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + module Reason + extend Lithic::Enum + + ATM_CASH_MISDISPENSE = :ATM_CASH_MISDISPENSE + CANCELLED = :CANCELLED + DUPLICATED = :DUPLICATED + FRAUD_CARD_NOT_PRESENT = :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT = :FRAUD_CARD_PRESENT + FRAUD_OTHER = :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED = :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED = :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT = :INCORRECT_AMOUNT + MISSING_AUTH = :MISSING_AUTH + OTHER = :OTHER + PROCESSING_ERROR = :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED = :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED = :REFUND_NOT_PROCESSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + module ResolutionReason + extend Lithic::Enum + + CASE_LOST = :CASE_LOST + NETWORK_REJECTED = :NETWORK_REJECTED + NO_DISPUTE_RIGHTS_3DS = :NO_DISPUTE_RIGHTS_3DS + NO_DISPUTE_RIGHTS_BELOW_THRESHOLD = :NO_DISPUTE_RIGHTS_BELOW_THRESHOLD + NO_DISPUTE_RIGHTS_CONTACTLESS = :NO_DISPUTE_RIGHTS_CONTACTLESS + NO_DISPUTE_RIGHTS_HYBRID = :NO_DISPUTE_RIGHTS_HYBRID + NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS = :NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS + NO_DISPUTE_RIGHTS_OTHER = :NO_DISPUTE_RIGHTS_OTHER + PAST_FILING_DATE = :PAST_FILING_DATE + PREARBITRATION_REJECTED = :PREARBITRATION_REJECTED + PROCESSOR_REJECTED_OTHER = :PROCESSOR_REJECTED_OTHER + REFUNDED = :REFUNDED + REFUNDED_AFTER_CHARGEBACK = :REFUNDED_AFTER_CHARGEBACK + WITHDRAWN = :WITHDRAWN + WON_ARBITRATION = :WON_ARBITRATION + WON_FIRST_CHARGEBACK = :WON_FIRST_CHARGEBACK + WON_PREARBITRATION = :WON_PREARBITRATION + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + module Status + extend Lithic::Enum + + ARBITRATION = :ARBITRATION + CASE_CLOSED = :CASE_CLOSED + CASE_WON = :CASE_WON + NEW = :NEW + PENDING_CUSTOMER = :PENDING_CUSTOMER + PREARBITRATION = :PREARBITRATION + REPRESENTMENT = :REPRESENTMENT + SUBMITTED = :SUBMITTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/dispute_create_params.rb b/lib/lithic/models/dispute_create_params.rb new file mode 100644 index 00000000..9a5b7e96 --- /dev/null +++ b/lib/lithic/models/dispute_create_params.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # Amount to dispute + # + # @return [Integer] + required :amount, Integer + + # @!attribute reason + # Reason for dispute + # + # @return [Symbol, Lithic::Models::DisputeCreateParams::Reason] + required :reason, enum: -> { Lithic::Models::DisputeCreateParams::Reason } + + # @!attribute transaction_token + # Transaction to dispute + # + # @return [String] + required :transaction_token, String + + # @!attribute [r] customer_filed_date + # Date the customer filed the dispute + # + # @return [Time, nil] + optional :customer_filed_date, Time + + # @!parse + # # @return [Time] + # attr_writer :customer_filed_date + + # @!attribute [r] customer_note + # Customer description of dispute + # + # @return [String, nil] + optional :customer_note, String + + # @!parse + # # @return [String] + # attr_writer :customer_note + + # @!parse + # # @param amount [Integer] + # # @param reason [Symbol, Lithic::Models::DisputeCreateParams::Reason] + # # @param transaction_token [String] + # # @param customer_filed_date [Time] + # # @param customer_note [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # reason:, + # transaction_token:, + # customer_filed_date: nil, + # customer_note: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Reason for dispute + module Reason + extend Lithic::Enum + + ATM_CASH_MISDISPENSE = :ATM_CASH_MISDISPENSE + CANCELLED = :CANCELLED + DUPLICATED = :DUPLICATED + FRAUD_CARD_NOT_PRESENT = :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT = :FRAUD_CARD_PRESENT + FRAUD_OTHER = :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED = :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED = :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT = :INCORRECT_AMOUNT + MISSING_AUTH = :MISSING_AUTH + OTHER = :OTHER + PROCESSING_ERROR = :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED = :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED = :REFUND_NOT_PROCESSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/dispute_delete_evidence_params.rb b/lib/lithic/models/dispute_delete_evidence_params.rb new file mode 100644 index 00000000..0067aad7 --- /dev/null +++ b/lib/lithic/models/dispute_delete_evidence_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeDeleteEvidenceParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!parse + # # @param dispute_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(dispute_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/dispute_delete_params.rb b/lib/lithic/models/dispute_delete_params.rb new file mode 100644 index 00000000..b6010ef9 --- /dev/null +++ b/lib/lithic/models/dispute_delete_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeDeleteParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/dispute_evidence.rb b/lib/lithic/models/dispute_evidence.rb new file mode 100644 index 00000000..e3794373 --- /dev/null +++ b/lib/lithic/models/dispute_evidence.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeEvidence < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute created + # Timestamp of when dispute evidence was created. + # + # @return [Time] + required :created, Time + + # @!attribute dispute_token + # Dispute token evidence is attached to. + # + # @return [String] + required :dispute_token, String + + # @!attribute upload_status + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + # + # @return [Symbol, Lithic::Models::DisputeEvidence::UploadStatus] + required :upload_status, enum: -> { Lithic::Models::DisputeEvidence::UploadStatus } + + # @!attribute [r] download_url + # URL to download evidence. Only shown when `upload_status` is `UPLOADED`. + # + # @return [String, nil] + optional :download_url, String + + # @!parse + # # @return [String] + # attr_writer :download_url + + # @!attribute [r] filename + # File name of evidence. Recommended to give the dispute evidence a human-readable + # identifier. + # + # @return [String, nil] + optional :filename, String + + # @!parse + # # @return [String] + # attr_writer :filename + + # @!attribute [r] upload_url + # URL to upload evidence. Only shown when `upload_status` is `PENDING`. + # + # @return [String, nil] + optional :upload_url, String + + # @!parse + # # @return [String] + # attr_writer :upload_url + + # @!parse + # # Dispute evidence. + # # + # # @param token [String] + # # @param created [Time] + # # @param dispute_token [String] + # # @param upload_status [Symbol, Lithic::Models::DisputeEvidence::UploadStatus] + # # @param download_url [String] + # # @param filename [String] + # # @param upload_url [String] + # # + # def initialize(token:, created:, dispute_token:, upload_status:, download_url: nil, filename: nil, upload_url: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + module UploadStatus + extend Lithic::Enum + + DELETED = :DELETED + ERROR = :ERROR + PENDING = :PENDING + REJECTED = :REJECTED + UPLOADED = :UPLOADED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/dispute_initiate_evidence_upload_params.rb b/lib/lithic/models/dispute_initiate_evidence_upload_params.rb new file mode 100644 index 00000000..967d951c --- /dev/null +++ b/lib/lithic/models/dispute_initiate_evidence_upload_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeInitiateEvidenceUploadParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] filename + # Filename of the evidence. + # + # @return [String, nil] + optional :filename, String + + # @!parse + # # @return [String] + # attr_writer :filename + + # @!parse + # # @param filename [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(filename: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/dispute_list_evidences_params.rb b/lib/lithic/models/dispute_list_evidences_params.rb new file mode 100644 index 00000000..f29484a8 --- /dev/null +++ b/lib/lithic/models/dispute_list_evidences_params.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeListEvidencesParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/dispute_list_params.rb b/lib/lithic/models/dispute_list_params.rb new file mode 100644 index 00000000..27c5ebf0 --- /dev/null +++ b/lib/lithic/models/dispute_list_params.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # List disputes of a specific status. + # + # @return [Symbol, Lithic::Models::DisputeListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::DisputeListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::DisputeListParams::Status] + # attr_writer :status + + # @!attribute [r] transaction_tokens + # Transaction tokens to filter by. + # + # @return [Array, nil] + optional :transaction_tokens, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :transaction_tokens + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::DisputeListParams::Status] + # # @param transaction_tokens [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # end_: nil, + # ending_before: nil, + # page_size: nil, + # starting_after: nil, + # status: nil, + # transaction_tokens: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # List disputes of a specific status. + module Status + extend Lithic::Enum + + ARBITRATION = :ARBITRATION + CASE_CLOSED = :CASE_CLOSED + CASE_WON = :CASE_WON + NEW = :NEW + PENDING_CUSTOMER = :PENDING_CUSTOMER + PREARBITRATION = :PREARBITRATION + REPRESENTMENT = :REPRESENTMENT + SUBMITTED = :SUBMITTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/dispute_retrieve_evidence_params.rb b/lib/lithic/models/dispute_retrieve_evidence_params.rb new file mode 100644 index 00000000..ae0bb530 --- /dev/null +++ b/lib/lithic/models/dispute_retrieve_evidence_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeRetrieveEvidenceParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!parse + # # @param dispute_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(dispute_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/dispute_retrieve_params.rb b/lib/lithic/models/dispute_retrieve_params.rb new file mode 100644 index 00000000..80f195f0 --- /dev/null +++ b/lib/lithic/models/dispute_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/dispute_update_params.rb b/lib/lithic/models/dispute_update_params.rb new file mode 100644 index 00000000..0043baac --- /dev/null +++ b/lib/lithic/models/dispute_update_params.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] amount + # Amount to dispute + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!attribute [r] customer_filed_date + # Date the customer filed the dispute + # + # @return [Time, nil] + optional :customer_filed_date, Time + + # @!parse + # # @return [Time] + # attr_writer :customer_filed_date + + # @!attribute [r] customer_note + # Customer description of dispute + # + # @return [String, nil] + optional :customer_note, String + + # @!parse + # # @return [String] + # attr_writer :customer_note + + # @!attribute [r] reason + # Reason for dispute + # + # @return [Symbol, Lithic::Models::DisputeUpdateParams::Reason, nil] + optional :reason, enum: -> { Lithic::Models::DisputeUpdateParams::Reason } + + # @!parse + # # @return [Symbol, Lithic::Models::DisputeUpdateParams::Reason] + # attr_writer :reason + + # @!parse + # # @param amount [Integer] + # # @param customer_filed_date [Time] + # # @param customer_note [String] + # # @param reason [Symbol, Lithic::Models::DisputeUpdateParams::Reason] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(amount: nil, customer_filed_date: nil, customer_note: nil, reason: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Reason for dispute + module Reason + extend Lithic::Enum + + ATM_CASH_MISDISPENSE = :ATM_CASH_MISDISPENSE + CANCELLED = :CANCELLED + DUPLICATED = :DUPLICATED + FRAUD_CARD_NOT_PRESENT = :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT = :FRAUD_CARD_PRESENT + FRAUD_OTHER = :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED = :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED = :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT = :INCORRECT_AMOUNT + MISSING_AUTH = :MISSING_AUTH + OTHER = :OTHER + PROCESSING_ERROR = :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED = :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED = :REFUND_NOT_PROCESSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/document.rb b/lib/lithic/models/document.rb new file mode 100644 index 00000000..82d2810b --- /dev/null +++ b/lib/lithic/models/document.rb @@ -0,0 +1,230 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Document < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the document. + # + # @return [String] + required :token, String + + # @!attribute account_holder_token + # Globally unique identifier for the account holder. + # + # @return [String] + required :account_holder_token, String + + # @!attribute document_type + # Type of documentation to be submitted for verification of an account holder + # + # @return [Symbol, Lithic::Models::Document::DocumentType] + required :document_type, enum: -> { Lithic::Models::Document::DocumentType } + + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute required_document_uploads + # Represents a single image of the document to upload. + # + # @return [Array] + required :required_document_uploads, + -> { Lithic::ArrayOf[Lithic::Models::Document::RequiredDocumentUpload] } + + # @!parse + # # Describes the document and the required document image uploads required to + # # re-run KYC + # # + # # @param token [String] + # # @param account_holder_token [String] + # # @param document_type [Symbol, Lithic::Models::Document::DocumentType] + # # @param entity_token [String] + # # @param required_document_uploads [Array] + # # + # def initialize(token:, account_holder_token:, document_type:, entity_token:, required_document_uploads:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of documentation to be submitted for verification of an account holder + module DocumentType + extend Lithic::Enum + + DRIVERS_LICENSE = :DRIVERS_LICENSE + PASSPORT = :PASSPORT + PASSPORT_CARD = :PASSPORT_CARD + EIN_LETTER = :EIN_LETTER + TAX_RETURN = :TAX_RETURN + OPERATING_AGREEMENT = :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION = :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING = :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION = :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION = :ARTICLES_OF_ORGANIZATION + BYLAWS = :BYLAWS + GOVERNMENT_BUSINESS_LICENSE = :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT = :PARTNERSHIP_AGREEMENT + SS4_FORM = :SS4_FORM + BANK_STATEMENT = :BANK_STATEMENT + UTILITY_BILL_STATEMENT = :UTILITY_BILL_STATEMENT + SSN_CARD = :SSN_CARD + ITIN_LETTER = :ITIN_LETTER + FINCEN_BOI_REPORT = :FINCEN_BOI_REPORT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class RequiredDocumentUpload < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the document upload. + # + # @return [String] + required :token, String + + # @!attribute accepted_entity_status_reasons + # A list of status reasons associated with a KYB account holder that have been + # satisfied by the document upload + # + # @return [Array] + required :accepted_entity_status_reasons, Lithic::ArrayOf[String] + + # @!attribute created + # When the document upload was created + # + # @return [Time] + required :created, Time + + # @!attribute image_type + # Type of image to upload. + # + # @return [Symbol, Lithic::Models::Document::RequiredDocumentUpload::ImageType] + required :image_type, enum: -> { Lithic::Models::Document::RequiredDocumentUpload::ImageType } + + # @!attribute rejected_entity_status_reasons + # A list of status reasons associated with a KYB account holder that have not been + # satisfied by the document upload + # + # @return [Array] + required :rejected_entity_status_reasons, Lithic::ArrayOf[String] + + # @!attribute status + # Status of an account holder's document upload. + # + # @return [Symbol, Lithic::Models::Document::RequiredDocumentUpload::Status] + required :status, enum: -> { Lithic::Models::Document::RequiredDocumentUpload::Status } + + # @!attribute status_reasons + # Reasons for document image upload status. + # + # @return [Array] + required :status_reasons, + -> { Lithic::ArrayOf[enum: Lithic::Models::Document::RequiredDocumentUpload::StatusReason] } + + # @!attribute updated + # When the document upload was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute upload_url + # URL to upload document image to. + # + # Note that the upload URLs expire after 7 days. If an upload URL expires, you can + # refresh the URLs by retrieving the document upload from + # `GET /account_holders/{account_holder_token}/documents`. + # + # @return [String] + required :upload_url, String + + # @!parse + # # Represents a single image of the document to upload. + # # + # # @param token [String] + # # @param accepted_entity_status_reasons [Array] + # # @param created [Time] + # # @param image_type [Symbol, Lithic::Models::Document::RequiredDocumentUpload::ImageType] + # # @param rejected_entity_status_reasons [Array] + # # @param status [Symbol, Lithic::Models::Document::RequiredDocumentUpload::Status] + # # @param status_reasons [Array] + # # @param updated [Time] + # # @param upload_url [String] + # # + # def initialize( + # token:, + # accepted_entity_status_reasons:, + # created:, + # image_type:, + # rejected_entity_status_reasons:, + # status:, + # status_reasons:, + # updated:, + # upload_url:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of image to upload. + module ImageType + extend Lithic::Enum + + FRONT = :FRONT + BACK = :BACK + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status of an account holder's document upload. + module Status + extend Lithic::Enum + + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + PENDING_UPLOAD = :PENDING_UPLOAD + UPLOADED = :UPLOADED + PARTIAL_APPROVAL = :PARTIAL_APPROVAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The status reasons for an account holder document upload that is not ACCEPTED + module StatusReason + extend Lithic::Enum + + DOCUMENT_MISSING_REQUIRED_DATA = :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY = :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE = :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE = :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD = :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY = :INVALID_ENTITY + DOCUMENT_EXPIRED = :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED = :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON = :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR = :UNKNOWN_ERROR + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/event.rb b/lib/lithic/models/event.rb new file mode 100644 index 00000000..34bf5c6b --- /dev/null +++ b/lib/lithic/models/event.rb @@ -0,0 +1,156 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Event < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute created + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # Event types: + # + # - `account_holder.created` - Notification that a new account holder has been + # created and was not rejected. + # - `account_holder.updated` - Notification that an account holder was updated. + # - `account_holder.verification` - Notification than an account holder's identity + # verification is complete. + # - `card.created` - Notification that a card has been created. + # - `card.renewed` - Notification that a card has been renewed. + # - `card.reissued` - Notification that a card has been reissued. + # - `card.shipped` - Physical card shipment notification. See + # https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. + # - `card.converted` - Notification that a virtual card has been converted to a + # physical card. + # - `card_transaction.updated` - Transaction Lifecycle webhook. See + # https://docs.lithic.com/docs/transaction-webhooks. + # - `dispute.updated` - A dispute has been updated. + # - `digital_wallet.tokenization_approval_request` - Card network's request to + # Lithic to activate a digital wallet token. + # - `digital_wallet.tokenization_result` - Notification of the end result of a + # tokenization, whether successful or failed. + # - `digital_wallet.tokenization_two_factor_authentication_code` - A code to be + # passed to an end user to complete digital wallet authentication. See + # https://docs.lithic.com/docs/tokenization-control#digital-wallet-tokenization-auth-code. + # - `digital_wallet.tokenization_two_factor_authentication_code_sent` - + # Notification that a two factor authentication code for activating a digital + # wallet has been sent to the end user. + # - `digital_wallet.tokenization_updated` - Notification that a digital wallet + # tokenization's status has changed. + # + # @return [Symbol, Lithic::Models::Event::EventType] + required :event_type, enum: -> { Lithic::Models::Event::EventType } + + # @!attribute payload + # + # @return [Hash{Symbol=>Object}] + required :payload, Lithic::HashOf[Lithic::Unknown] + + # @!parse + # # A single event that affects the transaction state and lifecycle. + # # + # # @param token [String] + # # @param created [Time] + # # @param event_type [Symbol, Lithic::Models::Event::EventType] + # # @param payload [Hash{Symbol=>Object}] + # # + # def initialize(token:, created:, event_type:, payload:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Event types: + # + # - `account_holder.created` - Notification that a new account holder has been + # created and was not rejected. + # - `account_holder.updated` - Notification that an account holder was updated. + # - `account_holder.verification` - Notification than an account holder's identity + # verification is complete. + # - `card.created` - Notification that a card has been created. + # - `card.renewed` - Notification that a card has been renewed. + # - `card.reissued` - Notification that a card has been reissued. + # - `card.shipped` - Physical card shipment notification. See + # https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. + # - `card.converted` - Notification that a virtual card has been converted to a + # physical card. + # - `card_transaction.updated` - Transaction Lifecycle webhook. See + # https://docs.lithic.com/docs/transaction-webhooks. + # - `dispute.updated` - A dispute has been updated. + # - `digital_wallet.tokenization_approval_request` - Card network's request to + # Lithic to activate a digital wallet token. + # - `digital_wallet.tokenization_result` - Notification of the end result of a + # tokenization, whether successful or failed. + # - `digital_wallet.tokenization_two_factor_authentication_code` - A code to be + # passed to an end user to complete digital wallet authentication. See + # https://docs.lithic.com/docs/tokenization-control#digital-wallet-tokenization-auth-code. + # - `digital_wallet.tokenization_two_factor_authentication_code_sent` - + # Notification that a two factor authentication code for activating a digital + # wallet has been sent to the end user. + # - `digital_wallet.tokenization_updated` - Notification that a digital wallet + # tokenization's status has changed. + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED = :"auth_rules.performance_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + CARD_CREATED = :"card.created" + CARD_RENEWED = :"card.renewed" + CARD_REISSUED = :"card.reissued" + CARD_CONVERTED = :"card.converted" + CARD_SHIPPED = :"card.shipped" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED = :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/event_list_attempts_params.rb b/lib/lithic/models/event_list_attempts_params.rb new file mode 100644 index 00000000..3341cb18 --- /dev/null +++ b/lib/lithic/models/event_list_attempts_params.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +module Lithic + module Models + class EventListAttemptsParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # + # @return [Symbol, Lithic::Models::EventListAttemptsParams::Status, nil] + optional :status, enum: -> { Lithic::Models::EventListAttemptsParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::EventListAttemptsParams::Status] + # attr_writer :status + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::EventListAttemptsParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # end_: nil, + # ending_before: nil, + # page_size: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Status + extend Lithic::Enum + + FAILED = :FAILED + PENDING = :PENDING + SENDING = :SENDING + SUCCESS = :SUCCESS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/event_list_params.rb b/lib/lithic/models/event_list_params.rb new file mode 100644 index 00000000..1d8d162e --- /dev/null +++ b/lib/lithic/models/event_list_params.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +module Lithic + module Models + class EventListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] event_types + # Event types to filter events by. + # + # @return [Array, nil] + optional :event_types, -> { Lithic::ArrayOf[enum: Lithic::Models::EventListParams::EventType] } + + # @!parse + # # @return [Array] + # attr_writer :event_types + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] with_content + # Whether to include the event payload content in the response. + # + # @return [Boolean, nil] + optional :with_content, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :with_content + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param event_types [Array] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param with_content [Boolean] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # end_: nil, + # ending_before: nil, + # event_types: nil, + # page_size: nil, + # starting_after: nil, + # with_content: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED = :"auth_rules.performance_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + CARD_CREATED = :"card.created" + CARD_RENEWED = :"card.renewed" + CARD_REISSUED = :"card.reissued" + CARD_CONVERTED = :"card.converted" + CARD_SHIPPED = :"card.shipped" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED = :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/event_retrieve_params.rb b/lib/lithic/models/event_retrieve_params.rb new file mode 100644 index 00000000..4a1288bd --- /dev/null +++ b/lib/lithic/models/event_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class EventRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/event_subscription.rb b/lib/lithic/models/event_subscription.rb new file mode 100644 index 00000000..540b2e55 --- /dev/null +++ b/lib/lithic/models/event_subscription.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +module Lithic + module Models + class EventSubscription < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute description + # A description of the subscription. + # + # @return [String] + required :description, String + + # @!attribute disabled + # Whether the subscription is disabled. + # + # @return [Boolean] + required :disabled, Lithic::BooleanModel + + # @!attribute url + # + # @return [String] + required :url, String + + # @!attribute event_types + # + # @return [Array, nil] + optional :event_types, + -> { Lithic::ArrayOf[enum: Lithic::Models::EventSubscription::EventType] }, + nil?: true + + # @!parse + # # A subscription to specific event types. + # # + # # @param token [String] + # # @param description [String] + # # @param disabled [Boolean] + # # @param url [String] + # # @param event_types [Array, nil] + # # + # def initialize(token:, description:, disabled:, url:, event_types: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED = :"auth_rules.performance_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + CARD_CREATED = :"card.created" + CARD_RENEWED = :"card.renewed" + CARD_REISSUED = :"card.reissued" + CARD_CONVERTED = :"card.converted" + CARD_SHIPPED = :"card.shipped" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED = :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/events/subscription_create_params.rb b/lib/lithic/models/events/subscription_create_params.rb new file mode 100644 index 00000000..9cba6adc --- /dev/null +++ b/lib/lithic/models/events/subscription_create_params.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute url + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @return [String] + required :url, String + + # @!attribute [r] description + # Event subscription description. + # + # @return [String, nil] + optional :description, String + + # @!parse + # # @return [String] + # attr_writer :description + + # @!attribute [r] disabled + # Whether the event subscription is active (false) or inactive (true). + # + # @return [Boolean, nil] + optional :disabled, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :disabled + + # @!attribute [r] event_types + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + # + # @return [Array, nil] + optional :event_types, + -> { Lithic::ArrayOf[enum: Lithic::Models::Events::SubscriptionCreateParams::EventType] } + + # @!parse + # # @return [Array] + # attr_writer :event_types + + # @!parse + # # @param url [String] + # # @param description [String] + # # @param disabled [Boolean] + # # @param event_types [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(url:, description: nil, disabled: nil, event_types: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED = :"auth_rules.performance_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + CARD_CREATED = :"card.created" + CARD_RENEWED = :"card.renewed" + CARD_REISSUED = :"card.reissued" + CARD_CONVERTED = :"card.converted" + CARD_SHIPPED = :"card.shipped" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED = :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/events/subscription_delete_params.rb b/lib/lithic/models/events/subscription_delete_params.rb new file mode 100644 index 00000000..aad06051 --- /dev/null +++ b/lib/lithic/models/events/subscription_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionDeleteParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_list_attempts_params.rb b/lib/lithic/models/events/subscription_list_attempts_params.rb new file mode 100644 index 00000000..32442f9b --- /dev/null +++ b/lib/lithic/models/events/subscription_list_attempts_params.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionListAttemptsParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # + # @return [Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status, nil] + optional :status, enum: -> { Lithic::Models::Events::SubscriptionListAttemptsParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status] + # attr_writer :status + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # end_: nil, + # ending_before: nil, + # page_size: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Status + extend Lithic::Enum + + FAILED = :FAILED + PENDING = :PENDING + SENDING = :SENDING + SUCCESS = :SUCCESS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/events/subscription_list_params.rb b/lib/lithic/models/events/subscription_list_params.rb new file mode 100644 index 00000000..9ced490f --- /dev/null +++ b/lib/lithic/models/events/subscription_list_params.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_recover_params.rb b/lib/lithic/models/events/subscription_recover_params.rb new file mode 100644 index 00000000..22a8fee5 --- /dev/null +++ b/lib/lithic/models/events/subscription_recover_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionRecoverParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(begin_: nil, end_: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_replay_missing_params.rb b/lib/lithic/models/events/subscription_replay_missing_params.rb new file mode 100644 index 00000000..fe6ca4a9 --- /dev/null +++ b/lib/lithic/models/events/subscription_replay_missing_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionReplayMissingParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(begin_: nil, end_: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_retrieve_params.rb b/lib/lithic/models/events/subscription_retrieve_params.rb new file mode 100644 index 00000000..5baf0526 --- /dev/null +++ b/lib/lithic/models/events/subscription_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_retrieve_secret_params.rb b/lib/lithic/models/events/subscription_retrieve_secret_params.rb new file mode 100644 index 00000000..8e4b5e17 --- /dev/null +++ b/lib/lithic/models/events/subscription_retrieve_secret_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionRetrieveSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_retrieve_secret_response.rb b/lib/lithic/models/events/subscription_retrieve_secret_response.rb new file mode 100644 index 00000000..abf7f415 --- /dev/null +++ b/lib/lithic/models/events/subscription_retrieve_secret_response.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionRetrieveSecretResponse < Lithic::BaseModel + # @!attribute [r] secret + # The secret for the event subscription. + # + # @return [String, nil] + optional :secret, String + + # @!parse + # # @return [String] + # attr_writer :secret + + # @!parse + # # @param secret [String] + # # + # def initialize(secret: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_rotate_secret_params.rb b/lib/lithic/models/events/subscription_rotate_secret_params.rb new file mode 100644 index 00000000..2a48112b --- /dev/null +++ b/lib/lithic/models/events/subscription_rotate_secret_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionRotateSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/events/subscription_send_simulated_example_params.rb b/lib/lithic/models/events/subscription_send_simulated_example_params.rb new file mode 100644 index 00000000..950e1814 --- /dev/null +++ b/lib/lithic/models/events/subscription_send_simulated_example_params.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionSendSimulatedExampleParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] event_type + # Event type to send example message for. + # + # @return [Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType, nil] + optional :event_type, + enum: -> { Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType } + + # @!parse + # # @return [Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType] + # attr_writer :event_type + + # @!parse + # # @param event_type [Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(event_type: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Event type to send example message for. + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED = :"auth_rules.performance_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + CARD_CREATED = :"card.created" + CARD_RENEWED = :"card.renewed" + CARD_REISSUED = :"card.reissued" + CARD_CONVERTED = :"card.converted" + CARD_SHIPPED = :"card.shipped" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED = :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/events/subscription_update_params.rb b/lib/lithic/models/events/subscription_update_params.rb new file mode 100644 index 00000000..53a23bc2 --- /dev/null +++ b/lib/lithic/models/events/subscription_update_params.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + class SubscriptionUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute url + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @return [String] + required :url, String + + # @!attribute [r] description + # Event subscription description. + # + # @return [String, nil] + optional :description, String + + # @!parse + # # @return [String] + # attr_writer :description + + # @!attribute [r] disabled + # Whether the event subscription is active (false) or inactive (true). + # + # @return [Boolean, nil] + optional :disabled, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :disabled + + # @!attribute [r] event_types + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + # + # @return [Array, nil] + optional :event_types, + -> { Lithic::ArrayOf[enum: Lithic::Models::Events::SubscriptionUpdateParams::EventType] } + + # @!parse + # # @return [Array] + # attr_writer :event_types + + # @!parse + # # @param url [String] + # # @param description [String] + # # @param disabled [Boolean] + # # @param event_types [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(url:, description: nil, disabled: nil, event_types: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED = :"auth_rules.performance_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + CARD_CREATED = :"card.created" + CARD_RENEWED = :"card.renewed" + CARD_REISSUED = :"card.reissued" + CARD_CONVERTED = :"card.converted" + CARD_SHIPPED = :"card.shipped" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED = :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_address.rb b/lib/lithic/models/external_bank_account_address.rb new file mode 100644 index 00000000..1a9a7311 --- /dev/null +++ b/lib/lithic/models/external_bank_account_address.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountAddress < Lithic::BaseModel + # @!attribute address1 + # + # @return [String] + required :address1, String + + # @!attribute city + # + # @return [String] + required :city, String + + # @!attribute country + # + # @return [String] + required :country, String + + # @!attribute postal_code + # + # @return [String] + required :postal_code, String + + # @!attribute state + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_bank_account_create_params.rb b/lib/lithic/models/external_bank_account_create_params.rb new file mode 100644 index 00000000..91c81eae --- /dev/null +++ b/lib/lithic/models/external_bank_account_create_params.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute account_number + # Account Number + # + # @return [String] + required :account_number, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String] + required :financial_account_token, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType] + required :owner_type, enum: -> { Lithic::Models::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountCreateParams::Type } + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_enforcement + # + # @return [Boolean, nil] + optional :verification_enforcement, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :verification_enforcement + + # @!attribute processor_token + # + # @return [String] + required :processor_token, String + + # @!parse + # # @param account_number [String] + # # @param country [String] + # # @param currency [String] + # # @param financial_account_token [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::OwnerType] + # # @param routing_number [String] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Type] + # # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod] + # # @param processor_token [String] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_enforcement [Boolean] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_number:, + # country:, + # currency:, + # financial_account_token:, + # owner:, + # owner_type:, + # routing_number:, + # type:, + # verification_method:, + # processor_token:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # name: nil, + # user_defined_id: nil, + # verification_enforcement: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + EXTERNALLY_VERIFIED = :EXTERNALLY_VERIFIED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_create_response.rb b/lib/lithic/models/external_bank_account_create_response.rb new file mode 100644 index 00000000..83923066 --- /dev/null +++ b/lib/lithic/models/external_bank_account_create_response.rb @@ -0,0 +1,317 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountCreateResponse < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::VerificationState } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String + + # @!parse + # # @return [String] + # attr_writer :verification_failed_reason + + # @!parse + # # @param token [String] + # # @param country [String] + # # @param created [Time] + # # @param currency [String] + # # @param last_four [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType] + # # @param routing_number [String] + # # @param state [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::State] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::Type] + # # @param verification_attempts [Integer] + # # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod] + # # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param financial_account_token [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_failed_reason [String] + # # + # def initialize( + # token:, + # country:, + # created:, + # currency:, + # last_four:, + # owner:, + # owner_type:, + # routing_number:, + # state:, + # type:, + # verification_attempts:, + # verification_method:, + # verification_state:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # financial_account_token: nil, + # name: nil, + # user_defined_id: nil, + # verification_failed_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Owner Type + module OwnerType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account State + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_list_params.rb b/lib/lithic/models/external_bank_account_list_params.rb new file mode 100644 index 00000000..2c46af11 --- /dev/null +++ b/lib/lithic/models/external_bank_account_list_params.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] account_types + # + # @return [Array, nil] + optional :account_types, + -> { Lithic::ArrayOf[enum: Lithic::Models::ExternalBankAccountListParams::AccountType] } + + # @!parse + # # @return [Array] + # attr_writer :account_types + + # @!attribute [r] countries + # + # @return [Array, nil] + optional :countries, Lithic::ArrayOf[String] + + # @!parse + # # @return [Array] + # attr_writer :countries + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] owner_types + # + # @return [Array, nil] + optional :owner_types, -> { Lithic::ArrayOf[enum: Lithic::Models::OwnerType] } + + # @!parse + # # @return [Array] + # attr_writer :owner_types + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] states + # + # @return [Array, nil] + optional :states, -> { Lithic::ArrayOf[enum: Lithic::Models::ExternalBankAccountListParams::State] } + + # @!parse + # # @return [Array] + # attr_writer :states + + # @!attribute [r] verification_states + # + # @return [Array, nil] + optional :verification_states, + -> { Lithic::ArrayOf[enum: Lithic::Models::ExternalBankAccountListParams::VerificationState] } + + # @!parse + # # @return [Array] + # attr_writer :verification_states + + # @!parse + # # @param account_token [String] + # # @param account_types [Array] + # # @param countries [Array] + # # @param ending_before [String] + # # @param owner_types [Array] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param states [Array] + # # @param verification_states [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # account_types: nil, + # countries: nil, + # ending_before: nil, + # owner_types: nil, + # page_size: nil, + # starting_after: nil, + # states: nil, + # verification_states: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module AccountType + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_list_response.rb b/lib/lithic/models/external_bank_account_list_response.rb new file mode 100644 index 00000000..8007f1cc --- /dev/null +++ b/lib/lithic/models/external_bank_account_list_response.rb @@ -0,0 +1,317 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountListResponse < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountListResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountListResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountListResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountListResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountListResponse::VerificationState } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String + + # @!parse + # # @return [String] + # attr_writer :verification_failed_reason + + # @!parse + # # @param token [String] + # # @param country [String] + # # @param created [Time] + # # @param currency [String] + # # @param last_four [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountListResponse::OwnerType] + # # @param routing_number [String] + # # @param state [Symbol, Lithic::Models::ExternalBankAccountListResponse::State] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountListResponse::Type] + # # @param verification_attempts [Integer] + # # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod] + # # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationState] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param financial_account_token [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_failed_reason [String] + # # + # def initialize( + # token:, + # country:, + # created:, + # currency:, + # last_four:, + # owner:, + # owner_type:, + # routing_number:, + # state:, + # type:, + # verification_attempts:, + # verification_method:, + # verification_state:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # financial_account_token: nil, + # name: nil, + # user_defined_id: nil, + # verification_failed_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Owner Type + module OwnerType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account State + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_retrieve_params.rb b/lib/lithic/models/external_bank_account_retrieve_params.rb new file mode 100644 index 00000000..445cc68b --- /dev/null +++ b/lib/lithic/models/external_bank_account_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_bank_account_retrieve_response.rb b/lib/lithic/models/external_bank_account_retrieve_response.rb new file mode 100644 index 00000000..f8b559c1 --- /dev/null +++ b/lib/lithic/models/external_bank_account_retrieve_response.rb @@ -0,0 +1,317 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountRetrieveResponse < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String + + # @!parse + # # @return [String] + # attr_writer :verification_failed_reason + + # @!parse + # # @param token [String] + # # @param country [String] + # # @param created [Time] + # # @param currency [String] + # # @param last_four [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType] + # # @param routing_number [String] + # # @param state [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::State] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::Type] + # # @param verification_attempts [Integer] + # # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod] + # # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param financial_account_token [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_failed_reason [String] + # # + # def initialize( + # token:, + # country:, + # created:, + # currency:, + # last_four:, + # owner:, + # owner_type:, + # routing_number:, + # state:, + # type:, + # verification_attempts:, + # verification_method:, + # verification_state:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # financial_account_token: nil, + # name: nil, + # user_defined_id: nil, + # verification_failed_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Owner Type + module OwnerType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account State + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rb b/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rb new file mode 100644 index 00000000..2c13e40a --- /dev/null +++ b/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountRetryMicroDepositsParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!parse + # # @param financial_account_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(financial_account_token: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rb b/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rb new file mode 100644 index 00000000..65dd4a3c --- /dev/null +++ b/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountRetryMicroDepositsResponse < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType] + required :owner_type, + enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String + + # @!parse + # # @return [String] + # attr_writer :verification_failed_reason + + # @!parse + # # @param token [String] + # # @param country [String] + # # @param created [Time] + # # @param currency [String] + # # @param last_four [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType] + # # @param routing_number [String] + # # @param state [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type] + # # @param verification_attempts [Integer] + # # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod] + # # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param financial_account_token [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_failed_reason [String] + # # + # def initialize( + # token:, + # country:, + # created:, + # currency:, + # last_four:, + # owner:, + # owner_type:, + # routing_number:, + # state:, + # type:, + # verification_attempts:, + # verification_method:, + # verification_state:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # financial_account_token: nil, + # name: nil, + # user_defined_id: nil, + # verification_failed_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Owner Type + module OwnerType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account State + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_retry_prenote_params.rb b/lib/lithic/models/external_bank_account_retry_prenote_params.rb new file mode 100644 index 00000000..c7d06b01 --- /dev/null +++ b/lib/lithic/models/external_bank_account_retry_prenote_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountRetryPrenoteParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!parse + # # @param financial_account_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(financial_account_token: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_bank_account_retry_prenote_response.rb b/lib/lithic/models/external_bank_account_retry_prenote_response.rb new file mode 100644 index 00000000..49f89493 --- /dev/null +++ b/lib/lithic/models/external_bank_account_retry_prenote_response.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountRetryPrenoteResponse < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType] + required :owner_type, enum: -> { Lithic::Models::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::VerificationMethod] + required :verification_method, enum: -> { Lithic::Models::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String + + # @!parse + # # @return [String] + # attr_writer :verification_failed_reason + + # @!parse + # # @param token [String] + # # @param country [String] + # # @param created [Time] + # # @param currency [String] + # # @param last_four [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::OwnerType] + # # @param routing_number [String] + # # @param state [Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type] + # # @param verification_attempts [Integer] + # # @param verification_method [Symbol, Lithic::Models::VerificationMethod] + # # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param financial_account_token [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_failed_reason [String] + # # + # def initialize( + # token:, + # country:, + # created:, + # currency:, + # last_four:, + # owner:, + # owner_type:, + # routing_number:, + # state:, + # type:, + # verification_attempts:, + # verification_method:, + # verification_state:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # financial_account_token: nil, + # name: nil, + # user_defined_id: nil, + # verification_failed_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Account State + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_update_params.rb b/lib/lithic/models/external_bank_account_update_params.rb new file mode 100644 index 00000000..1303ba74 --- /dev/null +++ b/lib/lithic/models/external_bank_account_update_params.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String, nil] + optional :owner, String + + # @!parse + # # @return [String] + # attr_writer :owner + + # @!attribute [r] owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType, nil] + optional :owner_type, enum: -> { Lithic::Models::OwnerType } + + # @!parse + # # @return [Symbol, Lithic::Models::OwnerType] + # attr_writer :owner_type + + # @!attribute [r] type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type, nil] + optional :type, enum: -> { Lithic::Models::ExternalBankAccountUpdateParams::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type] + # attr_writer :type + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!parse + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param name [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::OwnerType] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type] + # # @param user_defined_id [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # name: nil, + # owner: nil, + # owner_type: nil, + # type: nil, + # user_defined_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_update_response.rb b/lib/lithic/models/external_bank_account_update_response.rb new file mode 100644 index 00000000..8e2b2b07 --- /dev/null +++ b/lib/lithic/models/external_bank_account_update_response.rb @@ -0,0 +1,317 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountUpdateResponse < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String + + # @!parse + # # @return [String] + # attr_writer :verification_failed_reason + + # @!parse + # # @param token [String] + # # @param country [String] + # # @param created [Time] + # # @param currency [String] + # # @param last_four [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType] + # # @param routing_number [String] + # # @param state [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::State] + # # @param type [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::Type] + # # @param verification_attempts [Integer] + # # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod] + # # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param financial_account_token [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_failed_reason [String] + # # + # def initialize( + # token:, + # country:, + # created:, + # currency:, + # last_four:, + # owner:, + # owner_type:, + # routing_number:, + # state:, + # type:, + # verification_attempts:, + # verification_method:, + # verification_state:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # financial_account_token: nil, + # name: nil, + # user_defined_id: nil, + # verification_failed_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Owner Type + module OwnerType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account State + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rb b/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rb new file mode 100644 index 00000000..3f820acd --- /dev/null +++ b/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ExternalBankAccounts + class MicroDepositCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute micro_deposits + # + # @return [Array] + required :micro_deposits, Lithic::ArrayOf[Integer] + + # @!parse + # # @param micro_deposits [Array] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(micro_deposits:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rb b/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rb new file mode 100644 index 00000000..ef530fd0 --- /dev/null +++ b/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rb @@ -0,0 +1,320 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ExternalBankAccounts + class MicroDepositCreateResponse < Lithic::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType] + required :owner_type, + enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState } + + # @!attribute [r] account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::Models::ExternalBankAccountAddress } + + # @!parse + # # @return [Lithic::Models::ExternalBankAccountAddress] + # attr_writer :address + + # @!attribute [r] company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!parse + # # @return [String] + # attr_writer :company_id + + # @!attribute [r] dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!parse + # # @return [Date] + # attr_writer :dob + + # @!attribute [r] doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!parse + # # @return [String] + # attr_writer :doing_business_as + + # @!attribute [r] financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!parse + # # @return [String] + # attr_writer :name + + # @!attribute [r] user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!attribute [r] verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String + + # @!parse + # # @return [String] + # attr_writer :verification_failed_reason + + # @!parse + # # @param token [String] + # # @param country [String] + # # @param created [Time] + # # @param currency [String] + # # @param last_four [String] + # # @param owner [String] + # # @param owner_type [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType] + # # @param routing_number [String] + # # @param state [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State] + # # @param type [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type] + # # @param verification_attempts [Integer] + # # @param verification_method [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod] + # # @param verification_state [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState] + # # @param account_token [String] + # # @param address [Lithic::Models::ExternalBankAccountAddress] + # # @param company_id [String] + # # @param dob [Date] + # # @param doing_business_as [String] + # # @param financial_account_token [String] + # # @param name [String] + # # @param user_defined_id [String] + # # @param verification_failed_reason [String] + # # + # def initialize( + # token:, + # country:, + # created:, + # currency:, + # last_four:, + # owner:, + # owner_type:, + # routing_number:, + # state:, + # type:, + # verification_attempts:, + # verification_method:, + # verification_state:, + # account_token: nil, + # address: nil, + # company_id: nil, + # dob: nil, + # doing_business_as: nil, + # financial_account_token: nil, + # name: nil, + # user_defined_id: nil, + # verification_failed_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Owner Type + module OwnerType + extend Lithic::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account State + module State + extend Lithic::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Account Type + module Type + extend Lithic::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/external_payment.rb b/lib/lithic/models/external_payment.rb new file mode 100644 index 00000000..02a0b56d --- /dev/null +++ b/lib/lithic/models/external_payment.rb @@ -0,0 +1,282 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPayment < Lithic::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ExternalPayment::Category] + required :category, enum: -> { Lithic::Models::ExternalPayment::Category } + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute events + # + # @return [Array] + required :events, -> { Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event] } + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute payment_type + # + # @return [Symbol, Lithic::Models::ExternalPayment::PaymentType] + required :payment_type, enum: -> { Lithic::Models::ExternalPayment::PaymentType } + + # @!attribute pending_amount + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ExternalPayment::Result] + required :result, enum: -> { Lithic::Models::ExternalPayment::Result } + + # @!attribute settled_amount + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # + # @return [Symbol, Lithic::Models::ExternalPayment::Status] + required :status, enum: -> { Lithic::Models::ExternalPayment::Status } + + # @!attribute updated + # + # @return [Time] + required :updated, Time + + # @!attribute [r] user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!parse + # # @param token [String] + # # @param category [Symbol, Lithic::Models::ExternalPayment::Category] + # # @param created [Time] + # # @param currency [String] + # # @param events [Array] + # # @param financial_account_token [String] + # # @param payment_type [Symbol, Lithic::Models::ExternalPayment::PaymentType] + # # @param pending_amount [Integer] + # # @param result [Symbol, Lithic::Models::ExternalPayment::Result] + # # @param settled_amount [Integer] + # # @param status [Symbol, Lithic::Models::ExternalPayment::Status] + # # @param updated [Time] + # # @param user_defined_id [String] + # # + # def initialize( + # token:, + # category:, + # created:, + # currency:, + # events:, + # financial_account_token:, + # payment_type:, + # pending_amount:, + # result:, + # settled_amount:, + # status:, + # updated:, + # user_defined_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Category + extend Lithic::Enum + + EXTERNAL_WIRE = :EXTERNAL_WIRE + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Event < Lithic::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::ArrayOf[enum: Lithic::Models::ExternalPayment::Event::DetailedResult] } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String] + required :memo, String + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ExternalPayment::Event::Result] + required :result, enum: -> { Lithic::Models::ExternalPayment::Event::Result } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::ExternalPayment::Event::Type] + required :type, enum: -> { Lithic::Models::ExternalPayment::Event::Type } + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param created [Time] + # # @param detailed_results [Array] + # # @param effective_date [Date] + # # @param memo [String] + # # @param result [Symbol, Lithic::Models::ExternalPayment::Event::Result] + # # @param type [Symbol, Lithic::Models::ExternalPayment::Event::Type] + # # + # def initialize(token:, amount:, created:, detailed_results:, effective_date:, memo:, result:, type:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module DetailedResult + extend Lithic::Enum + + APPROVED = :APPROVED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Type + extend Lithic::Enum + + EXTERNAL_WIRE_INITIATED = :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_CANCELED = :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_SETTLED = :EXTERNAL_WIRE_SETTLED + EXTERNAL_WIRE_REVERSED = :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_RELEASED = :EXTERNAL_WIRE_RELEASED + EXTERNAL_ACH_INITIATED = :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_CANCELED = :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_SETTLED = :EXTERNAL_ACH_SETTLED + EXTERNAL_ACH_REVERSED = :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_RELEASED = :EXTERNAL_ACH_RELEASED + EXTERNAL_TRANSFER_INITIATED = :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_CANCELED = :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_SETTLED = :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_TRANSFER_REVERSED = :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_RELEASED = :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_CHECK_INITIATED = :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_CANCELED = :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_SETTLED = :EXTERNAL_CHECK_SETTLED + EXTERNAL_CHECK_REVERSED = :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_RELEASED = :EXTERNAL_CHECK_RELEASED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + module PaymentType + extend Lithic::Enum + + DEPOSIT = :DEPOSIT + WITHDRAWAL = :WITHDRAWAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Status + extend Lithic::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_payment_cancel_params.rb b/lib/lithic/models/external_payment_cancel_params.rb new file mode 100644 index 00000000..f3831b8c --- /dev/null +++ b/lib/lithic/models/external_payment_cancel_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentCancelParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param effective_date [Date] + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(effective_date:, memo: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_payment_create_params.rb b/lib/lithic/models/external_payment_create_params.rb new file mode 100644 index 00000000..f9548136 --- /dev/null +++ b/lib/lithic/models/external_payment_create_params.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] + required :category, enum: -> { Lithic::Models::ExternalPaymentCreateParams::Category } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute payment_type + # + # @return [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] + required :payment_type, enum: -> { Lithic::Models::ExternalPaymentCreateParams::PaymentType } + + # @!attribute [r] token + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!attribute [r] progress_to + # + # @return [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo, nil] + optional :progress_to, enum: -> { Lithic::Models::ExternalPaymentCreateParams::ProgressTo } + + # @!parse + # # @return [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo] + # attr_writer :progress_to + + # @!attribute [r] user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!parse + # # @param amount [Integer] + # # @param category [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] + # # @param effective_date [Date] + # # @param financial_account_token [String] + # # @param payment_type [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] + # # @param token [String] + # # @param memo [String] + # # @param progress_to [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo] + # # @param user_defined_id [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # category:, + # effective_date:, + # financial_account_token:, + # payment_type:, + # token: nil, + # memo: nil, + # progress_to: nil, + # user_defined_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Category + extend Lithic::Enum + + EXTERNAL_WIRE = :EXTERNAL_WIRE + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module PaymentType + extend Lithic::Enum + + DEPOSIT = :DEPOSIT + WITHDRAWAL = :WITHDRAWAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module ProgressTo + extend Lithic::Enum + + SETTLED = :SETTLED + RELEASED = :RELEASED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_payment_list_params.rb b/lib/lithic/models/external_payment_list_params.rb new file mode 100644 index 00000000..2f28b177 --- /dev/null +++ b/lib/lithic/models/external_payment_list_params.rb @@ -0,0 +1,194 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] category + # External Payment category to be returned. + # + # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Category, nil] + optional :category, enum: -> { Lithic::Models::ExternalPaymentListParams::Category } + + # @!parse + # # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Category] + # attr_writer :category + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] result + # External Payment result to be returned. + # + # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Result, nil] + optional :result, enum: -> { Lithic::Models::ExternalPaymentListParams::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Result] + # attr_writer :result + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # Book transfer status to be returned. + # + # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::ExternalPaymentListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Status] + # attr_writer :status + + # @!parse + # # @param begin_ [Time] + # # @param business_account_token [String] + # # @param category [Symbol, Lithic::Models::ExternalPaymentListParams::Category] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param financial_account_token [String] + # # @param page_size [Integer] + # # @param result [Symbol, Lithic::Models::ExternalPaymentListParams::Result] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::ExternalPaymentListParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # business_account_token: nil, + # category: nil, + # end_: nil, + # ending_before: nil, + # financial_account_token: nil, + # page_size: nil, + # result: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # External Payment category to be returned. + module Category + extend Lithic::Enum + + EXTERNAL_WIRE = :EXTERNAL_WIRE + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # External Payment result to be returned. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Book transfer status to be returned. + module Status + extend Lithic::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/external_payment_release_params.rb b/lib/lithic/models/external_payment_release_params.rb new file mode 100644 index 00000000..432d138d --- /dev/null +++ b/lib/lithic/models/external_payment_release_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentReleaseParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param effective_date [Date] + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(effective_date:, memo: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_payment_retrieve_params.rb b/lib/lithic/models/external_payment_retrieve_params.rb new file mode 100644 index 00000000..2d2c8539 --- /dev/null +++ b/lib/lithic/models/external_payment_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_payment_reverse_params.rb b/lib/lithic/models/external_payment_reverse_params.rb new file mode 100644 index 00000000..21157d0c --- /dev/null +++ b/lib/lithic/models/external_payment_reverse_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentReverseParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param effective_date [Date] + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(effective_date:, memo: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/external_payment_settle_params.rb b/lib/lithic/models/external_payment_settle_params.rb new file mode 100644 index 00000000..62a40765 --- /dev/null +++ b/lib/lithic/models/external_payment_settle_params.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentSettleParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!attribute [r] progress_to + # + # @return [Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo, nil] + optional :progress_to, enum: -> { Lithic::Models::ExternalPaymentSettleParams::ProgressTo } + + # @!parse + # # @return [Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo] + # attr_writer :progress_to + + # @!parse + # # @param effective_date [Date] + # # @param memo [String] + # # @param progress_to [Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(effective_date:, memo: nil, progress_to: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module ProgressTo + extend Lithic::Enum + + SETTLED = :SETTLED + RELEASED = :RELEASED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/financial_account.rb b/lib/lithic/models/financial_account.rb new file mode 100644 index 00000000..8b0ea988 --- /dev/null +++ b/lib/lithic/models/financial_account.rb @@ -0,0 +1,256 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccount < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the account + # + # @return [String] + required :token, String + + # @!attribute account_token + # + # @return [String, nil] + required :account_token, String, nil?: true + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute credit_configuration + # + # @return [Lithic::Models::FinancialAccount::CreditConfiguration, nil] + required :credit_configuration, -> { Lithic::Models::FinancialAccount::CreditConfiguration }, nil?: true + + # @!attribute is_for_benefit_of + # Whether financial account is for the benefit of another entity + # + # @return [Boolean] + required :is_for_benefit_of, Lithic::BooleanModel + + # @!attribute nickname + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccount::Status] + required :status, enum: -> { Lithic::Models::FinancialAccount::Status } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::FinancialAccount::Type] + required :type, enum: -> { Lithic::Models::FinancialAccount::Type } + + # @!attribute updated + # + # @return [Time] + required :updated, Time + + # @!attribute account_number + # + # @return [String, nil] + optional :account_number, String, nil?: true + + # @!attribute routing_number + # + # @return [String, nil] + optional :routing_number, String, nil?: true + + # @!attribute status_change_reason + # Reason for the financial account status change + # + # @return [Symbol, Lithic::Models::FinancialAccount::StatusChangeReason, nil] + optional :status_change_reason, + enum: -> { Lithic::Models::FinancialAccount::StatusChangeReason }, + nil?: true + + # @!parse + # # @param token [String] + # # @param account_token [String, nil] + # # @param created [Time] + # # @param credit_configuration [Lithic::Models::FinancialAccount::CreditConfiguration, nil] + # # @param is_for_benefit_of [Boolean] + # # @param nickname [String, nil] + # # @param status [Symbol, Lithic::Models::FinancialAccount::Status] + # # @param type [Symbol, Lithic::Models::FinancialAccount::Type] + # # @param updated [Time] + # # @param account_number [String, nil] + # # @param routing_number [String, nil] + # # @param status_change_reason [Symbol, Lithic::Models::FinancialAccount::StatusChangeReason, nil] + # # + # def initialize( + # token:, + # account_token:, + # created:, + # credit_configuration:, + # is_for_benefit_of:, + # nickname:, + # status:, + # type:, + # updated:, + # account_number: nil, + # routing_number: nil, + # status_change_reason: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class CreditConfiguration < Lithic::BaseModel + # @!attribute charged_off_reason + # Reason for the financial account being marked as Charged Off + # + # @return [Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason, nil] + required :charged_off_reason, + enum: -> { Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason }, + nil?: true + + # @!attribute credit_limit + # + # @return [Integer, nil] + required :credit_limit, Integer, nil?: true + + # @!attribute credit_product_token + # Globally unique identifier for the credit product + # + # @return [String, nil] + required :credit_product_token, String, nil?: true + + # @!attribute external_bank_account_token + # + # @return [String, nil] + required :external_bank_account_token, String, nil?: true + + # @!attribute financial_account_state + # State of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState, nil] + required :financial_account_state, + enum: -> { Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState }, + nil?: true + + # @!attribute is_spend_blocked + # + # @return [Boolean] + required :is_spend_blocked, Lithic::BooleanModel + + # @!attribute tier + # Tier assigned to the financial account + # + # @return [String, nil] + required :tier, String, nil?: true + + # @!parse + # # @param charged_off_reason [Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason, nil] + # # @param credit_limit [Integer, nil] + # # @param credit_product_token [String, nil] + # # @param external_bank_account_token [String, nil] + # # @param financial_account_state [Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState, nil] + # # @param is_spend_blocked [Boolean] + # # @param tier [String, nil] + # # + # def initialize( + # charged_off_reason:, + # credit_limit:, + # credit_product_token:, + # external_bank_account_token:, + # financial_account_state:, + # is_spend_blocked:, + # tier:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Reason for the financial account being marked as Charged Off + module ChargedOffReason + extend Lithic::Enum + + DELINQUENT = :DELINQUENT + FRAUD = :FRAUD + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # State of the financial account + module FinancialAccountState + extend Lithic::Enum + + PENDING = :PENDING + CURRENT = :CURRENT + DELINQUENT = :DELINQUENT + CHARGED_OFF = :CHARGED_OFF + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # Status of the financial account + module Status + extend Lithic::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Type + extend Lithic::Enum + + ISSUING = :ISSUING + RESERVE = :RESERVE + OPERATING = :OPERATING + CHARGED_OFF_FEES = :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST = :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL = :CHARGED_OFF_PRINCIPAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + DELINQUENT = :DELINQUENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/financial_account_create_params.rb b/lib/lithic/models/financial_account_create_params.rb new file mode 100644 index 00000000..7ffcc4dd --- /dev/null +++ b/lib/lithic/models/financial_account_create_params.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute nickname + # + # @return [String] + required :nickname, String + + # @!attribute type + # + # @return [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] + required :type, enum: -> { Lithic::Models::FinancialAccountCreateParams::Type } + + # @!attribute [r] account_token + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] is_for_benefit_of + # + # @return [Boolean, nil] + optional :is_for_benefit_of, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :is_for_benefit_of + + # @!attribute [r] idempotency_key + # + # @return [String, nil] + optional :idempotency_key, String, api_name: :"Idempotency-Key" + + # @!parse + # # @return [String] + # attr_writer :idempotency_key + + # @!parse + # # @param nickname [String] + # # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] + # # @param account_token [String] + # # @param is_for_benefit_of [Boolean] + # # @param idempotency_key [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # nickname:, + # type:, + # account_token: nil, + # is_for_benefit_of: nil, + # idempotency_key: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Type + extend Lithic::Enum + + OPERATING = :OPERATING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/financial_account_list_params.rb b/lib/lithic/models/financial_account_list_params.rb new file mode 100644 index 00000000..e1badd92 --- /dev/null +++ b/lib/lithic/models/financial_account_list_params.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # List financial accounts for a given account_token or business_account_token + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] business_account_token + # List financial accounts for a given business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] type + # List financial accounts of a given type + # + # @return [Symbol, Lithic::Models::FinancialAccountListParams::Type, nil] + optional :type, enum: -> { Lithic::Models::FinancialAccountListParams::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::FinancialAccountListParams::Type] + # attr_writer :type + + # @!parse + # # @param account_token [String] + # # @param business_account_token [String] + # # @param type [Symbol, Lithic::Models::FinancialAccountListParams::Type] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(account_token: nil, business_account_token: nil, type: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # List financial accounts of a given type + module Type + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/financial_account_retrieve_params.rb b/lib/lithic/models/financial_account_retrieve_params.rb new file mode 100644 index 00000000..0acecad6 --- /dev/null +++ b/lib/lithic/models/financial_account_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/financial_account_update_params.rb b/lib/lithic/models/financial_account_update_params.rb new file mode 100644 index 00000000..9fe60afe --- /dev/null +++ b/lib/lithic/models/financial_account_update_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] nickname + # + # @return [String, nil] + optional :nickname, String + + # @!parse + # # @return [String] + # attr_writer :nickname + + # @!parse + # # @param nickname [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(nickname: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/financial_account_update_status_params.rb b/lib/lithic/models/financial_account_update_status_params.rb new file mode 100644 index 00000000..4749cc2a --- /dev/null +++ b/lib/lithic/models/financial_account_update_status_params.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountUpdateStatusParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status] + required :status, enum: -> { Lithic::Models::FinancialAccountUpdateStatusParams::Status } + + # @!attribute status_change_reason + # Reason for the financial account status change + # + # @return [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason, nil] + required :status_change_reason, + enum: -> { Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason }, + nil?: true + + # @!parse + # # @param status [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status] + # # @param status_change_reason [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason, nil] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(status:, status_change_reason:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Status of the financial account + module Status + extend Lithic::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/balance_list_params.rb b/lib/lithic/models/financial_accounts/balance_list_params.rb new file mode 100644 index 00000000..f2e31247 --- /dev/null +++ b/lib/lithic/models/financial_accounts/balance_list_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class BalanceListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] balance_date + # UTC date of the balance to retrieve. Defaults to latest available balance + # + # @return [Time, nil] + optional :balance_date, Time + + # @!parse + # # @return [Time] + # attr_writer :balance_date + + # @!attribute [r] last_transaction_event_token + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + # + # @return [String, nil] + optional :last_transaction_event_token, String + + # @!parse + # # @return [String] + # attr_writer :last_transaction_event_token + + # @!parse + # # @param balance_date [Time] + # # @param last_transaction_event_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(balance_date: nil, last_transaction_event_token: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/balance_list_response.rb b/lib/lithic/models/financial_accounts/balance_list_response.rb new file mode 100644 index 00000000..c3bdadaa --- /dev/null +++ b/lib/lithic/models/financial_accounts/balance_list_response.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class BalanceListResponse < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the financial account that holds this balance. + # + # @return [String] + required :token, String + + # @!attribute available_amount + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :available_amount, Integer + + # @!attribute created + # Date and time for when the balance was first created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @return [String] + required :currency, String + + # @!attribute last_transaction_event_token + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + # + # @return [String] + required :last_transaction_event_token, String + + # @!attribute last_transaction_token + # Globally unique identifier for the last financial transaction that impacted this + # balance. + # + # @return [String] + required :last_transaction_token, String + + # @!attribute pending_amount + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute total_amount + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + # + # @return [Integer] + required :total_amount, Integer + + # @!attribute type + # Type of financial account. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::BalanceListResponse::Type] + required :type, enum: -> { Lithic::Models::FinancialAccounts::BalanceListResponse::Type } + + # @!attribute updated + # Date and time for when the balance was last updated. + # + # @return [Time] + required :updated, Time + + # @!parse + # # Balance of a Financial Account + # # + # # @param token [String] + # # @param available_amount [Integer] + # # @param created [Time] + # # @param currency [String] + # # @param last_transaction_event_token [String] + # # @param last_transaction_token [String] + # # @param pending_amount [Integer] + # # @param total_amount [Integer] + # # @param type [Symbol, Lithic::Models::FinancialAccounts::BalanceListResponse::Type] + # # @param updated [Time] + # # + # def initialize( + # token:, + # available_amount:, + # created:, + # currency:, + # last_transaction_event_token:, + # last_transaction_token:, + # pending_amount:, + # total_amount:, + # type:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of financial account. + module Type + extend Lithic::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rb b/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rb new file mode 100644 index 00000000..22057008 --- /dev/null +++ b/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class CreditConfigurationRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/credit_configuration_update_params.rb b/lib/lithic/models/financial_accounts/credit_configuration_update_params.rb new file mode 100644 index 00000000..cd10ea91 --- /dev/null +++ b/lib/lithic/models/financial_accounts/credit_configuration_update_params.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class CreditConfigurationUpdateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] credit_limit + # + # @return [Integer, nil] + optional :credit_limit, Integer + + # @!parse + # # @return [Integer] + # attr_writer :credit_limit + + # @!attribute [r] credit_product_token + # Globally unique identifier for the credit product + # + # @return [String, nil] + optional :credit_product_token, String + + # @!parse + # # @return [String] + # attr_writer :credit_product_token + + # @!attribute [r] external_bank_account_token + # + # @return [String, nil] + optional :external_bank_account_token, String + + # @!parse + # # @return [String] + # attr_writer :external_bank_account_token + + # @!attribute [r] tier + # Tier to assign to a financial account + # + # @return [String, nil] + optional :tier, String + + # @!parse + # # @return [String] + # attr_writer :tier + + # @!parse + # # @param credit_limit [Integer] + # # @param credit_product_token [String] + # # @param external_bank_account_token [String] + # # @param tier [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # credit_limit: nil, + # credit_product_token: nil, + # external_bank_account_token: nil, + # tier: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/financial_account_credit_config.rb b/lib/lithic/models/financial_accounts/financial_account_credit_config.rb new file mode 100644 index 00000000..8a0c6a64 --- /dev/null +++ b/lib/lithic/models/financial_accounts/financial_account_credit_config.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountCreditConfig < Lithic::BaseModel + # @!attribute account_token + # Globally unique identifier for the account + # + # @return [String] + required :account_token, String + + # @!attribute charged_off_reason + # Reason for the financial account being marked as Charged Off + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason, nil] + required :charged_off_reason, + enum: -> { Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason }, + nil?: true + + # @!attribute credit_limit + # + # @return [Integer, nil] + required :credit_limit, Integer, nil?: true + + # @!attribute credit_product_token + # Globally unique identifier for the credit product + # + # @return [String, nil] + required :credit_product_token, String, nil?: true + + # @!attribute external_bank_account_token + # + # @return [String, nil] + required :external_bank_account_token, String, nil?: true + + # @!attribute financial_account_state + # State of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState] + required :financial_account_state, + enum: -> { Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState } + + # @!attribute is_spend_blocked + # + # @return [Boolean] + required :is_spend_blocked, Lithic::BooleanModel + + # @!attribute tier + # Tier assigned to the financial account + # + # @return [String, nil] + required :tier, String, nil?: true + + # @!parse + # # @param account_token [String] + # # @param charged_off_reason [Symbol, Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason, nil] + # # @param credit_limit [Integer, nil] + # # @param credit_product_token [String, nil] + # # @param external_bank_account_token [String, nil] + # # @param financial_account_state [Symbol, Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState] + # # @param is_spend_blocked [Boolean] + # # @param tier [String, nil] + # # + # def initialize( + # account_token:, + # charged_off_reason:, + # credit_limit:, + # credit_product_token:, + # external_bank_account_token:, + # financial_account_state:, + # is_spend_blocked:, + # tier:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Reason for the financial account being marked as Charged Off + module ChargedOffReason + extend Lithic::Enum + + DELINQUENT = :DELINQUENT + FRAUD = :FRAUD + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # State of the financial account + module FinancialAccountState + extend Lithic::Enum + + PENDING = :PENDING + CURRENT = :CURRENT + DELINQUENT = :DELINQUENT + CHARGED_OFF = :CHARGED_OFF + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + + FinancialAccountCreditConfig = FinancialAccounts::FinancialAccountCreditConfig + end +end diff --git a/lib/lithic/models/financial_accounts/financial_transaction_list_params.rb b/lib/lithic/models/financial_accounts/financial_transaction_list_params.rb new file mode 100644 index 00000000..ad469ea2 --- /dev/null +++ b/lib/lithic/models/financial_accounts/financial_transaction_list_params.rb @@ -0,0 +1,162 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class FinancialTransactionListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] category + # Financial Transaction category to be returned. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category, nil] + optional :category, + enum: -> { Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category } + + # @!parse + # # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category] + # attr_writer :category + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] result + # Financial Transaction result to be returned. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result, nil] + optional :result, enum: -> { Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result] + # attr_writer :result + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # Financial Transaction status to be returned. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status] + # attr_writer :status + + # @!parse + # # @param begin_ [Time] + # # @param category [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param result [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # category: nil, + # end_: nil, + # ending_before: nil, + # result: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Financial Transaction category to be returned. + module Category + extend Lithic::Enum + + ACH = :ACH + CARD = :CARD + INTERNAL = :INTERNAL + TRANSFER = :TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + VOIDED = :VOIDED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rb b/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rb new file mode 100644 index 00000000..8b7c7462 --- /dev/null +++ b/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class FinancialTransactionRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!parse + # # @param financial_account_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(financial_account_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape.rb b/lib/lithic/models/financial_accounts/loan_tape.rb new file mode 100644 index 00000000..605fff56 --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape.rb @@ -0,0 +1,900 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class LoanTape < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for a loan tape + # + # @return [String] + required :token, String + + # @!attribute account_standing + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding] + required :account_standing, -> { Lithic::Models::FinancialAccounts::LoanTape::AccountStanding } + + # @!attribute available_credit + # Amount of credit available to spend in cents + # + # @return [Integer] + required :available_credit, Integer + + # @!attribute balances + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::Balances] + required :balances, -> { Lithic::Models::FinancialAccounts::LoanTape::Balances } + + # @!attribute created + # Timestamp of when the loan tape was created + # + # @return [Time] + required :created, Time + + # @!attribute credit_limit + # For prepay accounts, this is the minimum prepay balance that must be maintained. + # For charge card accounts, this is the maximum credit balance extended by a + # lender + # + # @return [Integer] + required :credit_limit, Integer + + # @!attribute credit_product_token + # Globally unique identifier for a credit product + # + # @return [String] + required :credit_product_token, String + + # @!attribute date + # Date of transactions that this loan tape covers + # + # @return [Date] + required :date, Date + + # @!attribute day_totals + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::DayTotals] + required :day_totals, -> { Lithic::Models::FinancialAccounts::LoanTape::DayTotals } + + # @!attribute ending_balance + # Balance at the end of the day + # + # @return [Integer] + required :ending_balance, Integer + + # @!attribute excess_credits + # Excess credits in the form of provisional credits, payments, or purchase + # refunds. If positive, the account is in net credit state with no outstanding + # balances. An overpayment could land an account in this state + # + # @return [Integer] + required :excess_credits, Integer + + # @!attribute financial_account_token + # Globally unique identifier for a financial account + # + # @return [String] + required :financial_account_token, String + + # @!attribute interest_details + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails, nil] + required :interest_details, + -> { Lithic::Models::FinancialAccounts::LoanTape::InterestDetails }, + nil?: true + + # @!attribute minimum_payment_balance + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance] + required :minimum_payment_balance, + -> { Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance } + + # @!attribute payment_allocation + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation] + required :payment_allocation, -> { Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation } + + # @!attribute period_totals + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals] + required :period_totals, -> { Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals } + + # @!attribute previous_statement_balance + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance] + required :previous_statement_balance, + -> { Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance } + + # @!attribute starting_balance + # Balance at the start of the day + # + # @return [Integer] + required :starting_balance, Integer + + # @!attribute updated + # Timestamp of when the loan tape was updated + # + # @return [Time] + required :updated, Time + + # @!attribute version + # Version number of the loan tape. This starts at 1 + # + # @return [Integer] + required :version, Integer + + # @!attribute ytd_totals + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::YtdTotals] + required :ytd_totals, -> { Lithic::Models::FinancialAccounts::LoanTape::YtdTotals } + + # @!attribute [r] tier + # Interest tier to which this account belongs to + # + # @return [String, nil] + optional :tier, String + + # @!parse + # # @return [String] + # attr_writer :tier + + # @!parse + # # @param token [String] + # # @param account_standing [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding] + # # @param available_credit [Integer] + # # @param balances [Lithic::Models::FinancialAccounts::LoanTape::Balances] + # # @param created [Time] + # # @param credit_limit [Integer] + # # @param credit_product_token [String] + # # @param date [Date] + # # @param day_totals [Lithic::Models::FinancialAccounts::LoanTape::DayTotals] + # # @param ending_balance [Integer] + # # @param excess_credits [Integer] + # # @param financial_account_token [String] + # # @param interest_details [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails, nil] + # # @param minimum_payment_balance [Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance] + # # @param payment_allocation [Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation] + # # @param period_totals [Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals] + # # @param previous_statement_balance [Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance] + # # @param starting_balance [Integer] + # # @param updated [Time] + # # @param version [Integer] + # # @param ytd_totals [Lithic::Models::FinancialAccounts::LoanTape::YtdTotals] + # # @param tier [String] + # # + # def initialize( + # token:, + # account_standing:, + # available_credit:, + # balances:, + # created:, + # credit_limit:, + # credit_product_token:, + # date:, + # day_totals:, + # ending_balance:, + # excess_credits:, + # financial_account_token:, + # interest_details:, + # minimum_payment_balance:, + # payment_allocation:, + # period_totals:, + # previous_statement_balance:, + # starting_balance:, + # updated:, + # version:, + # ytd_totals:, + # tier: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class AccountStanding < Lithic::BaseModel + # @!attribute consecutive_full_payments_made + # Number of consecutive full payments made + # + # @return [Integer] + required :consecutive_full_payments_made, Integer + + # @!attribute consecutive_minimum_payments_made + # Number of consecutive minimum payments made + # + # @return [Integer] + required :consecutive_minimum_payments_made, Integer + + # @!attribute consecutive_minimum_payments_missed + # Number of consecutive minimum payments missed + # + # @return [Integer] + required :consecutive_minimum_payments_missed, Integer + + # @!attribute days_past_due + # Number of days past due + # + # @return [Integer] + required :days_past_due, Integer + + # @!attribute financial_account_state + # Information about the financial account state + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState] + required :financial_account_state, + -> { Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState } + + # @!attribute has_grace + # Whether the account currently has grace or not + # + # @return [Boolean] + required :has_grace, Lithic::BooleanModel + + # @!attribute period_number + # Current overall period number + # + # @return [Integer] + required :period_number, Integer + + # @!attribute period_state + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState] + required :period_state, + enum: -> { Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState } + + # @!parse + # # @param consecutive_full_payments_made [Integer] + # # @param consecutive_minimum_payments_made [Integer] + # # @param consecutive_minimum_payments_missed [Integer] + # # @param days_past_due [Integer] + # # @param financial_account_state [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState] + # # @param has_grace [Boolean] + # # @param period_number [Integer] + # # @param period_state [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState] + # # + # def initialize( + # consecutive_full_payments_made:, + # consecutive_minimum_payments_made:, + # consecutive_minimum_payments_missed:, + # days_past_due:, + # financial_account_state:, + # has_grace:, + # period_number:, + # period_state:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class FinancialAccountState < Lithic::BaseModel + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status] + required :status, + enum: -> { Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status } + + # @!attribute status_change_reason + # Reason for the financial account status change + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason, nil] + optional :status_change_reason, + enum: -> { Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason }, + nil?: true + + # @!parse + # # Information about the financial account state + # # + # # @param status [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status] + # # @param status_change_reason [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason, nil] + # # + # def initialize(status:, status_change_reason: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Status of the financial account + module Status + extend Lithic::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + DELINQUENT = :DELINQUENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + module PeriodState + extend Lithic::Enum + + STANDARD = :STANDARD + PROMO = :PROMO + PENALTY = :PENALTY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + class Balances < Lithic::BaseModel + # @!attribute due + # Amount due for the prior billing cycle. Any amounts not fully paid off on this + # due date will be considered past due the next day + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::Balances::Due] + required :due, -> { Lithic::Models::FinancialAccounts::LoanTape::Balances::Due } + + # @!attribute next_statement_due + # Amount due for the current billing cycle. Any amounts not paid off by early + # payments or credits will be considered due at the end of the current billing + # period + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue] + required :next_statement_due, + -> { Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue } + + # @!attribute past_due + # Amount not paid off on previous due dates + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue] + required :past_due, -> { Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue } + + # @!attribute past_statements_due + # Amount due for the past billing cycles. + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue] + required :past_statements_due, + -> { Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue } + + # @!parse + # # @param due [Lithic::Models::FinancialAccounts::LoanTape::Balances::Due] + # # @param next_statement_due [Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue] + # # @param past_due [Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue] + # # @param past_statements_due [Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue] + # # + # def initialize(due:, next_statement_due:, past_due:, past_statements_due:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Due < Lithic::BaseModel + # @!attribute fees + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # + # @return [Integer] + required :interest, Integer + + # @!attribute principal + # + # @return [Integer] + required :principal, Integer + + # @!parse + # # Amount due for the prior billing cycle. Any amounts not fully paid off on this + # # due date will be considered past due the next day + # # + # # @param fees [Integer] + # # @param interest [Integer] + # # @param principal [Integer] + # # + # def initialize(fees:, interest:, principal:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class NextStatementDue < Lithic::BaseModel + # @!attribute fees + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # + # @return [Integer] + required :interest, Integer + + # @!attribute principal + # + # @return [Integer] + required :principal, Integer + + # @!parse + # # Amount due for the current billing cycle. Any amounts not paid off by early + # # payments or credits will be considered due at the end of the current billing + # # period + # # + # # @param fees [Integer] + # # @param interest [Integer] + # # @param principal [Integer] + # # + # def initialize(fees:, interest:, principal:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class PastDue < Lithic::BaseModel + # @!attribute fees + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # + # @return [Integer] + required :interest, Integer + + # @!attribute principal + # + # @return [Integer] + required :principal, Integer + + # @!parse + # # Amount not paid off on previous due dates + # # + # # @param fees [Integer] + # # @param interest [Integer] + # # @param principal [Integer] + # # + # def initialize(fees:, interest:, principal:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class PastStatementsDue < Lithic::BaseModel + # @!attribute fees + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # + # @return [Integer] + required :interest, Integer + + # @!attribute principal + # + # @return [Integer] + required :principal, Integer + + # @!parse + # # Amount due for the past billing cycles. + # # + # # @param fees [Integer] + # # @param interest [Integer] + # # @param principal [Integer] + # # + # def initialize(fees:, interest:, principal:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + class DayTotals < Lithic::BaseModel + # @!attribute balance_transfers + # Opening balance transferred from previous account in cents + # + # @return [Integer] + required :balance_transfers, Integer + + # @!attribute cash_advances + # ATM and cashback transactions in cents + # + # @return [Integer] + required :cash_advances, Integer + + # @!attribute credits + # Volume of credit management operation transactions less any balance transfers in + # cents + # + # @return [Integer] + required :credits, Integer + + # @!attribute fees + # Volume of debit management operation transactions less any interest in cents + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # Interest accrued in cents + # + # @return [Integer] + required :interest, Integer + + # @!attribute payments + # Any funds transfers which affective the balance in cents + # + # @return [Integer] + required :payments, Integer + + # @!attribute purchases + # Net card transaction volume less any cash advances in cents + # + # @return [Integer] + required :purchases, Integer + + # @!parse + # # @param balance_transfers [Integer] + # # @param cash_advances [Integer] + # # @param credits [Integer] + # # @param fees [Integer] + # # @param interest [Integer] + # # @param payments [Integer] + # # @param purchases [Integer] + # # + # def initialize(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class InterestDetails < Lithic::BaseModel + # @!attribute actual_interest_charged + # + # @return [Integer, nil] + required :actual_interest_charged, Integer, nil?: true + + # @!attribute daily_balance_amounts + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts] + required :daily_balance_amounts, + -> { Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts } + + # @!attribute effective_apr + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr] + required :effective_apr, -> { Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr } + + # @!attribute interest_calculation_method + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod] + required :interest_calculation_method, + enum: -> { Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod } + + # @!attribute interest_for_period + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod] + required :interest_for_period, + -> { Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod } + + # @!attribute prime_rate + # + # @return [String, nil] + required :prime_rate, String, nil?: true + + # @!attribute minimum_interest_charged + # + # @return [Integer, nil] + optional :minimum_interest_charged, Integer, nil?: true + + # @!parse + # # @param actual_interest_charged [Integer, nil] + # # @param daily_balance_amounts [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts] + # # @param effective_apr [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr] + # # @param interest_calculation_method [Symbol, Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod] + # # @param interest_for_period [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod] + # # @param prime_rate [String, nil] + # # @param minimum_interest_charged [Integer, nil] + # # + # def initialize( + # actual_interest_charged:, + # daily_balance_amounts:, + # effective_apr:, + # interest_calculation_method:, + # interest_for_period:, + # prime_rate:, + # minimum_interest_charged: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class DailyBalanceAmounts < Lithic::BaseModel + # @!attribute balance_transfers + # + # @return [String] + required :balance_transfers, String + + # @!attribute cash_advances + # + # @return [String] + required :cash_advances, String + + # @!attribute purchases + # + # @return [String] + required :purchases, String + + # @!parse + # # @param balance_transfers [String] + # # @param cash_advances [String] + # # @param purchases [String] + # # + # def initialize(balance_transfers:, cash_advances:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class EffectiveApr < Lithic::BaseModel + # @!attribute balance_transfers + # + # @return [String] + required :balance_transfers, String + + # @!attribute cash_advances + # + # @return [String] + required :cash_advances, String + + # @!attribute purchases + # + # @return [String] + required :purchases, String + + # @!parse + # # @param balance_transfers [String] + # # @param cash_advances [String] + # # @param purchases [String] + # # + # def initialize(balance_transfers:, cash_advances:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + module InterestCalculationMethod + extend Lithic::Enum + + DAILY = :DAILY + AVERAGE_DAILY = :AVERAGE_DAILY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class InterestForPeriod < Lithic::BaseModel + # @!attribute balance_transfers + # + # @return [String] + required :balance_transfers, String + + # @!attribute cash_advances + # + # @return [String] + required :cash_advances, String + + # @!attribute purchases + # + # @return [String] + required :purchases, String + + # @!parse + # # @param balance_transfers [String] + # # @param cash_advances [String] + # # @param purchases [String] + # # + # def initialize(balance_transfers:, cash_advances:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + class MinimumPaymentBalance < Lithic::BaseModel + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute remaining + # + # @return [Integer] + required :remaining, Integer + + # @!parse + # # @param amount [Integer] + # # @param remaining [Integer] + # # + # def initialize(amount:, remaining:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class PaymentAllocation < Lithic::BaseModel + # @!attribute fees + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # + # @return [Integer] + required :interest, Integer + + # @!attribute principal + # + # @return [Integer] + required :principal, Integer + + # @!parse + # # @param fees [Integer] + # # @param interest [Integer] + # # @param principal [Integer] + # # + # def initialize(fees:, interest:, principal:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class PeriodTotals < Lithic::BaseModel + # @!attribute balance_transfers + # Opening balance transferred from previous account in cents + # + # @return [Integer] + required :balance_transfers, Integer + + # @!attribute cash_advances + # ATM and cashback transactions in cents + # + # @return [Integer] + required :cash_advances, Integer + + # @!attribute credits + # Volume of credit management operation transactions less any balance transfers in + # cents + # + # @return [Integer] + required :credits, Integer + + # @!attribute fees + # Volume of debit management operation transactions less any interest in cents + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # Interest accrued in cents + # + # @return [Integer] + required :interest, Integer + + # @!attribute payments + # Any funds transfers which affective the balance in cents + # + # @return [Integer] + required :payments, Integer + + # @!attribute purchases + # Net card transaction volume less any cash advances in cents + # + # @return [Integer] + required :purchases, Integer + + # @!parse + # # @param balance_transfers [Integer] + # # @param cash_advances [Integer] + # # @param credits [Integer] + # # @param fees [Integer] + # # @param interest [Integer] + # # @param payments [Integer] + # # @param purchases [Integer] + # # + # def initialize(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class PreviousStatementBalance < Lithic::BaseModel + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute remaining + # + # @return [Integer] + required :remaining, Integer + + # @!parse + # # @param amount [Integer] + # # @param remaining [Integer] + # # + # def initialize(amount:, remaining:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class YtdTotals < Lithic::BaseModel + # @!attribute balance_transfers + # Opening balance transferred from previous account in cents + # + # @return [Integer] + required :balance_transfers, Integer + + # @!attribute cash_advances + # ATM and cashback transactions in cents + # + # @return [Integer] + required :cash_advances, Integer + + # @!attribute credits + # Volume of credit management operation transactions less any balance transfers in + # cents + # + # @return [Integer] + required :credits, Integer + + # @!attribute fees + # Volume of debit management operation transactions less any interest in cents + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # Interest accrued in cents + # + # @return [Integer] + required :interest, Integer + + # @!attribute payments + # Any funds transfers which affective the balance in cents + # + # @return [Integer] + required :payments, Integer + + # @!attribute purchases + # Net card transaction volume less any cash advances in cents + # + # @return [Integer] + required :purchases, Integer + + # @!parse + # # @param balance_transfers [Integer] + # # @param cash_advances [Integer] + # # @param credits [Integer] + # # @param fees [Integer] + # # @param interest [Integer] + # # @param payments [Integer] + # # @param purchases [Integer] + # # + # def initialize(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape_list_params.rb b/lib/lithic/models/financial_accounts/loan_tape_list_params.rb new file mode 100644 index 00000000..14611ee8 --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape_list_params.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class LoanTapeListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + # + # @return [Date, nil] + optional :begin_, Date, api_name: :begin + + # @!parse + # # @return [Date] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + # + # @return [Date, nil] + optional :end_, Date, api_name: :end + + # @!parse + # # @return [Date] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param begin_ [Date] + # # @param end_ [Date] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rb b/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rb new file mode 100644 index 00000000..cc67808b --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class LoanTapeRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!parse + # # @param financial_account_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(financial_account_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statement.rb b/lib/lithic/models/financial_accounts/statement.rb new file mode 100644 index 00000000..61cec202 --- /dev/null +++ b/lib/lithic/models/financial_accounts/statement.rb @@ -0,0 +1,654 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class Statement < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for a statement + # + # @return [String] + required :token, String + + # @!attribute account_standing + # + # @return [Lithic::Models::FinancialAccounts::Statement::AccountStanding] + required :account_standing, -> { Lithic::Models::FinancialAccounts::Statement::AccountStanding } + + # @!attribute amount_due + # + # @return [Lithic::Models::FinancialAccounts::Statement::AmountDue] + required :amount_due, -> { Lithic::Models::FinancialAccounts::Statement::AmountDue } + + # @!attribute available_credit + # Amount of credit available to spend in cents + # + # @return [Integer] + required :available_credit, Integer + + # @!attribute created + # Timestamp of when the statement was created + # + # @return [Time] + required :created, Time + + # @!attribute credit_limit + # This is the maximum credit balance extended by the lender in cents + # + # @return [Integer] + required :credit_limit, Integer + + # @!attribute credit_product_token + # Globally unique identifier for a credit product + # + # @return [String] + required :credit_product_token, String + + # @!attribute days_in_billing_cycle + # Number of days in the billing cycle + # + # @return [Integer] + required :days_in_billing_cycle, Integer + + # @!attribute ending_balance + # Balance at the end of the billing period. For charge cards, this should be the + # same at the statement amount due in cents + # + # @return [Integer] + required :ending_balance, Integer + + # @!attribute financial_account_token + # Globally unique identifier for a financial account + # + # @return [String] + required :financial_account_token, String + + # @!attribute payment_due_date + # Date when the payment is due + # + # @return [Date, nil] + required :payment_due_date, Date, nil?: true + + # @!attribute period_totals + # + # @return [Lithic::Models::FinancialAccounts::Statement::PeriodTotals] + required :period_totals, -> { Lithic::Models::FinancialAccounts::Statement::PeriodTotals } + + # @!attribute starting_balance + # Balance at the start of the billing period + # + # @return [Integer] + required :starting_balance, Integer + + # @!attribute statement_end_date + # Date when the billing period ended + # + # @return [Date] + required :statement_end_date, Date + + # @!attribute statement_start_date + # Date when the billing period began + # + # @return [Date] + required :statement_start_date, Date + + # @!attribute statement_type + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::StatementType] + required :statement_type, enum: -> { Lithic::Models::FinancialAccounts::Statement::StatementType } + + # @!attribute updated + # Timestamp of when the statement was updated + # + # @return [Time] + required :updated, Time + + # @!attribute ytd_totals + # + # @return [Lithic::Models::FinancialAccounts::Statement::YtdTotals] + required :ytd_totals, -> { Lithic::Models::FinancialAccounts::Statement::YtdTotals } + + # @!attribute interest_details + # + # @return [Lithic::Models::FinancialAccounts::Statement::InterestDetails, nil] + optional :interest_details, + -> { Lithic::Models::FinancialAccounts::Statement::InterestDetails }, + nil?: true + + # @!attribute [r] next_payment_due_date + # Date when the next payment is due + # + # @return [Date, nil] + optional :next_payment_due_date, Date + + # @!parse + # # @return [Date] + # attr_writer :next_payment_due_date + + # @!attribute [r] next_statement_end_date + # Date when the next billing period will end + # + # @return [Date, nil] + optional :next_statement_end_date, Date + + # @!parse + # # @return [Date] + # attr_writer :next_statement_end_date + + # @!parse + # # @param token [String] + # # @param account_standing [Lithic::Models::FinancialAccounts::Statement::AccountStanding] + # # @param amount_due [Lithic::Models::FinancialAccounts::Statement::AmountDue] + # # @param available_credit [Integer] + # # @param created [Time] + # # @param credit_limit [Integer] + # # @param credit_product_token [String] + # # @param days_in_billing_cycle [Integer] + # # @param ending_balance [Integer] + # # @param financial_account_token [String] + # # @param payment_due_date [Date, nil] + # # @param period_totals [Lithic::Models::FinancialAccounts::Statement::PeriodTotals] + # # @param starting_balance [Integer] + # # @param statement_end_date [Date] + # # @param statement_start_date [Date] + # # @param statement_type [Symbol, Lithic::Models::FinancialAccounts::Statement::StatementType] + # # @param updated [Time] + # # @param ytd_totals [Lithic::Models::FinancialAccounts::Statement::YtdTotals] + # # @param interest_details [Lithic::Models::FinancialAccounts::Statement::InterestDetails, nil] + # # @param next_payment_due_date [Date] + # # @param next_statement_end_date [Date] + # # + # def initialize( + # token:, + # account_standing:, + # amount_due:, + # available_credit:, + # created:, + # credit_limit:, + # credit_product_token:, + # days_in_billing_cycle:, + # ending_balance:, + # financial_account_token:, + # payment_due_date:, + # period_totals:, + # starting_balance:, + # statement_end_date:, + # statement_start_date:, + # statement_type:, + # updated:, + # ytd_totals:, + # interest_details: nil, + # next_payment_due_date: nil, + # next_statement_end_date: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class AccountStanding < Lithic::BaseModel + # @!attribute consecutive_full_payments_made + # Number of consecutive full payments made + # + # @return [Integer] + required :consecutive_full_payments_made, Integer + + # @!attribute consecutive_minimum_payments_made + # Number of consecutive minimum payments made + # + # @return [Integer] + required :consecutive_minimum_payments_made, Integer + + # @!attribute consecutive_minimum_payments_missed + # Number of consecutive minimum payments missed + # + # @return [Integer] + required :consecutive_minimum_payments_missed, Integer + + # @!attribute days_past_due + # Number of days past due + # + # @return [Integer] + required :days_past_due, Integer + + # @!attribute financial_account_state + # Information about the financial account state + # + # @return [Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState] + required :financial_account_state, + -> { Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState } + + # @!attribute has_grace + # Whether the account currently has grace or not + # + # @return [Boolean] + required :has_grace, Lithic::BooleanModel + + # @!attribute period_number + # Current overall period number + # + # @return [Integer] + required :period_number, Integer + + # @!attribute period_state + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState] + required :period_state, + enum: -> { Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState } + + # @!parse + # # @param consecutive_full_payments_made [Integer] + # # @param consecutive_minimum_payments_made [Integer] + # # @param consecutive_minimum_payments_missed [Integer] + # # @param days_past_due [Integer] + # # @param financial_account_state [Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState] + # # @param has_grace [Boolean] + # # @param period_number [Integer] + # # @param period_state [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState] + # # + # def initialize( + # consecutive_full_payments_made:, + # consecutive_minimum_payments_made:, + # consecutive_minimum_payments_missed:, + # days_past_due:, + # financial_account_state:, + # has_grace:, + # period_number:, + # period_state:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class FinancialAccountState < Lithic::BaseModel + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status] + required :status, + enum: -> { Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status } + + # @!attribute status_change_reason + # Reason for the financial account status change + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason, nil] + optional :status_change_reason, + enum: -> { Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason }, + nil?: true + + # @!parse + # # Information about the financial account state + # # + # # @param status [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status] + # # @param status_change_reason [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason, nil] + # # + # def initialize(status:, status_change_reason: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Status of the financial account + module Status + extend Lithic::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + DELINQUENT = :DELINQUENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + module PeriodState + extend Lithic::Enum + + STANDARD = :STANDARD + PROMO = :PROMO + PENALTY = :PENALTY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + class AmountDue < Lithic::BaseModel + # @!attribute amount + # Payment due at the end of the billing period in cents. Negative amount indicates + # something is owed. If the amount owed is positive there was a net credit. If + # auto-collections are enabled this is the amount that will be requested on the + # payment due date + # + # @return [Integer] + required :amount, Integer + + # @!attribute past_due + # Amount past due for statement in cents + # + # @return [Integer] + required :past_due, Integer + + # @!parse + # # @param amount [Integer] + # # @param past_due [Integer] + # # + # def initialize(amount:, past_due:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class PeriodTotals < Lithic::BaseModel + # @!attribute balance_transfers + # Opening balance transferred from previous account in cents + # + # @return [Integer] + required :balance_transfers, Integer + + # @!attribute cash_advances + # ATM and cashback transactions in cents + # + # @return [Integer] + required :cash_advances, Integer + + # @!attribute credits + # Volume of credit management operation transactions less any balance transfers in + # cents + # + # @return [Integer] + required :credits, Integer + + # @!attribute fees + # Volume of debit management operation transactions less any interest in cents + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # Interest accrued in cents + # + # @return [Integer] + required :interest, Integer + + # @!attribute payments + # Any funds transfers which affective the balance in cents + # + # @return [Integer] + required :payments, Integer + + # @!attribute purchases + # Net card transaction volume less any cash advances in cents + # + # @return [Integer] + required :purchases, Integer + + # @!parse + # # @param balance_transfers [Integer] + # # @param cash_advances [Integer] + # # @param credits [Integer] + # # @param fees [Integer] + # # @param interest [Integer] + # # @param payments [Integer] + # # @param purchases [Integer] + # # + # def initialize(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + module StatementType + extend Lithic::Enum + + INITIAL = :INITIAL + PERIOD_END = :PERIOD_END + FINAL = :FINAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class YtdTotals < Lithic::BaseModel + # @!attribute balance_transfers + # Opening balance transferred from previous account in cents + # + # @return [Integer] + required :balance_transfers, Integer + + # @!attribute cash_advances + # ATM and cashback transactions in cents + # + # @return [Integer] + required :cash_advances, Integer + + # @!attribute credits + # Volume of credit management operation transactions less any balance transfers in + # cents + # + # @return [Integer] + required :credits, Integer + + # @!attribute fees + # Volume of debit management operation transactions less any interest in cents + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # Interest accrued in cents + # + # @return [Integer] + required :interest, Integer + + # @!attribute payments + # Any funds transfers which affective the balance in cents + # + # @return [Integer] + required :payments, Integer + + # @!attribute purchases + # Net card transaction volume less any cash advances in cents + # + # @return [Integer] + required :purchases, Integer + + # @!parse + # # @param balance_transfers [Integer] + # # @param cash_advances [Integer] + # # @param credits [Integer] + # # @param fees [Integer] + # # @param interest [Integer] + # # @param payments [Integer] + # # @param purchases [Integer] + # # + # def initialize(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class InterestDetails < Lithic::BaseModel + # @!attribute actual_interest_charged + # + # @return [Integer, nil] + required :actual_interest_charged, Integer, nil?: true + + # @!attribute daily_balance_amounts + # + # @return [Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts] + required :daily_balance_amounts, + -> { Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts } + + # @!attribute effective_apr + # + # @return [Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr] + required :effective_apr, + -> { Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr } + + # @!attribute interest_calculation_method + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod] + required :interest_calculation_method, + enum: -> { Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod } + + # @!attribute interest_for_period + # + # @return [Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod] + required :interest_for_period, + -> { Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod } + + # @!attribute prime_rate + # + # @return [String, nil] + required :prime_rate, String, nil?: true + + # @!attribute minimum_interest_charged + # + # @return [Integer, nil] + optional :minimum_interest_charged, Integer, nil?: true + + # @!parse + # # @param actual_interest_charged [Integer, nil] + # # @param daily_balance_amounts [Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts] + # # @param effective_apr [Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr] + # # @param interest_calculation_method [Symbol, Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod] + # # @param interest_for_period [Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod] + # # @param prime_rate [String, nil] + # # @param minimum_interest_charged [Integer, nil] + # # + # def initialize( + # actual_interest_charged:, + # daily_balance_amounts:, + # effective_apr:, + # interest_calculation_method:, + # interest_for_period:, + # prime_rate:, + # minimum_interest_charged: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class DailyBalanceAmounts < Lithic::BaseModel + # @!attribute balance_transfers + # + # @return [String] + required :balance_transfers, String + + # @!attribute cash_advances + # + # @return [String] + required :cash_advances, String + + # @!attribute purchases + # + # @return [String] + required :purchases, String + + # @!parse + # # @param balance_transfers [String] + # # @param cash_advances [String] + # # @param purchases [String] + # # + # def initialize(balance_transfers:, cash_advances:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class EffectiveApr < Lithic::BaseModel + # @!attribute balance_transfers + # + # @return [String] + required :balance_transfers, String + + # @!attribute cash_advances + # + # @return [String] + required :cash_advances, String + + # @!attribute purchases + # + # @return [String] + required :purchases, String + + # @!parse + # # @param balance_transfers [String] + # # @param cash_advances [String] + # # @param purchases [String] + # # + # def initialize(balance_transfers:, cash_advances:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + module InterestCalculationMethod + extend Lithic::Enum + + DAILY = :DAILY + AVERAGE_DAILY = :AVERAGE_DAILY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class InterestForPeriod < Lithic::BaseModel + # @!attribute balance_transfers + # + # @return [String] + required :balance_transfers, String + + # @!attribute cash_advances + # + # @return [String] + required :cash_advances, String + + # @!attribute purchases + # + # @return [String] + required :purchases, String + + # @!parse + # # @param balance_transfers [String] + # # @param cash_advances [String] + # # @param purchases [String] + # # + # def initialize(balance_transfers:, cash_advances:, purchases:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statement_list_params.rb b/lib/lithic/models/financial_accounts/statement_list_params.rb new file mode 100644 index 00000000..e8532ef5 --- /dev/null +++ b/lib/lithic/models/financial_accounts/statement_list_params.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class StatementListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + # + # @return [Date, nil] + optional :begin_, Date, api_name: :begin + + # @!parse + # # @return [Date] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + # + # @return [Date, nil] + optional :end_, Date, api_name: :end + + # @!parse + # # @return [Date] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] include_initial_statements + # Whether to include the initial statement. It is not included by default. + # + # @return [Boolean, nil] + optional :include_initial_statements, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :include_initial_statements + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param begin_ [Date] + # # @param end_ [Date] + # # @param ending_before [String] + # # @param include_initial_statements [Boolean] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # end_: nil, + # ending_before: nil, + # include_initial_statements: nil, + # page_size: nil, + # starting_after: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statement_retrieve_params.rb b/lib/lithic/models/financial_accounts/statement_retrieve_params.rb new file mode 100644 index 00000000..b7cbb26e --- /dev/null +++ b/lib/lithic/models/financial_accounts/statement_retrieve_params.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class StatementRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!parse + # # @param financial_account_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(financial_account_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statements.rb b/lib/lithic/models/financial_accounts/statements.rb new file mode 100644 index 00000000..d1527923 --- /dev/null +++ b/lib/lithic/models/financial_accounts/statements.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountsStatements < Lithic::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Lithic::ArrayOf[Lithic::Models::FinancialAccounts::Statement] } + + # @!attribute has_more + # + # @return [Boolean] + required :has_more, Lithic::BooleanModel + + # @!parse + # # @param data [Array] + # # @param has_more [Boolean] + # # + # def initialize(data:, has_more:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statements/line_item_list_params.rb b/lib/lithic/models/financial_accounts/statements/line_item_list_params.rb new file mode 100644 index 00000000..2b98e491 --- /dev/null +++ b/lib/lithic/models/financial_accounts/statements/line_item_list_params.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + module Statements + class LineItemListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param financial_account_token [String] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(financial_account_token:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb new file mode 100644 index 00000000..3343fb3c --- /dev/null +++ b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb @@ -0,0 +1,245 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + module Statements + class StatementLineItems < Lithic::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { Lithic::ArrayOf[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data] } + + # @!attribute has_more + # + # @return [Boolean] + required :has_more, Lithic::BooleanModel + + # @!parse + # # @param data [Array] + # # @param has_more [Boolean] + # # + # def initialize(data:, has_more:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Data < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for a Statement Line Item + # + # @return [String] + required :token, String + + # @!attribute amount + # Transaction amount in cents + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category] + required :category, + enum: -> { Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category } + + # @!attribute created + # Timestamp of when the line item was generated + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + # + # @return [String] + required :currency, String + + # @!attribute effective_date + # Date that the transaction effected the account balance + # + # @return [Date] + required :effective_date, Date + + # @!attribute event_type + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType] + required :event_type, + enum: -> { Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType } + + # @!attribute financial_account_token + # Globally unique identifier for a financial account + # + # @return [String] + required :financial_account_token, String + + # @!attribute financial_transaction_event_token + # Globally unique identifier for a financial transaction event + # + # @return [String] + required :financial_transaction_event_token, String + + # @!attribute financial_transaction_token + # Globally unique identifier for a financial transaction + # + # @return [String] + required :financial_transaction_token, String + + # @!attribute [r] card_token + # Globally unique identifier for a card + # + # @return [String, nil] + optional :card_token, String + + # @!parse + # # @return [String] + # attr_writer :card_token + + # @!attribute [r] descriptor + # + # @return [String, nil] + optional :descriptor, String + + # @!parse + # # @return [String] + # attr_writer :descriptor + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param category [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category] + # # @param created [Time] + # # @param currency [String] + # # @param effective_date [Date] + # # @param event_type [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType] + # # @param financial_account_token [String] + # # @param financial_transaction_event_token [String] + # # @param financial_transaction_token [String] + # # @param card_token [String] + # # @param descriptor [String] + # # + # def initialize( + # token:, + # amount:, + # category:, + # created:, + # currency:, + # effective_date:, + # event_type:, + # financial_account_token:, + # financial_transaction_event_token:, + # financial_transaction_token:, + # card_token: nil, + # descriptor: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Category + extend Lithic::Enum + + ACH = :ACH + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + CARD = :CARD + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + EXTERNAL_WIRE = :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module EventType + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED = :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED = :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + AUTHORIZATION = :AUTHORIZATION + AUTHORIZATION_ADVICE = :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY = :BALANCE_INQUIRY + BILLING_ERROR = :BILLING_ERROR + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + CARD_TO_CARD = :CARD_TO_CARD + CASH_BACK = :CASH_BACK + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CLEARING = :CLEARING + CORRECTION_CREDIT = :CORRECTION_CREDIT + CORRECTION_DEBIT = :CORRECTION_DEBIT + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE = :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON = :DISPUTE_WON + EXTERNAL_ACH_CANCELED = :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED = :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED = :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED = :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED = :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED = :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED = :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED = :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED = :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED = :EXTERNAL_CHECK_SETTLED + EXTERNAL_TRANSFER_CANCELED = :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED = :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED = :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED = :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED = :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED = :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED = :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED = :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED = :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED = :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST = :INTEREST + INTEREST_REVERSAL = :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT = :INTERNAL_ADJUSTMENT + LATE_PAYMENT = :LATE_PAYMENT + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + RETURN = :RETURN + RETURN_REVERSAL = :RETURN_REVERSAL + TRANSFER = :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS = :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + + StatementLineItems = Statements::StatementLineItems + end + end +end diff --git a/lib/lithic/models/financial_transaction.rb b/lib/lithic/models/financial_transaction.rb new file mode 100644 index 00000000..d4d2c0fb --- /dev/null +++ b/lib/lithic/models/financial_transaction.rb @@ -0,0 +1,342 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialTransaction < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute category + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Category] + required :category, enum: -> { Lithic::Models::FinancialTransaction::Category } + + # @!attribute created + # Date and time when the financial transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + # + # @return [String] + required :currency, String + + # @!attribute descriptor + # A string that provides a description of the financial transaction; may be useful + # to display to users. + # + # @return [String] + required :descriptor, String + + # @!attribute events + # A list of all financial events that have modified this financial transaction. + # + # @return [Array] + required :events, -> { Lithic::ArrayOf[Lithic::Models::FinancialTransaction::Event] } + + # @!attribute pending_amount + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Result] + required :result, enum: -> { Lithic::Models::FinancialTransaction::Result } + + # @!attribute settled_amount + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents), including any acquirer fees. This may change over time. + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Status] + required :status, enum: -> { Lithic::Models::FinancialTransaction::Status } + + # @!attribute updated + # Date and time when the financial transaction was last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!parse + # # @param token [String] + # # @param category [Symbol, Lithic::Models::FinancialTransaction::Category] + # # @param created [Time] + # # @param currency [String] + # # @param descriptor [String] + # # @param events [Array] + # # @param pending_amount [Integer] + # # @param result [Symbol, Lithic::Models::FinancialTransaction::Result] + # # @param settled_amount [Integer] + # # @param status [Symbol, Lithic::Models::FinancialTransaction::Status] + # # @param updated [Time] + # # + # def initialize( + # token:, + # category:, + # created:, + # currency:, + # descriptor:, + # events:, + # pending_amount:, + # result:, + # settled_amount:, + # status:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + module Category + extend Lithic::Enum + + ACH = :ACH + CARD = :CARD + INTERNAL = :INTERNAL + TRANSFER = :TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Event < Lithic::BaseModel + # @!attribute [r] token + # Globally unique identifier. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] amount + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!attribute [r] created + # Date and time when the financial event occurred. UTC time zone. + # + # @return [Time, nil] + optional :created, Time + + # @!parse + # # @return [Time] + # attr_writer :created + + # @!attribute [r] result + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Event::Result, nil] + optional :result, enum: -> { Lithic::Models::FinancialTransaction::Event::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::FinancialTransaction::Event::Result] + # attr_writer :result + + # @!attribute [r] type + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Event::Type, nil] + optional :type, enum: -> { Lithic::Models::FinancialTransaction::Event::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::FinancialTransaction::Event::Type] + # attr_writer :type + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param created [Time] + # # @param result [Symbol, Lithic::Models::FinancialTransaction::Event::Result] + # # @param type [Symbol, Lithic::Models::FinancialTransaction::Event::Type] + # # + # def initialize(token: nil, amount: nil, created: nil, result: nil, type: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Type + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED = :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED = :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + AUTHORIZATION = :AUTHORIZATION + AUTHORIZATION_ADVICE = :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY = :BALANCE_INQUIRY + BILLING_ERROR = :BILLING_ERROR + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + CARD_TO_CARD = :CARD_TO_CARD + CASH_BACK = :CASH_BACK + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CLEARING = :CLEARING + CORRECTION_CREDIT = :CORRECTION_CREDIT + CORRECTION_DEBIT = :CORRECTION_DEBIT + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE = :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON = :DISPUTE_WON + EXTERNAL_ACH_CANCELED = :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED = :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED = :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED = :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED = :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED = :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED = :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED = :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED = :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED = :EXTERNAL_CHECK_SETTLED + EXTERNAL_TRANSFER_CANCELED = :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED = :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED = :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED = :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED = :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED = :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED = :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED = :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED = :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED = :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST = :INTEREST + INTEREST_REVERSAL = :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT = :INTERNAL_ADJUSTMENT + LATE_PAYMENT = :LATE_PAYMENT + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + RETURN = :RETURN + RETURN_REVERSAL = :RETURN_REVERSAL + TRANSFER = :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS = :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + VOIDED = :VOIDED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/instance_financial_account_type.rb b/lib/lithic/models/instance_financial_account_type.rb new file mode 100644 index 00000000..89974104 --- /dev/null +++ b/lib/lithic/models/instance_financial_account_type.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Type of instance financial account + module InstanceFinancialAccountType + extend Lithic::Enum + + ISSUING = :ISSUING + RESERVE = :RESERVE + OPERATING = :OPERATING + CHARGED_OFF_FEES = :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST = :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL = :CHARGED_OFF_PRINCIPAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end +end diff --git a/lib/lithic/models/kyb.rb b/lib/lithic/models/kyb.rb new file mode 100644 index 00000000..84b9f994 --- /dev/null +++ b/lib/lithic/models/kyb.rb @@ -0,0 +1,443 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYB < Lithic::BaseModel + # @!attribute beneficial_owner_entities + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background. If no business owner is an entity, pass in an + # empty list. However, either this parameter or `beneficial_owner_individuals` + # must be populated. on entities that should be included. + # + # @return [Array] + required :beneficial_owner_entities, -> { Lithic::ArrayOf[Lithic::Models::KYB::BeneficialOwnerEntity] } + + # @!attribute beneficial_owner_individuals + # List of all direct and indirect individuals with >25% ownership in the company. + # If no entity or individual owns >25% of the company, and the largest shareholder + # is an individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. If no + # individual is an entity, pass in an empty list. However, either this parameter + # or `beneficial_owner_entities` must be populated. + # + # @return [Array] + required :beneficial_owner_individuals, + -> { Lithic::ArrayOf[Lithic::Models::KYB::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::KYB::BusinessEntity] + required :business_entity, -> { Lithic::Models::KYB::BusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::KYB::ControlPerson] + required :control_person, -> { Lithic::Models::KYB::ControlPerson } + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). + # + # @return [String] + required :nature_of_business, String + + # @!attribute tos_timestamp + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + # + # @return [String] + required :tos_timestamp, String + + # @!attribute workflow + # Specifies the type of KYB workflow to run. + # + # @return [Symbol, Lithic::Models::KYB::Workflow] + required :workflow, enum: -> { Lithic::Models::KYB::Workflow } + + # @!attribute [r] external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] kyb_passed_timestamp + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + # + # @return [String, nil] + optional :kyb_passed_timestamp, String + + # @!parse + # # @return [String] + # attr_writer :kyb_passed_timestamp + + # @!attribute [r] website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!parse + # # @return [String] + # attr_writer :website_url + + # @!parse + # # @param beneficial_owner_entities [Array] + # # @param beneficial_owner_individuals [Array] + # # @param business_entity [Lithic::Models::KYB::BusinessEntity] + # # @param control_person [Lithic::Models::KYB::ControlPerson] + # # @param nature_of_business [String] + # # @param tos_timestamp [String] + # # @param workflow [Symbol, Lithic::Models::KYB::Workflow] + # # @param external_id [String] + # # @param kyb_passed_timestamp [String] + # # @param website_url [String] + # # + # def initialize( + # beneficial_owner_entities:, + # beneficial_owner_individuals:, + # business_entity:, + # control_person:, + # nature_of_business:, + # tos_timestamp:, + # workflow:, + # external_id: nil, + # kyb_passed_timestamp: nil, + # website_url: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class BeneficialOwnerEntity < Lithic::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::ArrayOf[String] + + # @!attribute [r] dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!parse + # # @return [String] + # attr_writer :dba_business_name + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!parse + # # @param address [Lithic::Models::Address] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param phone_numbers [Array] + # # @param dba_business_name [String] + # # @param parent_company [String] + # # + # def initialize( + # address:, + # government_id:, + # legal_business_name:, + # phone_numbers:, + # dba_business_name: nil, + # parent_company: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # Individuals associated with a KYB application. Phone number is optional. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class BusinessEntity < Lithic::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::ArrayOf[String] + + # @!attribute [r] dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!parse + # # @return [String] + # attr_writer :dba_business_name + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!parse + # # Information for business for which the account is being opened and KYB is being + # # run. + # # + # # @param address [Lithic::Models::Address] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param phone_numbers [Array] + # # @param dba_business_name [String] + # # @param parent_company [String] + # # + # def initialize( + # address:, + # government_id:, + # legal_business_name:, + # phone_numbers:, + # dba_business_name: nil, + # parent_company: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class ControlPerson < Lithic::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute [r] phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # An individual with significant responsibility for managing the legal entity + # # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # # Officer, Managing Member, General Partner, President, Vice President, or + # # Treasurer). This can be an executive, or someone who will have program-wide + # # access to the cards that Lithic will provide. In some cases, this individual + # # could also be a beneficial owner listed above. See + # # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # # (Section II) for more background. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Specifies the type of KYB workflow to run. + module Workflow + extend Lithic::Enum + + KYB_BASIC = :KYB_BASIC + KYB_BYO = :KYB_BYO + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/kyb_business_entity.rb b/lib/lithic/models/kyb_business_entity.rb new file mode 100644 index 00000000..82ad541b --- /dev/null +++ b/lib/lithic/models/kyb_business_entity.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYBBusinessEntity < Lithic::BaseModel + # @!attribute address + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::KYBBusinessEntity::Address] + required :address, -> { Lithic::Models::KYBBusinessEntity::Address } + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::ArrayOf[String] + + # @!attribute [r] dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!parse + # # @return [String] + # attr_writer :dba_business_name + + # @!attribute [r] parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!parse + # # @return [String] + # attr_writer :parent_company + + # @!parse + # # @param address [Lithic::Models::KYBBusinessEntity::Address] + # # @param government_id [String] + # # @param legal_business_name [String] + # # @param phone_numbers [Array] + # # @param dba_business_name [String] + # # @param parent_company [String] + # # + # def initialize( + # address:, + # government_id:, + # legal_business_name:, + # phone_numbers:, + # dba_business_name: nil, + # parent_company: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Address < Lithic::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!parse + # # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # # acceptable; APO/FPO are acceptable. + # # + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # + # def initialize(address1:, city:, country:, postal_code:, state:, address2: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/kyc.rb b/lib/lithic/models/kyc.rb new file mode 100644 index 00000000..36e5de4e --- /dev/null +++ b/lib/lithic/models/kyc.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYC < Lithic::BaseModel + # @!attribute individual + # Information on individual for whom the account is being opened and KYC is being + # run. + # + # @return [Lithic::Models::KYC::Individual] + required :individual, -> { Lithic::Models::KYC::Individual } + + # @!attribute tos_timestamp + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + # + # @return [String] + required :tos_timestamp, String + + # @!attribute workflow + # Specifies the type of KYC workflow to run. + # + # @return [Symbol, Lithic::Models::KYC::Workflow] + required :workflow, enum: -> { Lithic::Models::KYC::Workflow } + + # @!attribute [r] external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!attribute [r] kyc_passed_timestamp + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + # + # @return [String, nil] + optional :kyc_passed_timestamp, String + + # @!parse + # # @return [String] + # attr_writer :kyc_passed_timestamp + + # @!parse + # # @param individual [Lithic::Models::KYC::Individual] + # # @param tos_timestamp [String] + # # @param workflow [Symbol, Lithic::Models::KYC::Workflow] + # # @param external_id [String] + # # @param kyc_passed_timestamp [String] + # # + # def initialize(individual:, tos_timestamp:, workflow:, external_id: nil, kyc_passed_timestamp: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Individual < Lithic::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!parse + # # Information on individual for whom the account is being opened and KYC is being + # # run. + # # + # # @param address [Lithic::Models::Address] + # # @param dob [String] + # # @param email [String] + # # @param first_name [String] + # # @param government_id [String] + # # @param last_name [String] + # # @param phone_number [String] + # # + # def initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Specifies the type of KYC workflow to run. + module Workflow + extend Lithic::Enum + + KYC_BASIC = :KYC_BASIC + KYC_BYO = :KYC_BYO + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/kyc_exempt.rb b/lib/lithic/models/kyc_exempt.rb new file mode 100644 index 00000000..3ffc9e4f --- /dev/null +++ b/lib/lithic/models/kyc_exempt.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYCExempt < Lithic::BaseModel + # @!attribute address + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Models::Address } + + # @!attribute email + # The KYC Exempt user's email + # + # @return [String] + required :email, String + + # @!attribute first_name + # The KYC Exempt user's first name + # + # @return [String] + required :first_name, String + + # @!attribute kyc_exemption_type + # Specifies the type of KYC Exempt user + # + # @return [Symbol, Lithic::Models::KYCExempt::KYCExemptionType] + required :kyc_exemption_type, enum: -> { Lithic::Models::KYCExempt::KYCExemptionType } + + # @!attribute last_name + # The KYC Exempt user's last name + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # The KYC Exempt user's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!attribute workflow + # Specifies the workflow type. This must be 'KYC_EXEMPT' + # + # @return [Symbol, Lithic::Models::KYCExempt::Workflow] + required :workflow, enum: -> { Lithic::Models::KYCExempt::Workflow } + + # @!attribute [r] business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!parse + # # @return [String] + # attr_writer :external_id + + # @!parse + # # @param address [Lithic::Models::Address] + # # @param email [String] + # # @param first_name [String] + # # @param kyc_exemption_type [Symbol, Lithic::Models::KYCExempt::KYCExemptionType] + # # @param last_name [String] + # # @param phone_number [String] + # # @param workflow [Symbol, Lithic::Models::KYCExempt::Workflow] + # # @param business_account_token [String] + # # @param external_id [String] + # # + # def initialize( + # address:, + # email:, + # first_name:, + # kyc_exemption_type:, + # last_name:, + # phone_number:, + # workflow:, + # business_account_token: nil, + # external_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Specifies the type of KYC Exempt user + module KYCExemptionType + extend Lithic::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + module Workflow + extend Lithic::Enum + + KYC_EXEMPT = :KYC_EXEMPT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/management_operation_create_params.rb b/lib/lithic/models/management_operation_create_params.rb new file mode 100644 index 00000000..fbde1da2 --- /dev/null +++ b/lib/lithic/models/management_operation_create_params.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ManagementOperationCreateParams::Category] + required :category, enum: -> { Lithic::Models::ManagementOperationCreateParams::Category } + + # @!attribute direction + # + # @return [Symbol, Lithic::Models::ManagementOperationCreateParams::Direction] + required :direction, enum: -> { Lithic::Models::ManagementOperationCreateParams::Direction } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute event_type + # + # @return [Symbol, Lithic::Models::ManagementOperationCreateParams::EventType] + required :event_type, enum: -> { Lithic::Models::ManagementOperationCreateParams::EventType } + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute [r] token + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!attribute [r] subtype + # + # @return [String, nil] + optional :subtype, String + + # @!parse + # # @return [String] + # attr_writer :subtype + + # @!attribute [r] user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!parse + # # @param amount [Integer] + # # @param category [Symbol, Lithic::Models::ManagementOperationCreateParams::Category] + # # @param direction [Symbol, Lithic::Models::ManagementOperationCreateParams::Direction] + # # @param effective_date [Date] + # # @param event_type [Symbol, Lithic::Models::ManagementOperationCreateParams::EventType] + # # @param financial_account_token [String] + # # @param token [String] + # # @param memo [String] + # # @param subtype [String] + # # @param user_defined_id [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # category:, + # direction:, + # effective_date:, + # event_type:, + # financial_account_token:, + # token: nil, + # memo: nil, + # subtype: nil, + # user_defined_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Category + extend Lithic::Enum + + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Direction + extend Lithic::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module EventType + extend Lithic::Enum + + CASH_BACK = :CASH_BACK + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + INTEREST = :INTEREST + LATE_PAYMENT = :LATE_PAYMENT + BILLING_ERROR = :BILLING_ERROR + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + INTEREST_REVERSAL = :INTEREST_REVERSAL + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/management_operation_list_params.rb b/lib/lithic/models/management_operation_list_params.rb new file mode 100644 index 00000000..17a3a33c --- /dev/null +++ b/lib/lithic/models/management_operation_list_params.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] category + # Management operation category to be returned. + # + # @return [Symbol, Lithic::Models::ManagementOperationListParams::Category, nil] + optional :category, enum: -> { Lithic::Models::ManagementOperationListParams::Category } + + # @!parse + # # @return [Symbol, Lithic::Models::ManagementOperationListParams::Category] + # attr_writer :category + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] financial_account_token + # Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # Management operation status to be returned. + # + # @return [Symbol, Lithic::Models::ManagementOperationListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::ManagementOperationListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::ManagementOperationListParams::Status] + # attr_writer :status + + # @!parse + # # @param begin_ [Time] + # # @param business_account_token [String] + # # @param category [Symbol, Lithic::Models::ManagementOperationListParams::Category] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param financial_account_token [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::ManagementOperationListParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # business_account_token: nil, + # category: nil, + # end_: nil, + # ending_before: nil, + # financial_account_token: nil, + # page_size: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Management operation category to be returned. + module Category + extend Lithic::Enum + + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Management operation status to be returned. + module Status + extend Lithic::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/management_operation_retrieve_params.rb b/lib/lithic/models/management_operation_retrieve_params.rb new file mode 100644 index 00000000..521f6e8a --- /dev/null +++ b/lib/lithic/models/management_operation_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/management_operation_reverse_params.rb b/lib/lithic/models/management_operation_reverse_params.rb new file mode 100644 index 00000000..71428f02 --- /dev/null +++ b/lib/lithic/models/management_operation_reverse_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationReverseParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param effective_date [Date] + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(effective_date:, memo: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/management_operation_transaction.rb b/lib/lithic/models/management_operation_transaction.rb new file mode 100644 index 00000000..148812cf --- /dev/null +++ b/lib/lithic/models/management_operation_transaction.rb @@ -0,0 +1,287 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationTransaction < Lithic::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Category] + required :category, enum: -> { Lithic::Models::ManagementOperationTransaction::Category } + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute direction + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Direction] + required :direction, enum: -> { Lithic::Models::ManagementOperationTransaction::Direction } + + # @!attribute events + # + # @return [Array] + required :events, -> { Lithic::ArrayOf[Lithic::Models::ManagementOperationTransaction::Event] } + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute pending_amount + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Result] + required :result, enum: -> { Lithic::Models::ManagementOperationTransaction::Result } + + # @!attribute settled_amount + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Status] + required :status, enum: -> { Lithic::Models::ManagementOperationTransaction::Status } + + # @!attribute updated + # + # @return [Time] + required :updated, Time + + # @!attribute [r] user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!parse + # # @param token [String] + # # @param category [Symbol, Lithic::Models::ManagementOperationTransaction::Category] + # # @param created [Time] + # # @param currency [String] + # # @param direction [Symbol, Lithic::Models::ManagementOperationTransaction::Direction] + # # @param events [Array] + # # @param financial_account_token [String] + # # @param pending_amount [Integer] + # # @param result [Symbol, Lithic::Models::ManagementOperationTransaction::Result] + # # @param settled_amount [Integer] + # # @param status [Symbol, Lithic::Models::ManagementOperationTransaction::Status] + # # @param updated [Time] + # # @param user_defined_id [String] + # # + # def initialize( + # token:, + # category:, + # created:, + # currency:, + # direction:, + # events:, + # financial_account_token:, + # pending_amount:, + # result:, + # settled_amount:, + # status:, + # updated:, + # user_defined_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Category + extend Lithic::Enum + + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Direction + extend Lithic::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Event < Lithic::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::ArrayOf[enum: Lithic::Models::ManagementOperationTransaction::Event::DetailedResult] } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String] + required :memo, String + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Result] + required :result, enum: -> { Lithic::Models::ManagementOperationTransaction::Event::Result } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Type] + required :type, enum: -> { Lithic::Models::ManagementOperationTransaction::Event::Type } + + # @!attribute [r] subtype + # + # @return [String, nil] + optional :subtype, String + + # @!parse + # # @return [String] + # attr_writer :subtype + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param created [Time] + # # @param detailed_results [Array] + # # @param effective_date [Date] + # # @param memo [String] + # # @param result [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Result] + # # @param type [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Type] + # # @param subtype [String] + # # + # def initialize(token:, amount:, created:, detailed_results:, effective_date:, memo:, result:, type:, subtype: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module DetailedResult + extend Lithic::Enum + + APPROVED = :APPROVED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Type + extend Lithic::Enum + + CASH_BACK = :CASH_BACK + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + INTEREST = :INTEREST + LATE_PAYMENT = :LATE_PAYMENT + BILLING_ERROR = :BILLING_ERROR + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + INTEREST_REVERSAL = :INTEREST_REVERSAL + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Status + extend Lithic::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/message_attempt.rb b/lib/lithic/models/message_attempt.rb new file mode 100644 index 00000000..68a11d33 --- /dev/null +++ b/lib/lithic/models/message_attempt.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Lithic + module Models + class MessageAttempt < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute created + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + # + # @return [Time] + required :created, Time + + # @!attribute event_subscription_token + # Globally unique identifier. + # + # @return [String] + required :event_subscription_token, String + + # @!attribute event_token + # Globally unique identifier. + # + # @return [String] + required :event_token, String + + # @!attribute response + # The response body from the event subscription's URL. + # + # @return [String] + required :response, String + + # @!attribute response_status_code + # The response status code from the event subscription's URL. + # + # @return [Integer] + required :response_status_code, Integer + + # @!attribute status + # The status of the event attempt. + # + # @return [Symbol, Lithic::Models::MessageAttempt::Status] + required :status, enum: -> { Lithic::Models::MessageAttempt::Status } + + # @!attribute url + # + # @return [String] + required :url, String + + # @!parse + # # A subscription to specific event types. + # # + # # @param token [String] + # # @param created [Time] + # # @param event_subscription_token [String] + # # @param event_token [String] + # # @param response [String] + # # @param response_status_code [Integer] + # # @param status [Symbol, Lithic::Models::MessageAttempt::Status] + # # @param url [String] + # # + # def initialize( + # token:, + # created:, + # event_subscription_token:, + # event_token:, + # response:, + # response_status_code:, + # status:, + # url:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The status of the event attempt. + module Status + extend Lithic::Enum + + FAILED = :FAILED + PENDING = :PENDING + SENDING = :SENDING + SUCCESS = :SUCCESS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/owner_type.rb b/lib/lithic/models/owner_type.rb new file mode 100644 index 00000000..0a27c547 --- /dev/null +++ b/lib/lithic/models/owner_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + module OwnerType + extend Lithic::Enum + + INDIVIDUAL = :INDIVIDUAL + BUSINESS = :BUSINESS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end +end diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb new file mode 100644 index 00000000..79a5a8e3 --- /dev/null +++ b/lib/lithic/models/payment.rb @@ -0,0 +1,460 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Payment < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute category + # Payment category + # + # @return [Symbol, Lithic::Models::Payment::Category] + required :category, enum: -> { Lithic::Models::Payment::Category } + + # @!attribute created + # Date and time when the payment first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the payment. + # + # @return [String] + required :currency, String + + # @!attribute descriptor + # A string that provides a description of the payment; may be useful to display to + # users. + # + # @return [String] + required :descriptor, String + + # @!attribute direction + # + # @return [Symbol, Lithic::Models::Payment::Direction] + required :direction, enum: -> { Lithic::Models::Payment::Direction } + + # @!attribute events + # A list of all payment events that have modified this payment. + # + # @return [Array] + required :events, -> { Lithic::ArrayOf[Lithic::Models::Payment::Event] } + + # @!attribute external_bank_account_token + # + # @return [String, nil] + required :external_bank_account_token, String, nil?: true + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute method_ + # + # @return [Symbol, Lithic::Models::Payment::Method] + required :method_, enum: -> { Lithic::Models::Payment::Method }, api_name: :method + + # @!attribute method_attributes + # + # @return [Lithic::Models::Payment::MethodAttributes] + required :method_attributes, -> { Lithic::Models::Payment::MethodAttributes } + + # @!attribute pending_amount + # Pending amount of the payment in the currency's smallest unit (e.g., cents). The + # value of this field will go to zero over time once the payment is settled. + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # APPROVED payments were successful while DECLINED payments were declined by + # Lithic or returned. + # + # @return [Symbol, Lithic::Models::Payment::Result] + required :result, enum: -> { Lithic::Models::Payment::Result } + + # @!attribute settled_amount + # Amount of the payment that has been settled in the currency's smallest unit + # (e.g., cents). + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute source + # + # @return [Symbol, Lithic::Models::Payment::Source] + required :source, enum: -> { Lithic::Models::Payment::Source } + + # @!attribute status + # Status types: + # + # - `DECLINED` - The payment was declined. + # - `PENDING` - The payment is being processed and has yet to settle or release + # (origination debit). + # - `RETURNED` - The payment has been returned. + # - `SETTLED` - The payment is completed. + # + # @return [Symbol, Lithic::Models::Payment::Status] + required :status, enum: -> { Lithic::Models::Payment::Status } + + # @!attribute updated + # Date and time when the financial transaction was last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute user_defined_id + # + # @return [String, nil] + required :user_defined_id, String, nil?: true + + # @!parse + # # @param token [String] + # # @param category [Symbol, Lithic::Models::Payment::Category] + # # @param created [Time] + # # @param currency [String] + # # @param descriptor [String] + # # @param direction [Symbol, Lithic::Models::Payment::Direction] + # # @param events [Array] + # # @param external_bank_account_token [String, nil] + # # @param financial_account_token [String] + # # @param method_ [Symbol, Lithic::Models::Payment::Method] + # # @param method_attributes [Lithic::Models::Payment::MethodAttributes] + # # @param pending_amount [Integer] + # # @param result [Symbol, Lithic::Models::Payment::Result] + # # @param settled_amount [Integer] + # # @param source [Symbol, Lithic::Models::Payment::Source] + # # @param status [Symbol, Lithic::Models::Payment::Status] + # # @param updated [Time] + # # @param user_defined_id [String, nil] + # # + # def initialize( + # token:, + # category:, + # created:, + # currency:, + # descriptor:, + # direction:, + # events:, + # external_bank_account_token:, + # financial_account_token:, + # method_:, + # method_attributes:, + # pending_amount:, + # result:, + # settled_amount:, + # source:, + # status:, + # updated:, + # user_defined_id:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Payment category + module Category + extend Lithic::Enum + + ACH = :ACH + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Direction + extend Lithic::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Event < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # Date and time when the financial event occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute result + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::Payment::Event::Result] + required :result, enum: -> { Lithic::Models::Payment::Event::Result } + + # @!attribute type + # Event types: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the fed. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + # Financial Institution. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RETURN_SETTLED` - ACH receipt return settled by the Receiving Depository + # Financial Institution. + # + # @return [Symbol, Lithic::Models::Payment::Event::Type] + required :type, enum: -> { Lithic::Models::Payment::Event::Type } + + # @!attribute [r] detailed_results + # More detailed reasons for the event + # + # @return [Array, nil] + optional :detailed_results, -> { Lithic::ArrayOf[enum: Lithic::Models::Payment::Event::DetailedResult] } + + # @!parse + # # @return [Array] + # attr_writer :detailed_results + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param created [Time] + # # @param result [Symbol, Lithic::Models::Payment::Event::Result] + # # @param type [Symbol, Lithic::Models::Payment::Event::Type] + # # @param detailed_results [Array] + # # + # def initialize(token:, amount:, created:, result:, type:, detailed_results: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Event types: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the fed. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + # Financial Institution. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RETURN_SETTLED` - ACH receipt return settled by the Receiving Depository + # Financial Institution. + module Type + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED = :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED = :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module DetailedResult + extend Lithic::Enum + + APPROVED = :APPROVED + FUNDS_INSUFFICIENT = :FUNDS_INSUFFICIENT + ACCOUNT_INVALID = :ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED = :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED = :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + module Method + extend Lithic::Enum + + ACH_NEXT_DAY = :ACH_NEXT_DAY + ACH_SAME_DAY = :ACH_SAME_DAY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class MethodAttributes < Lithic::BaseModel + # @!attribute company_id + # + # @return [String, nil] + required :company_id, String, nil?: true + + # @!attribute receipt_routing_number + # + # @return [String, nil] + required :receipt_routing_number, String, nil?: true + + # @!attribute retries + # + # @return [Integer, nil] + required :retries, Integer, nil?: true + + # @!attribute return_reason_code + # + # @return [String, nil] + required :return_reason_code, String, nil?: true + + # @!attribute sec_code + # + # @return [Symbol, Lithic::Models::Payment::MethodAttributes::SecCode] + required :sec_code, enum: -> { Lithic::Models::Payment::MethodAttributes::SecCode } + + # @!attribute trace_numbers + # + # @return [Array] + required :trace_numbers, Lithic::ArrayOf[String, nil?: true] + + # @!parse + # # @param company_id [String, nil] + # # @param receipt_routing_number [String, nil] + # # @param retries [Integer, nil] + # # @param return_reason_code [String, nil] + # # @param sec_code [Symbol, Lithic::Models::Payment::MethodAttributes::SecCode] + # # @param trace_numbers [Array] + # # + # def initialize(company_id:, receipt_routing_number:, retries:, return_reason_code:, sec_code:, trace_numbers:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module SecCode + extend Lithic::Enum + + CCD = :CCD + PPD = :PPD + WEB = :WEB + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # APPROVED payments were successful while DECLINED payments were declined by + # Lithic or returned. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Source + extend Lithic::Enum + + CUSTOMER = :CUSTOMER + LITHIC = :LITHIC + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status types: + # + # - `DECLINED` - The payment was declined. + # - `PENDING` - The payment is being processed and has yet to settle or release + # (origination debit). + # - `RETURNED` - The payment has been returned. + # - `SETTLED` - The payment is completed. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_create_params.rb b/lib/lithic/models/payment_create_params.rb new file mode 100644 index 00000000..167918c2 --- /dev/null +++ b/lib/lithic/models/payment_create_params.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute method_ + # + # @return [Symbol, Lithic::Models::PaymentCreateParams::Method] + required :method_, enum: -> { Lithic::Models::PaymentCreateParams::Method }, api_name: :method + + # @!attribute method_attributes + # + # @return [Lithic::Models::PaymentCreateParams::MethodAttributes] + required :method_attributes, -> { Lithic::Models::PaymentCreateParams::MethodAttributes } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::PaymentCreateParams::Type] + required :type, enum: -> { Lithic::Models::PaymentCreateParams::Type } + + # @!attribute [r] token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!attribute [r] user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!parse + # # @return [String] + # attr_writer :user_defined_id + + # @!parse + # # @param amount [Integer] + # # @param external_bank_account_token [String] + # # @param financial_account_token [String] + # # @param method_ [Symbol, Lithic::Models::PaymentCreateParams::Method] + # # @param method_attributes [Lithic::Models::PaymentCreateParams::MethodAttributes] + # # @param type [Symbol, Lithic::Models::PaymentCreateParams::Type] + # # @param token [String] + # # @param memo [String] + # # @param user_defined_id [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # external_bank_account_token:, + # financial_account_token:, + # method_:, + # method_attributes:, + # type:, + # token: nil, + # memo: nil, + # user_defined_id: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Method + extend Lithic::Enum + + ACH_NEXT_DAY = :ACH_NEXT_DAY + ACH_SAME_DAY = :ACH_SAME_DAY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class MethodAttributes < Lithic::BaseModel + # @!attribute sec_code + # + # @return [Symbol, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode] + required :sec_code, enum: -> { Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode } + + # @!parse + # # @param sec_code [Symbol, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode] + # # + # def initialize(sec_code:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module SecCode + extend Lithic::Enum + + CCD = :CCD + PPD = :PPD + WEB = :WEB + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + module Type + extend Lithic::Enum + + COLLECTION = :COLLECTION + PAYMENT = :PAYMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_create_response.rb b/lib/lithic/models/payment_create_response.rb new file mode 100644 index 00000000..c166fcd7 --- /dev/null +++ b/lib/lithic/models/payment_create_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentCreateResponse < Lithic::Models::Payment + # @!attribute [r] balance + # Balance + # + # @return [Lithic::Models::Balance, nil] + optional :balance, -> { Lithic::Models::Balance } + + # @!parse + # # @return [Lithic::Models::Balance] + # attr_writer :balance + + # @!parse + # # @param balance [Lithic::Models::Balance] + # # + # def initialize(balance: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/payment_list_params.rb b/lib/lithic/models/payment_list_params.rb new file mode 100644 index 00000000..070bc49d --- /dev/null +++ b/lib/lithic/models/payment_list_params.rb @@ -0,0 +1,193 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!parse + # # @return [String] + # attr_writer :business_account_token + + # @!attribute [r] category + # + # @return [Symbol, Lithic::Models::PaymentListParams::Category, nil] + optional :category, enum: -> { Lithic::Models::PaymentListParams::Category } + + # @!parse + # # @return [Symbol, Lithic::Models::PaymentListParams::Category] + # attr_writer :category + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!parse + # # @return [String] + # attr_writer :financial_account_token + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] result + # + # @return [Symbol, Lithic::Models::PaymentListParams::Result, nil] + optional :result, enum: -> { Lithic::Models::PaymentListParams::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::PaymentListParams::Result] + # attr_writer :result + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # + # @return [Symbol, Lithic::Models::PaymentListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::PaymentListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::PaymentListParams::Status] + # attr_writer :status + + # @!parse + # # @param account_token [String] + # # @param begin_ [Time] + # # @param business_account_token [String] + # # @param category [Symbol, Lithic::Models::PaymentListParams::Category] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param financial_account_token [String] + # # @param page_size [Integer] + # # @param result [Symbol, Lithic::Models::PaymentListParams::Result] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::PaymentListParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # begin_: nil, + # business_account_token: nil, + # category: nil, + # end_: nil, + # ending_before: nil, + # financial_account_token: nil, + # page_size: nil, + # result: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + module Category + extend Lithic::Enum + + ACH = :ACH + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_retrieve_params.rb b/lib/lithic/models/payment_retrieve_params.rb new file mode 100644 index 00000000..8cc9407e --- /dev/null +++ b/lib/lithic/models/payment_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/payment_retry_params.rb b/lib/lithic/models/payment_retry_params.rb new file mode 100644 index 00000000..1f0410e9 --- /dev/null +++ b/lib/lithic/models/payment_retry_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentRetryParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/payment_retry_response.rb b/lib/lithic/models/payment_retry_response.rb new file mode 100644 index 00000000..1b63f30c --- /dev/null +++ b/lib/lithic/models/payment_retry_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentRetryResponse < Lithic::Models::Payment + # @!attribute [r] balance + # Balance + # + # @return [Lithic::Models::Balance, nil] + optional :balance, -> { Lithic::Models::Balance } + + # @!parse + # # @return [Lithic::Models::Balance] + # attr_writer :balance + + # @!parse + # # @param balance [Lithic::Models::Balance] + # # + # def initialize(balance: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/payment_simulate_action_params.rb b/lib/lithic/models/payment_simulate_action_params.rb new file mode 100644 index 00000000..3df0048a --- /dev/null +++ b/lib/lithic/models/payment_simulate_action_params.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateActionParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute event_type + # Event Type + # + # @return [Symbol, Lithic::Models::PaymentSimulateActionParams::EventType] + required :event_type, enum: -> { Lithic::Models::PaymentSimulateActionParams::EventType } + + # @!attribute [r] decline_reason + # Decline reason + # + # @return [Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason, nil] + optional :decline_reason, enum: -> { Lithic::Models::PaymentSimulateActionParams::DeclineReason } + + # @!parse + # # @return [Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason] + # attr_writer :decline_reason + + # @!attribute [r] return_reason_code + # Return Reason Code + # + # @return [String, nil] + optional :return_reason_code, String + + # @!parse + # # @return [String] + # attr_writer :return_reason_code + + # @!parse + # # @param event_type [Symbol, Lithic::Models::PaymentSimulateActionParams::EventType] + # # @param decline_reason [Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason] + # # @param return_reason_code [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(event_type:, decline_reason: nil, return_reason_code: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Event Type + module EventType + extend Lithic::Enum + + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Decline reason + module DeclineReason + extend Lithic::Enum + + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED = :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED = :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_action_response.rb b/lib/lithic/models/payment_simulate_action_response.rb new file mode 100644 index 00000000..970265d7 --- /dev/null +++ b/lib/lithic/models/payment_simulate_action_response.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateActionResponse < Lithic::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateActionResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateActionResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!parse + # # @param debugging_request_id [String] + # # @param result [Symbol, Lithic::Models::PaymentSimulateActionResponse::Result] + # # @param transaction_event_token [String] + # # + # def initialize(debugging_request_id:, result:, transaction_event_token:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Request Result + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_receipt_params.rb b/lib/lithic/models/payment_simulate_receipt_params.rb new file mode 100644 index 00000000..d4a48d48 --- /dev/null +++ b/lib/lithic/models/payment_simulate_receipt_params.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateReceiptParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute token + # Payment token + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute financial_account_token + # Financial Account Token + # + # @return [String] + required :financial_account_token, String + + # @!attribute receipt_type + # Receipt Type + # + # @return [Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType] + required :receipt_type, enum: -> { Lithic::Models::PaymentSimulateReceiptParams::ReceiptType } + + # @!attribute [r] memo + # Memo + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param financial_account_token [String] + # # @param receipt_type [Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType] + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Receipt Type + module ReceiptType + extend Lithic::Enum + + RECEIPT_CREDIT = :RECEIPT_CREDIT + RECEIPT_DEBIT = :RECEIPT_DEBIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_receipt_response.rb b/lib/lithic/models/payment_simulate_receipt_response.rb new file mode 100644 index 00000000..1feeba9c --- /dev/null +++ b/lib/lithic/models/payment_simulate_receipt_response.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateReceiptResponse < Lithic::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateReceiptResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateReceiptResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!parse + # # @param debugging_request_id [String] + # # @param result [Symbol, Lithic::Models::PaymentSimulateReceiptResponse::Result] + # # @param transaction_event_token [String] + # # + # def initialize(debugging_request_id:, result:, transaction_event_token:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Request Result + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_release_params.rb b/lib/lithic/models/payment_simulate_release_params.rb new file mode 100644 index 00000000..bb37bebd --- /dev/null +++ b/lib/lithic/models/payment_simulate_release_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateReleaseParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute payment_token + # Payment Token + # + # @return [String] + required :payment_token, String + + # @!parse + # # @param payment_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(payment_token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/payment_simulate_release_response.rb b/lib/lithic/models/payment_simulate_release_response.rb new file mode 100644 index 00000000..3ea1655d --- /dev/null +++ b/lib/lithic/models/payment_simulate_release_response.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateReleaseResponse < Lithic::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateReleaseResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateReleaseResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!parse + # # @param debugging_request_id [String] + # # @param result [Symbol, Lithic::Models::PaymentSimulateReleaseResponse::Result] + # # @param transaction_event_token [String] + # # + # def initialize(debugging_request_id:, result:, transaction_event_token:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Request Result + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_return_params.rb b/lib/lithic/models/payment_simulate_return_params.rb new file mode 100644 index 00000000..be636de8 --- /dev/null +++ b/lib/lithic/models/payment_simulate_return_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateReturnParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute payment_token + # Payment Token + # + # @return [String] + required :payment_token, String + + # @!attribute [r] return_reason_code + # Return Reason Code + # + # @return [String, nil] + optional :return_reason_code, String + + # @!parse + # # @return [String] + # attr_writer :return_reason_code + + # @!parse + # # @param payment_token [String] + # # @param return_reason_code [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(payment_token:, return_reason_code: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/payment_simulate_return_response.rb b/lib/lithic/models/payment_simulate_return_response.rb new file mode 100644 index 00000000..c5cca91a --- /dev/null +++ b/lib/lithic/models/payment_simulate_return_response.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentSimulateReturnResponse < Lithic::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateReturnResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateReturnResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!parse + # # @param debugging_request_id [String] + # # @param result [Symbol, Lithic::Models::PaymentSimulateReturnResponse::Result] + # # @param transaction_event_token [String] + # # + # def initialize(debugging_request_id:, result:, transaction_event_token:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Request Result + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/reports/settlement/network_total_list_params.rb b/lib/lithic/models/reports/settlement/network_total_list_params.rb new file mode 100644 index 00000000..800678c6 --- /dev/null +++ b/lib/lithic/models/reports/settlement/network_total_list_params.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] begin_ + # Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] end_ + # Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] institution_id + # Institution ID to filter on. + # + # @return [String, nil] + optional :institution_id, String + + # @!parse + # # @return [String] + # attr_writer :institution_id + + # @!attribute [r] network + # Network to filter on. + # + # @return [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network, nil] + optional :network, enum: -> { Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network } + + # @!parse + # # @return [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network] + # attr_writer :network + + # @!attribute [r] page_size + # Number of records per page. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] report_date + # Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + # + # @return [Date, nil] + optional :report_date, Date + + # @!parse + # # @return [Date] + # attr_writer :report_date + + # @!attribute [r] report_date_begin + # Earliest report date to filter on, inclusive (YYYY-MM-DD). + # + # @return [Date, nil] + optional :report_date_begin, Date + + # @!parse + # # @return [Date] + # attr_writer :report_date_begin + + # @!attribute [r] report_date_end + # Latest report date to filter on, inclusive (YYYY-MM-DD). + # + # @return [Date, nil] + optional :report_date_end, Date + + # @!parse + # # @return [Date] + # attr_writer :report_date_end + + # @!attribute [r] settlement_institution_id + # Settlement institution ID to filter on. + # + # @return [String, nil] + optional :settlement_institution_id, String + + # @!parse + # # @return [String] + # attr_writer :settlement_institution_id + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param begin_ [Time] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param institution_id [String] + # # @param network [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network] + # # @param page_size [Integer] + # # @param report_date [Date] + # # @param report_date_begin [Date] + # # @param report_date_end [Date] + # # @param settlement_institution_id [String] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # begin_: nil, + # end_: nil, + # ending_before: nil, + # institution_id: nil, + # network: nil, + # page_size: nil, + # report_date: nil, + # report_date_begin: nil, + # report_date_end: nil, + # settlement_institution_id: nil, + # starting_after: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Network to filter on. + module Network + extend Lithic::Enum + + VISA = :VISA + MASTERCARD = :MASTERCARD + MAESTRO = :MAESTRO + INTERLINK = :INTERLINK + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end +end diff --git a/lib/lithic/models/reports/settlement/network_total_list_response.rb b/lib/lithic/models/reports/settlement/network_total_list_response.rb new file mode 100644 index 00000000..c2a34589 --- /dev/null +++ b/lib/lithic/models/reports/settlement/network_total_list_response.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalListResponse < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amounts + # + # @return [Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts] + required :amounts, -> { Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts } + + # @!attribute created + # RFC 3339 timestamp for when the record was created. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code. + # + # @return [String] + required :currency, String + + # @!attribute institution_id + # The institution that activity occurred on. For Mastercard: ICA (Interbank Card + # Association). For Maestro: institution ID. For Visa: lowest level SRE + # (Settlement Reporting Entity). + # + # @return [String] + required :institution_id, String + + # @!attribute network + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + # + # @return [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network] + required :network, enum: -> { Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network } + + # @!attribute report_date + # Date that the network total record applies to. YYYY-MM-DD format. + # + # @return [Date] + required :report_date, Date + + # @!attribute settlement_institution_id + # The institution responsible for settlement. For Mastercard: same as + # `institution_id`. For Maestro: billing ICA. For Visa: Funds Transfer SRE + # (FTSRE). + # + # @return [String] + required :settlement_institution_id, String + + # @!attribute settlement_service + # Settlement service. + # + # @return [String] + required :settlement_service, String + + # @!attribute updated + # RFC 3339 timestamp for when the record was last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute [r] cycle + # The clearing cycle that the network total record applies to. Mastercard only. + # + # @return [Integer, nil] + optional :cycle, Integer + + # @!parse + # # @return [Integer] + # attr_writer :cycle + + # @!parse + # # @param token [String] + # # @param amounts [Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts] + # # @param created [Time] + # # @param currency [String] + # # @param institution_id [String] + # # @param network [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network] + # # @param report_date [Date] + # # @param settlement_institution_id [String] + # # @param settlement_service [String] + # # @param updated [Time] + # # @param cycle [Integer] + # # + # def initialize( + # token:, + # amounts:, + # created:, + # currency:, + # institution_id:, + # network:, + # report_date:, + # settlement_institution_id:, + # settlement_service:, + # updated:, + # cycle: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Amounts < Lithic::BaseModel + # @!attribute gross_settlement + # Total settlement amount excluding interchange, in currency's smallest unit. + # + # @return [Integer] + required :gross_settlement, Integer + + # @!attribute interchange_fees + # Interchange amount, in currency's smallest unit. + # + # @return [Integer] + required :interchange_fees, Integer + + # @!attribute net_settlement + # `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # in currency's smallest unit. + # + # @return [Integer] + required :net_settlement, Integer + + # @!attribute [r] visa_charges + # Charges specific to Visa/Interlink, in currency's smallest unit. + # + # @return [Integer, nil] + optional :visa_charges, Integer + + # @!parse + # # @return [Integer] + # attr_writer :visa_charges + + # @!parse + # # @param gross_settlement [Integer] + # # @param interchange_fees [Integer] + # # @param net_settlement [Integer] + # # @param visa_charges [Integer] + # # + # def initialize(gross_settlement:, interchange_fees:, net_settlement:, visa_charges: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + module Network + extend Lithic::Enum + + VISA = :VISA + MASTERCARD = :MASTERCARD + MAESTRO = :MAESTRO + INTERLINK = :INTERLINK + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end +end diff --git a/lib/lithic/models/reports/settlement/network_total_retrieve_params.rb b/lib/lithic/models/reports/settlement/network_total_retrieve_params.rb new file mode 100644 index 00000000..e19ba6d4 --- /dev/null +++ b/lib/lithic/models/reports/settlement/network_total_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/reports/settlement/network_total_retrieve_response.rb b/lib/lithic/models/reports/settlement/network_total_retrieve_response.rb new file mode 100644 index 00000000..1abc23aa --- /dev/null +++ b/lib/lithic/models/reports/settlement/network_total_retrieve_response.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalRetrieveResponse < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amounts + # + # @return [Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts] + required :amounts, -> { Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts } + + # @!attribute created + # RFC 3339 timestamp for when the record was created. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code. + # + # @return [String] + required :currency, String + + # @!attribute institution_id + # The institution that activity occurred on. For Mastercard: ICA (Interbank Card + # Association). For Maestro: institution ID. For Visa: lowest level SRE + # (Settlement Reporting Entity). + # + # @return [String] + required :institution_id, String + + # @!attribute network + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + # + # @return [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network] + required :network, enum: -> { Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network } + + # @!attribute report_date + # Date that the network total record applies to. YYYY-MM-DD format. + # + # @return [Date] + required :report_date, Date + + # @!attribute settlement_institution_id + # The institution responsible for settlement. For Mastercard: same as + # `institution_id`. For Maestro: billing ICA. For Visa: Funds Transfer SRE + # (FTSRE). + # + # @return [String] + required :settlement_institution_id, String + + # @!attribute settlement_service + # Settlement service. + # + # @return [String] + required :settlement_service, String + + # @!attribute updated + # RFC 3339 timestamp for when the record was last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute [r] cycle + # The clearing cycle that the network total record applies to. Mastercard only. + # + # @return [Integer, nil] + optional :cycle, Integer + + # @!parse + # # @return [Integer] + # attr_writer :cycle + + # @!parse + # # @param token [String] + # # @param amounts [Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts] + # # @param created [Time] + # # @param currency [String] + # # @param institution_id [String] + # # @param network [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network] + # # @param report_date [Date] + # # @param settlement_institution_id [String] + # # @param settlement_service [String] + # # @param updated [Time] + # # @param cycle [Integer] + # # + # def initialize( + # token:, + # amounts:, + # created:, + # currency:, + # institution_id:, + # network:, + # report_date:, + # settlement_institution_id:, + # settlement_service:, + # updated:, + # cycle: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Amounts < Lithic::BaseModel + # @!attribute gross_settlement + # Total settlement amount excluding interchange, in currency's smallest unit. + # + # @return [Integer] + required :gross_settlement, Integer + + # @!attribute interchange_fees + # Interchange amount, in currency's smallest unit. + # + # @return [Integer] + required :interchange_fees, Integer + + # @!attribute net_settlement + # `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # in currency's smallest unit. + # + # @return [Integer] + required :net_settlement, Integer + + # @!attribute [r] visa_charges + # Charges specific to Visa/Interlink, in currency's smallest unit. + # + # @return [Integer, nil] + optional :visa_charges, Integer + + # @!parse + # # @return [Integer] + # attr_writer :visa_charges + + # @!parse + # # @param gross_settlement [Integer] + # # @param interchange_fees [Integer] + # # @param net_settlement [Integer] + # # @param visa_charges [Integer] + # # + # def initialize(gross_settlement:, interchange_fees:, net_settlement:, visa_charges: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + module Network + extend Lithic::Enum + + VISA = :VISA + MASTERCARD = :MASTERCARD + MAESTRO = :MAESTRO + INTERLINK = :INTERLINK + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end +end diff --git a/lib/lithic/models/reports/settlement_list_details_params.rb b/lib/lithic/models/reports/settlement_list_details_params.rb new file mode 100644 index 00000000..681dbfff --- /dev/null +++ b/lib/lithic/models/reports/settlement_list_details_params.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + class SettlementListDetailsParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!parse + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/reports/settlement_summary_params.rb b/lib/lithic/models/reports/settlement_summary_params.rb new file mode 100644 index 00000000..c648a5a9 --- /dev/null +++ b/lib/lithic/models/reports/settlement_summary_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + class SettlementSummaryParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/required_document.rb b/lib/lithic/models/required_document.rb new file mode 100644 index 00000000..a0964c75 --- /dev/null +++ b/lib/lithic/models/required_document.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Lithic + module Models + class RequiredDocument < Lithic::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute status_reasons + # rovides the status reasons that will be satisfied by providing one of the valid + # documents. + # + # @return [Array] + required :status_reasons, Lithic::ArrayOf[String] + + # @!attribute valid_documents + # A list of valid documents that will satisfy the KYC requirements for the + # specified entity. + # + # @return [Array] + required :valid_documents, Lithic::ArrayOf[String] + + # @!parse + # # @param entity_token [String] + # # @param status_reasons [Array] + # # @param valid_documents [Array] + # # + # def initialize(entity_token:, status_reasons:, valid_documents:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/responder_endpoint_check_status_params.rb b/lib/lithic/models/responder_endpoint_check_status_params.rb new file mode 100644 index 00000000..b1237928 --- /dev/null +++ b/lib/lithic/models/responder_endpoint_check_status_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ResponderEndpointCheckStatusParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute type + # The type of the endpoint. + # + # @return [Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type] + required :type, enum: -> { Lithic::Models::ResponderEndpointCheckStatusParams::Type } + + # @!parse + # # @param type [Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(type:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The type of the endpoint. + module Type + extend Lithic::Enum + + AUTH_STREAM_ACCESS = :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING = :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/responder_endpoint_create_params.rb b/lib/lithic/models/responder_endpoint_create_params.rb new file mode 100644 index 00000000..ff44b8bb --- /dev/null +++ b/lib/lithic/models/responder_endpoint_create_params.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ResponderEndpointCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] type + # The type of the endpoint. + # + # @return [Symbol, Lithic::Models::ResponderEndpointCreateParams::Type, nil] + optional :type, enum: -> { Lithic::Models::ResponderEndpointCreateParams::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::ResponderEndpointCreateParams::Type] + # attr_writer :type + + # @!attribute [r] url + # The URL for the responder endpoint (must be http(s)). + # + # @return [String, nil] + optional :url, String + + # @!parse + # # @return [String] + # attr_writer :url + + # @!parse + # # @param type [Symbol, Lithic::Models::ResponderEndpointCreateParams::Type] + # # @param url [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(type: nil, url: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The type of the endpoint. + module Type + extend Lithic::Enum + + AUTH_STREAM_ACCESS = :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING = :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/responder_endpoint_create_response.rb b/lib/lithic/models/responder_endpoint_create_response.rb new file mode 100644 index 00000000..23f9e5ec --- /dev/null +++ b/lib/lithic/models/responder_endpoint_create_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ResponderEndpointCreateResponse < Lithic::BaseModel + # @!attribute [r] enrolled + # True if the endpoint was enrolled successfully. + # + # @return [Boolean, nil] + optional :enrolled, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :enrolled + + # @!parse + # # @param enrolled [Boolean] + # # + # def initialize(enrolled: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/responder_endpoint_delete_params.rb b/lib/lithic/models/responder_endpoint_delete_params.rb new file mode 100644 index 00000000..4a937c78 --- /dev/null +++ b/lib/lithic/models/responder_endpoint_delete_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ResponderEndpointDeleteParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute type + # The type of the endpoint. + # + # @return [Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type] + required :type, enum: -> { Lithic::Models::ResponderEndpointDeleteParams::Type } + + # @!parse + # # @param type [Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(type:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The type of the endpoint. + module Type + extend Lithic::Enum + + AUTH_STREAM_ACCESS = :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING = :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/responder_endpoint_status.rb b/lib/lithic/models/responder_endpoint_status.rb new file mode 100644 index 00000000..f6962ba8 --- /dev/null +++ b/lib/lithic/models/responder_endpoint_status.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ResponderEndpointStatus < Lithic::BaseModel + # @!attribute [r] enrolled + # True if the instance has an endpoint enrolled. + # + # @return [Boolean, nil] + optional :enrolled, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :enrolled + + # @!attribute url + # The URL of the currently enrolled endpoint or null. + # + # @return [String, nil] + optional :url, String, nil?: true + + # @!parse + # # @param enrolled [Boolean] + # # @param url [String, nil] + # # + # def initialize(enrolled: nil, url: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/settlement_detail.rb b/lib/lithic/models/settlement_detail.rb new file mode 100644 index 00000000..b71a5853 --- /dev/null +++ b/lib/lithic/models/settlement_detail.rb @@ -0,0 +1,252 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementDetail < Lithic::BaseModel + # @!attribute token + # Globally unique identifier denoting the Settlement Detail. + # + # @return [String] + required :token, String + + # @!attribute account_token + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + # + # @return [String] + required :account_token, String + + # @!attribute card_program_token + # Globally unique identifier denoting the card program that the associated + # Transaction occurred on. + # + # @return [String] + required :card_program_token, String + + # @!attribute card_token + # Globally unique identifier denoting the card that the associated Transaction + # occurred on. + # + # @return [String] + required :card_token, String + + # @!attribute created + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # Three-character alphabetic ISO 4217 code. + # + # @return [String] + required :currency, String + + # @!attribute disputes_gross_amount + # The total gross amount of disputes settlements. + # + # @return [Integer] + required :disputes_gross_amount, Integer + + # @!attribute event_tokens + # Globally unique identifiers denoting the Events associated with this settlement. + # + # @return [Array] + required :event_tokens, Lithic::ArrayOf[String] + + # @!attribute institution + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + # + # @return [String] + required :institution, String + + # @!attribute interchange_fee_extended_precision + # The total amount of interchange in six-digit extended precision. + # + # @return [Integer] + required :interchange_fee_extended_precision, Integer + + # @!attribute interchange_gross_amount + # The total amount of interchange. + # + # @return [Integer] + required :interchange_gross_amount, Integer + + # @!attribute network + # Card network where the transaction took place. + # + # @return [Symbol, Lithic::Models::SettlementDetail::Network] + required :network, enum: -> { Lithic::Models::SettlementDetail::Network } + + # @!attribute other_fees_details + # The total gross amount of other fees by type. + # + # @return [Lithic::Models::SettlementDetail::OtherFeesDetails] + required :other_fees_details, -> { Lithic::Models::SettlementDetail::OtherFeesDetails } + + # @!attribute other_fees_gross_amount + # Total amount of gross other fees outside of interchange. + # + # @return [Integer] + required :other_fees_gross_amount, Integer + + # @!attribute report_date + # Date of when the report was first generated. + # + # @return [String] + required :report_date, String + + # @!attribute settlement_date + # Date of when money movement is triggered for the transaction. + # + # @return [String] + required :settlement_date, String + + # @!attribute transaction_token + # Globally unique identifier denoting the associated Transaction object. + # + # @return [String] + required :transaction_token, String + + # @!attribute transactions_gross_amount + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + # + # @return [Integer] + required :transactions_gross_amount, Integer + + # @!attribute type + # The type of settlement record. + # + # @return [Symbol, Lithic::Models::SettlementDetail::Type] + required :type, enum: -> { Lithic::Models::SettlementDetail::Type } + + # @!attribute updated + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute [r] fee_description + # Network's description of a fee, only present on records with type `FEE`. + # + # @return [String, nil] + optional :fee_description, String + + # @!parse + # # @return [String] + # attr_writer :fee_description + + # @!parse + # # @param token [String] + # # @param account_token [String] + # # @param card_program_token [String] + # # @param card_token [String] + # # @param created [Time] + # # @param currency [String] + # # @param disputes_gross_amount [Integer] + # # @param event_tokens [Array] + # # @param institution [String] + # # @param interchange_fee_extended_precision [Integer] + # # @param interchange_gross_amount [Integer] + # # @param network [Symbol, Lithic::Models::SettlementDetail::Network] + # # @param other_fees_details [Lithic::Models::SettlementDetail::OtherFeesDetails] + # # @param other_fees_gross_amount [Integer] + # # @param report_date [String] + # # @param settlement_date [String] + # # @param transaction_token [String] + # # @param transactions_gross_amount [Integer] + # # @param type [Symbol, Lithic::Models::SettlementDetail::Type] + # # @param updated [Time] + # # @param fee_description [String] + # # + # def initialize( + # token:, + # account_token:, + # card_program_token:, + # card_token:, + # created:, + # currency:, + # disputes_gross_amount:, + # event_tokens:, + # institution:, + # interchange_fee_extended_precision:, + # interchange_gross_amount:, + # network:, + # other_fees_details:, + # other_fees_gross_amount:, + # report_date:, + # settlement_date:, + # transaction_token:, + # transactions_gross_amount:, + # type:, + # updated:, + # fee_description: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Card network where the transaction took place. + module Network + extend Lithic::Enum + + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class OtherFeesDetails < Lithic::BaseModel + # @!attribute [r] isa + # + # @return [Integer, nil] + optional :isa, Integer, api_name: :ISA + + # @!parse + # # @return [Integer] + # attr_writer :isa + + # @!parse + # # The total gross amount of other fees by type. + # # + # # @param isa [Integer] + # # + # def initialize(isa: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # The type of settlement record. + module Type + extend Lithic::Enum + + ADJUSTMENT = :ADJUSTMENT + ARBITRATION = :ARBITRATION + CHARGEBACK = :CHARGEBACK + CLEARING = :CLEARING + FEE = :FEE + FINANCIAL = :FINANCIAL + NON_FINANCIAL = :"NON-FINANCIAL" + PREARBITRATION = :PREARBITRATION + REPRESENTMENT = :REPRESENTMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/settlement_report.rb b/lib/lithic/models/settlement_report.rb new file mode 100644 index 00000000..16b057aa --- /dev/null +++ b/lib/lithic/models/settlement_report.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementReport < Lithic::BaseModel + # @!attribute created + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code. (This field is deprecated and will be + # removed in a future version of the API.) + # + # @return [String] + required :currency, String + + # @!attribute details + # + # @return [Array] + required :details, -> { Lithic::ArrayOf[Lithic::Models::SettlementSummaryDetails] } + + # @!attribute disputes_gross_amount + # The total gross amount of disputes settlements. (This field is deprecated and + # will be removed in a future version of the API. To compute total amounts, Lithic + # recommends that customers sum the relevant settlement amounts found within + # `details`.) + # + # @return [Integer] + required :disputes_gross_amount, Integer + + # @!attribute interchange_gross_amount + # The total amount of interchange. (This field is deprecated and will be removed + # in a future version of the API. To compute total amounts, Lithic recommends that + # customers sum the relevant settlement amounts found within `details`.) + # + # @return [Integer] + required :interchange_gross_amount, Integer + + # @!attribute is_complete + # Indicates that all data expected on the given report date is available. + # + # @return [Boolean] + required :is_complete, Lithic::BooleanModel + + # @!attribute other_fees_gross_amount + # Total amount of gross other fees outside of interchange. (This field is + # deprecated and will be removed in a future version of the API. To compute total + # amounts, Lithic recommends that customers sum the relevant settlement amounts + # found within `details`.) + # + # @return [Integer] + required :other_fees_gross_amount, Integer + + # @!attribute report_date + # Date of when the report was first generated. + # + # @return [String] + required :report_date, String + + # @!attribute settled_net_amount + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + # + # @return [Integer] + required :settled_net_amount, Integer + + # @!attribute transactions_gross_amount + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + # + # @return [Integer] + required :transactions_gross_amount, Integer + + # @!attribute updated + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!parse + # # @param created [Time] + # # @param currency [String] + # # @param details [Array] + # # @param disputes_gross_amount [Integer] + # # @param interchange_gross_amount [Integer] + # # @param is_complete [Boolean] + # # @param other_fees_gross_amount [Integer] + # # @param report_date [String] + # # @param settled_net_amount [Integer] + # # @param transactions_gross_amount [Integer] + # # @param updated [Time] + # # + # def initialize( + # created:, + # currency:, + # details:, + # disputes_gross_amount:, + # interchange_gross_amount:, + # is_complete:, + # other_fees_gross_amount:, + # report_date:, + # settled_net_amount:, + # transactions_gross_amount:, + # updated:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/settlement_summary_details.rb b/lib/lithic/models/settlement_summary_details.rb new file mode 100644 index 00000000..63305147 --- /dev/null +++ b/lib/lithic/models/settlement_summary_details.rb @@ -0,0 +1,133 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementSummaryDetails < Lithic::BaseModel + # @!attribute [r] currency + # 3-character alphabetic ISO 4217 code. + # + # @return [String, nil] + optional :currency, String + + # @!parse + # # @return [String] + # attr_writer :currency + + # @!attribute [r] disputes_gross_amount + # The total gross amount of disputes settlements. + # + # @return [Integer, nil] + optional :disputes_gross_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :disputes_gross_amount + + # @!attribute [r] institution + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + # + # @return [String, nil] + optional :institution, String + + # @!parse + # # @return [String] + # attr_writer :institution + + # @!attribute [r] interchange_gross_amount + # The total amount of interchange. + # + # @return [Integer, nil] + optional :interchange_gross_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :interchange_gross_amount + + # @!attribute [r] network + # Card network where the transaction took place + # + # @return [Symbol, Lithic::Models::SettlementSummaryDetails::Network, nil] + optional :network, enum: -> { Lithic::Models::SettlementSummaryDetails::Network } + + # @!parse + # # @return [Symbol, Lithic::Models::SettlementSummaryDetails::Network] + # attr_writer :network + + # @!attribute [r] other_fees_gross_amount + # Total amount of gross other fees outside of interchange. + # + # @return [Integer, nil] + optional :other_fees_gross_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :other_fees_gross_amount + + # @!attribute [r] settled_net_amount + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). + # + # @return [Integer, nil] + optional :settled_net_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :settled_net_amount + + # @!attribute [r] transactions_gross_amount + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + # + # @return [Integer, nil] + optional :transactions_gross_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :transactions_gross_amount + + # @!parse + # # @param currency [String] + # # @param disputes_gross_amount [Integer] + # # @param institution [String] + # # @param interchange_gross_amount [Integer] + # # @param network [Symbol, Lithic::Models::SettlementSummaryDetails::Network] + # # @param other_fees_gross_amount [Integer] + # # @param settled_net_amount [Integer] + # # @param transactions_gross_amount [Integer] + # # + # def initialize( + # currency: nil, + # disputes_gross_amount: nil, + # institution: nil, + # interchange_gross_amount: nil, + # network: nil, + # other_fees_gross_amount: nil, + # settled_net_amount: nil, + # transactions_gross_amount: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Card network where the transaction took place + module Network + extend Lithic::Enum + + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/shipping_address.rb b/lib/lithic/models/shipping_address.rb new file mode 100644 index 00000000..fd118bc8 --- /dev/null +++ b/lib/lithic/models/shipping_address.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ShippingAddress < Lithic::BaseModel + # @!attribute address1 + # Valid USPS routable address. + # + # @return [String] + required :address1, String + + # @!attribute city + # City + # + # @return [String] + required :city, String + + # @!attribute country + # Uppercase ISO 3166-1 alpha-3 three character abbreviation. + # + # @return [String] + required :country, String + + # @!attribute first_name + # Customer's first name. This will be the first name printed on the physical card. + # The combined length of `first_name` and `last_name` may not exceed 25 + # characters. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Customer's surname (family name). This will be the last name printed on the + # physical card. The combined length of `first_name` and `last_name` may not + # exceed 25 characters. + # + # @return [String] + required :last_name, String + + # @!attribute postal_code + # Postal code (formerly zipcode). For US addresses, either five-digit postal code + # or nine-digit postal code (ZIP+4) using the format 12345-1234. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a + # limit of 24 characters for other countries. + # + # @return [String] + required :state, String + + # @!attribute [r] address2 + # Unit number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!parse + # # @return [String] + # attr_writer :address2 + + # @!attribute [r] email + # Email address to be contacted for expedited shipping process purposes. Required + # if `shipping_method` is `EXPEDITED`. + # + # @return [String, nil] + optional :email, String + + # @!parse + # # @return [String] + # attr_writer :email + + # @!attribute [r] line2_text + # Text to be printed on line two of the physical card. Use of this field requires + # additional permissions. + # + # @return [String, nil] + optional :line2_text, String + + # @!parse + # # @return [String] + # attr_writer :line2_text + + # @!attribute [r] phone_number + # Cardholder's phone number in E.164 format to be contacted for expedited shipping + # process purposes. Required if `shipping_method` is `EXPEDITED`. + # + # @return [String, nil] + optional :phone_number, String + + # @!parse + # # @return [String] + # attr_writer :phone_number + + # @!parse + # # @param address1 [String] + # # @param city [String] + # # @param country [String] + # # @param first_name [String] + # # @param last_name [String] + # # @param postal_code [String] + # # @param state [String] + # # @param address2 [String] + # # @param email [String] + # # @param line2_text [String] + # # @param phone_number [String] + # # + # def initialize( + # address1:, + # city:, + # country:, + # first_name:, + # last_name:, + # postal_code:, + # state:, + # address2: nil, + # email: nil, + # line2_text: nil, + # phone_number: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/spend_limit_duration.rb b/lib/lithic/models/spend_limit_duration.rb new file mode 100644 index 00000000..ea265d95 --- /dev/null +++ b/lib/lithic/models/spend_limit_duration.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + module SpendLimitDuration + extend Lithic::Enum + + ANNUALLY = :ANNUALLY + FOREVER = :FOREVER + MONTHLY = :MONTHLY + TRANSACTION = :TRANSACTION + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_retrieve_params.rb b/lib/lithic/models/three_ds/authentication_retrieve_params.rb new file mode 100644 index 00000000..b83c1ddf --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class AuthenticationRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_retrieve_response.rb b/lib/lithic/models/three_ds/authentication_retrieve_response.rb new file mode 100644 index 00000000..4ebfb99a --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_retrieve_response.rb @@ -0,0 +1,1102 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class AuthenticationRetrieveResponse < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the 3DS authentication. + # + # @return [String] + required :token, String + + # @!attribute account_type + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType, nil] + required :account_type, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType }, + nil?: true + + # @!attribute authentication_result + # Indicates the outcome of the 3DS authentication process. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult] + required :authentication_result, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult } + + # @!attribute card_expiry_check + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck] + required :card_expiry_check, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck } + + # @!attribute card_token + # Globally unique identifier for the card on which the 3DS authentication has + # occurred. + # + # @return [String] + required :card_token, String + + # @!attribute cardholder + # Object containing data about the cardholder provided during the transaction. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder] + required :cardholder, -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder } + + # @!attribute channel + # Channel in which the authentication occurs. Maps to EMV 3DS field deviceChannel. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel] + required :channel, enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel } + + # @!attribute created + # Date and time when the authentication was created in Lithic's system. + # + # @return [Time] + required :created, Time + + # @!attribute merchant + # Object containing data about the merchant involved in the e-commerce + # transaction. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant] + required :merchant, -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant } + + # @!attribute message_category + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory] + required :message_category, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory } + + # @!attribute three_ds_requestor_challenge_indicator + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator] + required :three_ds_requestor_challenge_indicator, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator } + + # @!attribute additional_data + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData, nil] + optional :additional_data, + -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData }, + nil?: true + + # @!attribute [r] app + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App, nil] + optional :app, -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App } + + # @!parse + # # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App] + # attr_writer :app + + # @!attribute authentication_request_type + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # threeDSRequestorAuthenticationInd. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType, nil] + optional :authentication_request_type, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType }, + nil?: true + + # @!attribute [r] browser + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser, nil] + optional :browser, -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser } + + # @!parse + # # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser] + # attr_writer :browser + + # @!attribute challenge_metadata + # Metadata about the challenge method and delivery. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata, nil] + optional :challenge_metadata, + -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata }, + nil?: true + + # @!attribute challenge_orchestrated_by + # Entity that orchestrates the challenge. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy, nil] + optional :challenge_orchestrated_by, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy }, + nil?: true + + # @!attribute decision_made_by + # Entity that made the authentication decision. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy, nil] + optional :decision_made_by, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy }, + nil?: true + + # @!attribute three_ri_request_type + # Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field threeRIInd. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType, nil] + optional :three_ri_request_type, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType }, + nil?: true + + # @!attribute transaction + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction, nil] + optional :transaction, + -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction }, + nil?: true + + # @!parse + # # @param token [String] + # # @param account_type [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType, nil] + # # @param authentication_result [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult] + # # @param card_expiry_check [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck] + # # @param card_token [String] + # # @param cardholder [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder] + # # @param channel [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel] + # # @param created [Time] + # # @param merchant [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant] + # # @param message_category [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory] + # # @param three_ds_requestor_challenge_indicator [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator] + # # @param additional_data [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData, nil] + # # @param app [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App] + # # @param authentication_request_type [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType, nil] + # # @param browser [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser] + # # @param challenge_metadata [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata, nil] + # # @param challenge_orchestrated_by [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy, nil] + # # @param decision_made_by [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy, nil] + # # @param three_ri_request_type [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType, nil] + # # @param transaction [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction, nil] + # # + # def initialize( + # token:, + # account_type:, + # authentication_result:, + # card_expiry_check:, + # card_token:, + # cardholder:, + # channel:, + # created:, + # merchant:, + # message_category:, + # three_ds_requestor_challenge_indicator:, + # additional_data: nil, + # app: nil, + # authentication_request_type: nil, + # browser: nil, + # challenge_metadata: nil, + # challenge_orchestrated_by: nil, + # decision_made_by: nil, + # three_ri_request_type: nil, + # transaction: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + module AccountType + extend Lithic::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + NOT_APPLICABLE = :NOT_APPLICABLE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates the outcome of the 3DS authentication process. + module AuthenticationResult + extend Lithic::Enum + + DECLINE = :DECLINE + SUCCESS = :SUCCESS + PENDING_CHALLENGE = :PENDING_CHALLENGE + PENDING_DECISION = :PENDING_DECISION + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + module CardExpiryCheck + extend Lithic::Enum + + MATCH = :MATCH + MISMATCH = :MISMATCH + NOT_PRESENT = :NOT_PRESENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Cardholder < Lithic::BaseModel + # @!attribute address_match + # Indicates whether the shipping address and billing address provided by the + # cardholder are the same. This value - and assessment of whether the addresses + # match - is provided directly in the 3DS request and is not determined by Lithic. + # Maps to EMV 3DS field addrMatch. + # + # @return [Boolean, nil] + optional :address_match, Lithic::BooleanModel, nil?: true + + # @!attribute [r] billing_address + # Object containing data on the billing address provided during the transaction. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress, nil] + optional :billing_address, + -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress } + + # @!parse + # # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress] + # attr_writer :billing_address + + # @!attribute email + # Email address that is either provided by the cardholder or is on file with the + # merchant in a 3RI request. Maps to EMV 3DS field email. + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute name + # Name of the cardholder. Maps to EMV 3DS field cardholderName. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute phone_number_home + # Home phone number provided by the cardholder. Maps to EMV 3DS fields + # homePhone.cc and homePhone.subscriber. + # + # @return [String, nil] + optional :phone_number_home, String, nil?: true + + # @!attribute phone_number_mobile + # Mobile/cell phone number provided by the cardholder. Maps to EMV 3DS fields + # mobilePhone.cc and mobilePhone.subscriber. + # + # @return [String, nil] + optional :phone_number_mobile, String, nil?: true + + # @!attribute phone_number_work + # Work phone number provided by the cardholder. Maps to EMV 3DS fields + # workPhone.cc and workPhone.subscriber. + # + # @return [String, nil] + optional :phone_number_work, String, nil?: true + + # @!attribute [r] shipping_address + # Object containing data on the shipping address provided during the transaction. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress, nil] + optional :shipping_address, + -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress } + + # @!parse + # # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress] + # attr_writer :shipping_address + + # @!parse + # # Object containing data about the cardholder provided during the transaction. + # # + # # @param address_match [Boolean, nil] + # # @param billing_address [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress] + # # @param email [String, nil] + # # @param name [String, nil] + # # @param phone_number_home [String, nil] + # # @param phone_number_mobile [String, nil] + # # @param phone_number_work [String, nil] + # # @param shipping_address [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress] + # # + # def initialize( + # address_match: nil, + # billing_address: nil, + # email: nil, + # name: nil, + # phone_number_home: nil, + # phone_number_mobile: nil, + # phone_number_work: nil, + # shipping_address: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class BillingAddress < Lithic::BaseModel + # @!attribute address1 + # First line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address1, String, nil?: true + + # @!attribute address2 + # Second line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address2, String, nil?: true + + # @!attribute address3 + # Third line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address3, String, nil?: true + + # @!attribute city + # City of the address provided by the cardholder. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute postal_code + # Postal code (e.g., ZIP code) of the address provided by the cardholder + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!parse + # # Object containing data on the billing address provided during the transaction. + # # + # # @param address1 [String, nil] + # # @param address2 [String, nil] + # # @param address3 [String, nil] + # # @param city [String, nil] + # # @param country [String, nil] + # # @param postal_code [String, nil] + # # + # def initialize(address1: nil, address2: nil, address3: nil, city: nil, country: nil, postal_code: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class ShippingAddress < Lithic::BaseModel + # @!attribute address1 + # First line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address1, String, nil?: true + + # @!attribute address2 + # Second line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address2, String, nil?: true + + # @!attribute address3 + # Third line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address3, String, nil?: true + + # @!attribute city + # City of the address provided by the cardholder. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute postal_code + # Postal code (e.g., ZIP code) of the address provided by the cardholder + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!parse + # # Object containing data on the shipping address provided during the transaction. + # # + # # @param address1 [String, nil] + # # @param address2 [String, nil] + # # @param address3 [String, nil] + # # @param city [String, nil] + # # @param country [String, nil] + # # @param postal_code [String, nil] + # # + # def initialize(address1: nil, address2: nil, address3: nil, city: nil, country: nil, postal_code: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + # Channel in which the authentication occurs. Maps to EMV 3DS field deviceChannel. + module Channel + extend Lithic::Enum + + APP_BASED = :APP_BASED + BROWSER = :BROWSER + THREE_DS_REQUESTOR_INITIATED = :THREE_DS_REQUESTOR_INITIATED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Merchant < Lithic::BaseModel + # @!attribute id + # Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field + # acquirerMerchantId. + # + # @return [String] + required :id, String + + # @!attribute country + # Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS + # field merchantCountryCode. + # + # @return [String] + required :country, String + + # @!attribute mcc + # Merchant category code assigned to the merchant that describes its business + # activity type. Maps to EMV 3DS field mcc. + # + # @return [String] + required :mcc, String + + # @!attribute name + # Name of the merchant. Maps to EMV 3DS field merchantName. + # + # @return [String] + required :name, String + + # @!attribute risk_indicator + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator] + required :risk_indicator, + -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator } + + # @!parse + # # Object containing data about the merchant involved in the e-commerce + # # transaction. + # # + # # @param id [String] + # # @param country [String] + # # @param mcc [String] + # # @param name [String] + # # @param risk_indicator [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator] + # # + # def initialize(id:, country:, mcc:, name:, risk_indicator:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class RiskIndicator < Lithic::BaseModel + # @!attribute delivery_email_address + # In transactions with electronic delivery, email address to which merchandise is + # delivered. Maps to EMV 3DS field deliveryEmailAddress. + # + # @return [String, nil] + optional :delivery_email_address, String, nil?: true + + # @!attribute delivery_time_frame + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # deliveryTimeframe. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame, nil] + optional :delivery_time_frame, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame }, + nil?: true + + # @!attribute gift_card_amount + # In prepaid or gift card purchase transactions, purchase amount total in major + # units (e.g., a purchase of USD $205.10 would be 205). Maps to EMV 3DS field + # giftCardAmount. + # + # @return [Integer, nil] + optional :gift_card_amount, Integer, nil?: true + + # @!attribute gift_card_count + # In prepaid or gift card purchase transactions, count of individual prepaid or + # gift cards/codes purchased. Maps to EMV 3DS field giftCardCount. + # + # @return [Integer, nil] + optional :gift_card_count, Integer, nil?: true + + # @!attribute gift_card_currency + # In prepaid or gift card purchase transactions, currency code of the gift card. + # Maps to EMV 3DS field giftCardCurr. + # + # @return [String, nil] + optional :gift_card_currency, String, nil?: true + + # @!attribute order_availability + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field preOrderPurchaseInd. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability, nil] + optional :order_availability, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability }, + nil?: true + + # @!attribute pre_order_available_date + # In pre-order purchase transactions, the expected date that the merchandise will + # be available. Maps to EMV 3DS field preOrderDate. + # + # @return [Time, nil] + optional :pre_order_available_date, Time, nil?: true + + # @!attribute reorder_items + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field reorderItemsInd. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems, nil] + optional :reorder_items, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems }, + nil?: true + + # @!attribute shipping_method + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field shipIndicator. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod, nil] + optional :shipping_method, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod }, + nil?: true + + # @!parse + # # Object containing additional data indicating additional risk factors related to + # # the e-commerce transaction. + # # + # # @param delivery_email_address [String, nil] + # # @param delivery_time_frame [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame, nil] + # # @param gift_card_amount [Integer, nil] + # # @param gift_card_count [Integer, nil] + # # @param gift_card_currency [String, nil] + # # @param order_availability [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability, nil] + # # @param pre_order_available_date [Time, nil] + # # @param reorder_items [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems, nil] + # # @param shipping_method [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod, nil] + # # + # def initialize( + # delivery_email_address: nil, + # delivery_time_frame: nil, + # gift_card_amount: nil, + # gift_card_count: nil, + # gift_card_currency: nil, + # order_availability: nil, + # pre_order_available_date: nil, + # reorder_items: nil, + # shipping_method: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # deliveryTimeframe. + module DeliveryTimeFrame + extend Lithic::Enum + + ELECTRONIC_DELIVERY = :ELECTRONIC_DELIVERY + OVERNIGHT_SHIPPING = :OVERNIGHT_SHIPPING + SAME_DAY_SHIPPING = :SAME_DAY_SHIPPING + TWO_DAY_OR_MORE_SHIPPING = :TWO_DAY_OR_MORE_SHIPPING + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field preOrderPurchaseInd. + module OrderAvailability + extend Lithic::Enum + + FUTURE_AVAILABILITY = :FUTURE_AVAILABILITY + MERCHANDISE_AVAILABLE = :MERCHANDISE_AVAILABLE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field reorderItemsInd. + module ReorderItems + extend Lithic::Enum + + FIRST_TIME_ORDERED = :FIRST_TIME_ORDERED + REORDERED = :REORDERED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field shipIndicator. + module ShippingMethod + extend Lithic::Enum + + DIGITAL_GOODS = :DIGITAL_GOODS + LOCKER_DELIVERY = :LOCKER_DELIVERY + OTHER = :OTHER + PICK_UP_AND_GO_DELIVERY = :PICK_UP_AND_GO_DELIVERY + SHIP_TO_BILLING_ADDRESS = :SHIP_TO_BILLING_ADDRESS + SHIP_TO_NON_BILLING_ADDRESS = :SHIP_TO_NON_BILLING_ADDRESS + SHIP_TO_OTHER_VERIFIED_ADDRESS = :SHIP_TO_OTHER_VERIFIED_ADDRESS + SHIP_TO_STORE = :SHIP_TO_STORE + TRAVEL_AND_EVENT_TICKETS = :TRAVEL_AND_EVENT_TICKETS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + module MessageCategory + extend Lithic::Enum + + NON_PAYMENT_AUTHENTICATION = :NON_PAYMENT_AUTHENTICATION + PAYMENT_AUTHENTICATION = :PAYMENT_AUTHENTICATION + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + module ThreeDSRequestorChallengeIndicator + extend Lithic::Enum + + NO_PREFERENCE = :NO_PREFERENCE + NO_CHALLENGE_REQUESTED = :NO_CHALLENGE_REQUESTED + CHALLENGE_PREFERENCE = :CHALLENGE_PREFERENCE + CHALLENGE_MANDATE = :CHALLENGE_MANDATE + NO_CHALLENGE_RISK_ALREADY_ASSESSED = :NO_CHALLENGE_RISK_ALREADY_ASSESSED + DATA_SHARE_ONLY = :DATA_SHARE_ONLY + OTHER = :OTHER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class AdditionalData < Lithic::BaseModel + # @!attribute network_decision + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision, nil] + optional :network_decision, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision }, + nil?: true + + # @!attribute network_risk_score + # Mastercard only: Assessment by the network of the authentication risk level, + # with a higher value indicating a higher amount of risk. + # + # @return [Integer, nil] + optional :network_risk_score, Integer, nil?: true + + # @!parse + # # Object containing additional data about the 3DS request that is beyond the EMV + # # 3DS standard spec (e.g., specific fields that only certain card networks send + # # but are not required across all 3DS requests). + # # + # # @param network_decision [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision, nil] + # # @param network_risk_score [Integer, nil] + # # + # def initialize(network_decision: nil, network_risk_score: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + module NetworkDecision + extend Lithic::Enum + + LOW_RISK = :LOW_RISK + NOT_LOW_RISK = :NOT_LOW_RISK + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + class App < Lithic::BaseModel + # @!attribute device_info + # Device information gathered from the cardholder's device - JSON name/value pairs + # that is Base64url encoded. Maps to EMV 3DS field deviceInfo. + # + # @return [String, nil] + optional :device_info, String, nil?: true + + # @!attribute [r] ip + # External IP address used by the app generating the 3DS authentication request. + # Maps to EMV 3DS field appIp. + # + # @return [String, nil] + optional :ip, String + + # @!parse + # # @return [String] + # attr_writer :ip + + # @!parse + # # Object containing data about the app used in the e-commerce transaction. Present + # # if the channel is 'APP_BASED'. + # # + # # @param device_info [String, nil] + # # @param ip [String] + # # + # def initialize(device_info: nil, ip: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # threeDSRequestorAuthenticationInd. + module AuthenticationRequestType + extend Lithic::Enum + + ADD_CARD = :ADD_CARD + BILLING_AGREEMENT = :BILLING_AGREEMENT + DELAYED_SHIPMENT = :DELAYED_SHIPMENT + EMV_TOKEN_CARDHOLDER_VERIFICATION = :EMV_TOKEN_CARDHOLDER_VERIFICATION + INSTALLMENT_TRANSACTION = :INSTALLMENT_TRANSACTION + MAINTAIN_CARD = :MAINTAIN_CARD + PAYMENT_TRANSACTION = :PAYMENT_TRANSACTION + RECURRING_TRANSACTION = :RECURRING_TRANSACTION + SPLIT_PAYMENT = :SPLIT_PAYMENT + SPLIT_SHIPMENT = :SPLIT_SHIPMENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Browser < Lithic::BaseModel + # @!attribute ip + # IP address of the browser as returned by the HTTP headers to the 3DS requestor + # (e.g., merchant or digital wallet). Maps to EMV 3DS field browserIP. + # + # @return [String, nil] + optional :ip, String, nil?: true + + # @!attribute java_enabled + # Indicates whether the cardholder's browser has the ability to execute Java. Maps + # to EMV 3DS field browserJavaEnabled. + # + # @return [Boolean, nil] + optional :java_enabled, Lithic::BooleanModel, nil?: true + + # @!attribute javascript_enabled + # Indicates whether the cardholder's browser has the ability to execute + # JavaScript. Maps to EMV 3DS field browserJavascriptEnabled. + # + # @return [Boolean, nil] + optional :javascript_enabled, Lithic::BooleanModel, nil?: true + + # @!attribute language + # Language of the cardholder's browser as defined in IETF BCP47. Maps to EMV 3DS + # field browserLanguage. + # + # @return [String, nil] + optional :language, String, nil?: true + + # @!attribute time_zone + # Time zone of the cardholder's browser offset in minutes between UTC and the + # cardholder browser's local time. The offset is positive if the local time is + # behind UTC and negative if it is ahead. Maps to EMV 3DS field browserTz. + # + # @return [String, nil] + optional :time_zone, String, nil?: true + + # @!attribute user_agent + # Content of the HTTP user-agent header. Maps to EMV 3DS field browserUserAgent. + # + # @return [String, nil] + optional :user_agent, String, nil?: true + + # @!parse + # # Object containing data about the browser used in the e-commerce transaction. + # # Present if the channel is 'BROWSER'. + # # + # # @param ip [String, nil] + # # @param java_enabled [Boolean, nil] + # # @param javascript_enabled [Boolean, nil] + # # @param language [String, nil] + # # @param time_zone [String, nil] + # # @param user_agent [String, nil] + # # + # def initialize(ip: nil, java_enabled: nil, javascript_enabled: nil, language: nil, time_zone: nil, user_agent: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class ChallengeMetadata < Lithic::BaseModel + # @!attribute method_type + # The type of challenge method used for authentication. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType] + required :method_type, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType } + + # @!attribute phone_number + # The phone number used for delivering the OTP. Relevant only for SMS_OTP method. + # + # @return [String, nil] + optional :phone_number, String, nil?: true + + # @!parse + # # Metadata about the challenge method and delivery. + # # + # # @param method_type [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType] + # # @param phone_number [String, nil] + # # + # def initialize(method_type:, phone_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The type of challenge method used for authentication. + module MethodType + extend Lithic::Enum + + SMS_OTP = :SMS_OTP + OUT_OF_BAND = :OUT_OF_BAND + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # Entity that orchestrates the challenge. + module ChallengeOrchestratedBy + extend Lithic::Enum + + LITHIC = :LITHIC + CUSTOMER = :CUSTOMER + NO_CHALLENGE = :NO_CHALLENGE + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Entity that made the authentication decision. + module DecisionMadeBy + extend Lithic::Enum + + CUSTOMER_ENDPOINT = :CUSTOMER_ENDPOINT + LITHIC_DEFAULT = :LITHIC_DEFAULT + LITHIC_RULES = :LITHIC_RULES + NETWORK = :NETWORK + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field threeRIInd. + module ThreeRiRequestType + extend Lithic::Enum + + ACCOUNT_VERIFICATION = :ACCOUNT_VERIFICATION + ADD_CARD = :ADD_CARD + BILLING_AGREEMENT = :BILLING_AGREEMENT + CARD_SECURITY_CODE_STATUS_CHECK = :CARD_SECURITY_CODE_STATUS_CHECK + DELAYED_SHIPMENT = :DELAYED_SHIPMENT + DEVICE_BINDING_STATUS_CHECK = :DEVICE_BINDING_STATUS_CHECK + INSTALLMENT_TRANSACTION = :INSTALLMENT_TRANSACTION + MAIL_ORDER = :MAIL_ORDER + MAINTAIN_CARD_INFO = :MAINTAIN_CARD_INFO + OTHER_PAYMENT = :OTHER_PAYMENT + RECURRING_TRANSACTION = :RECURRING_TRANSACTION + SPLIT_PAYMENT = :SPLIT_PAYMENT + SPLIT_SHIPMENT = :SPLIT_SHIPMENT + TELEPHONE_ORDER = :TELEPHONE_ORDER + TOP_UP = :TOP_UP + TRUST_LIST_STATUS_CHECK = :TRUST_LIST_STATUS_CHECK + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Transaction < Lithic::BaseModel + # @!attribute amount + # Amount of the purchase in minor units of currency with all punctuation removed. + # Maps to EMV 3DS field purchaseAmount. + # + # @return [Float] + required :amount, Float + + # @!attribute currency + # Currency of the purchase. Maps to EMV 3DS field purchaseCurrency. + # + # @return [String] + required :currency, String + + # @!attribute currency_exponent + # Minor units of currency, as specified in ISO 4217 currency exponent. Maps to EMV + # 3DS field purchaseExponent. + # + # @return [Float] + required :currency_exponent, Float + + # @!attribute date_time + # Date and time when the authentication was generated by the merchant/acquirer's + # 3DS server. Maps to EMV 3DS field purchaseDate. + # + # @return [Time] + required :date_time, Time + + # @!attribute type + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field transType. + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type, nil] + required :type, + enum: -> { Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type }, + nil?: true + + # @!parse + # # Object containing data about the e-commerce transaction for which the merchant + # # is requesting authentication. + # # + # # @param amount [Float] + # # @param currency [String] + # # @param currency_exponent [Float] + # # @param date_time [Time] + # # @param type [Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type, nil] + # # + # def initialize(amount:, currency:, currency_exponent:, date_time:, type:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field transType. + module Type + extend Lithic::Enum + + ACCOUNT_FUNDING = :ACCOUNT_FUNDING + CHECK_ACCEPTANCE = :CHECK_ACCEPTANCE + GOODS_SERVICE_PURCHASE = :GOODS_SERVICE_PURCHASE + PREPAID_ACTIVATION_AND_LOAD = :PREPAID_ACTIVATION_AND_LOAD + QUASI_CASH_TRANSACTION = :QUASI_CASH_TRANSACTION + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rb b/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rb new file mode 100644 index 00000000..851ca228 --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateOtpEntryParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute token + # A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + # + # @return [String] + required :token, String + + # @!attribute otp + # The OTP entered by the cardholder + # + # @return [String] + required :otp, String + + # @!parse + # # @param token [String] + # # @param otp [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(token:, otp:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_simulate_params.rb b/lib/lithic/models/three_ds/authentication_simulate_params.rb new file mode 100644 index 00000000..1945df38 --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_simulate_params.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute merchant + # + # @return [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] + required :merchant, -> { Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant } + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute transaction + # + # @return [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] + required :transaction, -> { Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction } + + # @!attribute [r] card_expiry_check + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck, nil] + optional :card_expiry_check, + enum: -> { Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck } + + # @!parse + # # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck] + # attr_writer :card_expiry_check + + # @!parse + # # @param merchant [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] + # # @param pan [String] + # # @param transaction [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] + # # @param card_expiry_check [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(merchant:, pan:, transaction:, card_expiry_check: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Merchant < Lithic::BaseModel + # @!attribute id + # Unique identifier to identify the payment card acceptor. Corresponds to + # `merchant_acceptor_id` in authorization. + # + # @return [String] + required :id, String + + # @!attribute country + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + # + # @return [String] + required :country, String + + # @!attribute mcc + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @return [String] + required :mcc, String + + # @!attribute name + # Merchant descriptor, corresponds to `descriptor` in authorization. If CHALLENGE + # keyword is included, Lithic will trigger a challenge. + # + # @return [String] + required :name, String + + # @!parse + # # @param id [String] + # # @param country [String] + # # @param mcc [String] + # # @param name [String] + # # + # def initialize(id:, country:, mcc:, name:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Transaction < Lithic::BaseModel + # @!attribute amount + # Amount (in cents) to authenticate. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency code. + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param currency [String] + # # + # def initialize(amount:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + module CardExpiryCheck + extend Lithic::Enum + + MATCH = :MATCH + MISMATCH = :MISMATCH + NOT_PRESENT = :NOT_PRESENT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_simulate_response.rb b/lib/lithic/models/three_ds/authentication_simulate_response.rb new file mode 100644 index 00000000..82c06038 --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_simulate_response.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateResponse < Lithic::BaseModel + # @!attribute [r] token + # A unique token to reference this transaction with later calls to void or clear + # the authorization. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!parse + # # @param token [String] + # # + # def initialize(token: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/three_ds/challenge_response.rb b/lib/lithic/models/three_ds/challenge_response.rb new file mode 100644 index 00000000..d10075cb --- /dev/null +++ b/lib/lithic/models/three_ds/challenge_response.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class ChallengeResponse < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for the 3DS authentication. This token is sent as + # part of the initial 3DS Decisioning Request and as part of the 3DS Challenge + # Event in the [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) + # object + # + # @return [String] + required :token, String + + # @!attribute challenge_response + # Whether the Cardholder has Approved or Declined the issued Challenge + # + # @return [Symbol, Lithic::Models::ThreeDS::ChallengeResult] + required :challenge_response, enum: -> { Lithic::Models::ThreeDS::ChallengeResult } + + # @!parse + # # @param token [String] + # # @param challenge_response [Symbol, Lithic::Models::ThreeDS::ChallengeResult] + # # + # def initialize(token:, challenge_response:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/three_ds/challenge_result.rb b/lib/lithic/models/three_ds/challenge_result.rb new file mode 100644 index 00000000..58e910e3 --- /dev/null +++ b/lib/lithic/models/three_ds/challenge_result.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # Whether the Cardholder has Approved or Declined the issued Challenge + module ChallengeResult + extend Lithic::Enum + + APPROVE = :APPROVE + DECLINE_BY_CUSTOMER = :DECLINE_BY_CUSTOMER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_challenge_response_params.rb b/lib/lithic/models/three_ds/decisioning_challenge_response_params.rb new file mode 100644 index 00000000..781fd904 --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_challenge_response_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class DecisioningChallengeResponseParams < Lithic::Models::ThreeDS::ChallengeResponse + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rb b/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rb new file mode 100644 index 00000000..235ee480 --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class DecisioningRetrieveSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rb b/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rb new file mode 100644 index 00000000..f989c98f --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class DecisioningRetrieveSecretResponse < Lithic::BaseModel + # @!attribute [r] secret + # The 3DS Decisioning HMAC secret + # + # @return [String, nil] + optional :secret, String + + # @!parse + # # @return [String] + # attr_writer :secret + + # @!parse + # # @param secret [String] + # # + # def initialize(secret: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rb b/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rb new file mode 100644 index 00000000..b97f0bc9 --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class DecisioningRotateSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/tokenization.rb b/lib/lithic/models/tokenization.rb new file mode 100644 index 00000000..f840e798 --- /dev/null +++ b/lib/lithic/models/tokenization.rb @@ -0,0 +1,282 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Tokenization < Lithic::BaseModel + # @!attribute token + # Globally unique identifier for a Tokenization + # + # @return [String] + required :token, String + + # @!attribute account_token + # The account token associated with the card being tokenized. + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # The card token associated with the card being tokenized. + # + # @return [String] + required :card_token, String + + # @!attribute created_at + # Date and time when the tokenization first occurred. UTC time zone. + # + # @return [Time] + required :created_at, Time + + # @!attribute dpan + # The dynamic pan assigned to the token by the network. + # + # @return [String, nil] + required :dpan, String, nil?: true + + # @!attribute status + # The status of the tokenization request + # + # @return [Symbol, Lithic::Models::Tokenization::Status] + required :status, enum: -> { Lithic::Models::Tokenization::Status } + + # @!attribute token_requestor_name + # The entity that requested the tokenization. Represents a Digital Wallet or + # merchant. + # + # @return [Symbol, Lithic::Models::Tokenization::TokenRequestorName] + required :token_requestor_name, enum: -> { Lithic::Models::Tokenization::TokenRequestorName } + + # @!attribute token_unique_reference + # The network's unique reference for the tokenization. + # + # @return [String] + required :token_unique_reference, String + + # @!attribute tokenization_channel + # The channel through which the tokenization was made. + # + # @return [Symbol, Lithic::Models::Tokenization::TokenizationChannel] + required :tokenization_channel, enum: -> { Lithic::Models::Tokenization::TokenizationChannel } + + # @!attribute updated_at + # Latest date and time when the tokenization was updated. UTC time zone. + # + # @return [Time] + required :updated_at, Time + + # @!attribute [r] digital_card_art_token + # Specifies the digital card art displayed in the user’s digital wallet after + # tokenization. This will be null if the tokenization was created without an + # associated digital card art. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!parse + # # @return [String] + # attr_writer :digital_card_art_token + + # @!attribute [r] events + # A list of events related to the tokenization. + # + # @return [Array, nil] + optional :events, -> { Lithic::ArrayOf[Lithic::Models::Tokenization::Event] } + + # @!parse + # # @return [Array] + # attr_writer :events + + # @!attribute payment_account_reference_id + # The network's unique reference for the card that is tokenized. + # + # @return [String, nil] + optional :payment_account_reference_id, String, nil?: true + + # @!parse + # # @param token [String] + # # @param account_token [String] + # # @param card_token [String] + # # @param created_at [Time] + # # @param dpan [String, nil] + # # @param status [Symbol, Lithic::Models::Tokenization::Status] + # # @param token_requestor_name [Symbol, Lithic::Models::Tokenization::TokenRequestorName] + # # @param token_unique_reference [String] + # # @param tokenization_channel [Symbol, Lithic::Models::Tokenization::TokenizationChannel] + # # @param updated_at [Time] + # # @param digital_card_art_token [String] + # # @param events [Array] + # # @param payment_account_reference_id [String, nil] + # # + # def initialize( + # token:, + # account_token:, + # card_token:, + # created_at:, + # dpan:, + # status:, + # token_requestor_name:, + # token_unique_reference:, + # tokenization_channel:, + # updated_at:, + # digital_card_art_token: nil, + # events: nil, + # payment_account_reference_id: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The status of the tokenization request + module Status + extend Lithic::Enum + + ACTIVE = :ACTIVE + DEACTIVATED = :DEACTIVATED + INACTIVE = :INACTIVE + PAUSED = :PAUSED + PENDING_2_FA = :PENDING_2FA + PENDING_ACTIVATION = :PENDING_ACTIVATION + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The entity that requested the tokenization. Represents a Digital Wallet or + # merchant. + module TokenRequestorName + extend Lithic::Enum + + AMAZON_ONE = :AMAZON_ONE + ANDROID_PAY = :ANDROID_PAY + APPLE_PAY = :APPLE_PAY + FACEBOOK = :FACEBOOK + FITBIT_PAY = :FITBIT_PAY + GARMIN_PAY = :GARMIN_PAY + MICROSOFT_PAY = :MICROSOFT_PAY + NETFLIX = :NETFLIX + SAMSUNG_PAY = :SAMSUNG_PAY + UNKNOWN = :UNKNOWN + VISA_CHECKOUT = :VISA_CHECKOUT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Event < Lithic::BaseModel + # @!attribute [r] token + # Globally unique identifier for a Tokenization Event + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] created_at + # Date and time when the tokenization event first occurred. UTC time zone. + # + # @return [Time, nil] + optional :created_at, Time + + # @!parse + # # @return [Time] + # attr_writer :created_at + + # @!attribute [r] result + # Enum representing the result of the tokenization event + # + # @return [Symbol, Lithic::Models::Tokenization::Event::Result, nil] + optional :result, enum: -> { Lithic::Models::Tokenization::Event::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::Tokenization::Event::Result] + # attr_writer :result + + # @!attribute [r] type + # Enum representing the type of tokenization event that occurred + # + # @return [Symbol, Lithic::Models::Tokenization::Event::Type, nil] + optional :type, enum: -> { Lithic::Models::Tokenization::Event::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::Tokenization::Event::Type] + # attr_writer :type + + # @!parse + # # @param token [String] + # # @param created_at [Time] + # # @param result [Symbol, Lithic::Models::Tokenization::Event::Result] + # # @param type [Symbol, Lithic::Models::Tokenization::Event::Type] + # # + # def initialize(token: nil, created_at: nil, result: nil, type: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Enum representing the result of the tokenization event + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + NOTIFICATION_DELIVERED = :NOTIFICATION_DELIVERED + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + TOKEN_ACTIVATED = :TOKEN_ACTIVATED + TOKEN_CREATED = :TOKEN_CREATED + TOKEN_DEACTIVATED = :TOKEN_DEACTIVATED + TOKEN_INACTIVE = :TOKEN_INACTIVE + TOKEN_STATE_UNKNOWN = :TOKEN_STATE_UNKNOWN + TOKEN_SUSPENDED = :TOKEN_SUSPENDED + TOKEN_UPDATED = :TOKEN_UPDATED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Enum representing the type of tokenization event that occurred + module Type + extend Lithic::Enum + + TOKENIZATION_2_FA = :TOKENIZATION_2FA + TOKENIZATION_AUTHORIZATION = :TOKENIZATION_AUTHORIZATION + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + TOKENIZATION_ELIGIBILITY_CHECK = :TOKENIZATION_ELIGIBILITY_CHECK + TOKENIZATION_UPDATED = :TOKENIZATION_UPDATED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_activate_params.rb b/lib/lithic/models/tokenization_activate_params.rb new file mode 100644 index 00000000..12ae6107 --- /dev/null +++ b/lib/lithic/models/tokenization_activate_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationActivateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_deactivate_params.rb b/lib/lithic/models/tokenization_deactivate_params.rb new file mode 100644 index 00000000..d5dc3ce3 --- /dev/null +++ b/lib/lithic/models/tokenization_deactivate_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationDeactivateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rb b/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rb new file mode 100644 index 00000000..6440b380 --- /dev/null +++ b/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationDecisioningRetrieveSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rb b/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rb new file mode 100644 index 00000000..631177a0 --- /dev/null +++ b/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationDecisioningRotateSecretParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rb b/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rb new file mode 100644 index 00000000..5695ec0c --- /dev/null +++ b/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationDecisioningRotateSecretResponse < Lithic::BaseModel + # @!attribute [r] secret + # The new Tokenization Decisioning HMAC secret + # + # @return [String, nil] + optional :secret, String + + # @!parse + # # @return [String] + # attr_writer :secret + + # @!parse + # # @param secret [String] + # # + # def initialize(secret: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_list_params.rb b/lib/lithic/models/tokenization_list_params.rb new file mode 100644 index 00000000..69cb9a2b --- /dev/null +++ b/lib/lithic/models/tokenization_list_params.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # Filters for tokenizations associated with a specific account. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] begin_ + # Filter for tokenizations created after this date. + # + # @return [Date, nil] + optional :begin_, Date, api_name: :begin + + # @!parse + # # @return [Date] + # attr_writer :begin_ + + # @!attribute [r] card_token + # Filters for tokenizations associated with a specific card. + # + # @return [String, nil] + optional :card_token, String + + # @!parse + # # @return [String] + # attr_writer :card_token + + # @!attribute [r] end_ + # Filter for tokenizations created before this date. + # + # @return [Date, nil] + optional :end_, Date, api_name: :end + + # @!parse + # # @return [Date] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] tokenization_channel + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + # + # @return [Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel, nil] + optional :tokenization_channel, enum: -> { Lithic::Models::TokenizationListParams::TokenizationChannel } + + # @!parse + # # @return [Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel] + # attr_writer :tokenization_channel + + # @!parse + # # @param account_token [String] + # # @param begin_ [Date] + # # @param card_token [String] + # # @param end_ [Date] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param starting_after [String] + # # @param tokenization_channel [Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # begin_: nil, + # card_token: nil, + # end_: nil, + # ending_before: nil, + # page_size: nil, + # starting_after: nil, + # tokenization_channel: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + module TokenizationChannel + extend Lithic::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + ALL = :ALL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/tokenization_pause_params.rb b/lib/lithic/models/tokenization_pause_params.rb new file mode 100644 index 00000000..c72ee213 --- /dev/null +++ b/lib/lithic/models/tokenization_pause_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationPauseParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_resend_activation_code_params.rb b/lib/lithic/models/tokenization_resend_activation_code_params.rb new file mode 100644 index 00000000..160ca746 --- /dev/null +++ b/lib/lithic/models/tokenization_resend_activation_code_params.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationResendActivationCodeParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] activation_method_type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType, nil] + optional :activation_method_type, + enum: -> { Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType } + + # @!parse + # # @return [Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType] + # attr_writer :activation_method_type + + # @!parse + # # @param activation_method_type [Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(activation_method_type: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module ActivationMethodType + extend Lithic::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/tokenization_retrieve_params.rb b/lib/lithic/models/tokenization_retrieve_params.rb new file mode 100644 index 00000000..13d9ba8a --- /dev/null +++ b/lib/lithic/models/tokenization_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_retrieve_response.rb b/lib/lithic/models/tokenization_retrieve_response.rb new file mode 100644 index 00000000..051c216e --- /dev/null +++ b/lib/lithic/models/tokenization_retrieve_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationRetrieveResponse < Lithic::BaseModel + # @!attribute [r] data + # + # @return [Lithic::Models::Tokenization, nil] + optional :data, -> { Lithic::Models::Tokenization } + + # @!parse + # # @return [Lithic::Models::Tokenization] + # attr_writer :data + + # @!parse + # # @param data [Lithic::Models::Tokenization] + # # + # def initialize(data: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_secret.rb b/lib/lithic/models/tokenization_secret.rb new file mode 100644 index 00000000..0ff99762 --- /dev/null +++ b/lib/lithic/models/tokenization_secret.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationSecret < Lithic::BaseModel + # @!attribute [r] secret + # The Tokenization Decisioning HMAC secret + # + # @return [String, nil] + optional :secret, String + + # @!parse + # # @return [String] + # attr_writer :secret + + # @!parse + # # @param secret [String] + # # + # def initialize(secret: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_simulate_params.rb b/lib/lithic/models/tokenization_simulate_params.rb new file mode 100644 index 00000000..79345640 --- /dev/null +++ b/lib/lithic/models/tokenization_simulate_params.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationSimulateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute cvv + # The three digit cvv for the card. + # + # @return [String] + required :cvv, String + + # @!attribute expiration_date + # The expiration date of the card in 'MM/YY' format. + # + # @return [String] + required :expiration_date, String + + # @!attribute pan + # The sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute tokenization_source + # The source of the tokenization request. + # + # @return [Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource] + required :tokenization_source, enum: -> { Lithic::Models::TokenizationSimulateParams::TokenizationSource } + + # @!attribute [r] account_score + # The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + # + # @return [Integer, nil] + optional :account_score, Integer + + # @!parse + # # @return [Integer] + # attr_writer :account_score + + # @!attribute [r] device_score + # The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + # + # @return [Integer, nil] + optional :device_score, Integer + + # @!parse + # # @return [Integer] + # attr_writer :device_score + + # @!attribute [r] entity + # Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + # + # @return [String, nil] + optional :entity, String + + # @!parse + # # @return [String] + # attr_writer :entity + + # @!attribute [r] wallet_recommended_decision + # The decision that the Digital Wallet's recommend + # + # @return [Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision, nil] + optional :wallet_recommended_decision, + enum: -> { Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision } + + # @!parse + # # @return [Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision] + # attr_writer :wallet_recommended_decision + + # @!parse + # # @param cvv [String] + # # @param expiration_date [String] + # # @param pan [String] + # # @param tokenization_source [Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource] + # # @param account_score [Integer] + # # @param device_score [Integer] + # # @param entity [String] + # # @param wallet_recommended_decision [Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # cvv:, + # expiration_date:, + # pan:, + # tokenization_source:, + # account_score: nil, + # device_score: nil, + # entity: nil, + # wallet_recommended_decision: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The source of the tokenization request. + module TokenizationSource + extend Lithic::Enum + + APPLE_PAY = :APPLE_PAY + GOOGLE = :GOOGLE + SAMSUNG_PAY = :SAMSUNG_PAY + MERCHANT = :MERCHANT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # The decision that the Digital Wallet's recommend + module WalletRecommendedDecision + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/tokenization_simulate_response.rb b/lib/lithic/models/tokenization_simulate_response.rb new file mode 100644 index 00000000..f39d62ce --- /dev/null +++ b/lib/lithic/models/tokenization_simulate_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationSimulateResponse < Lithic::BaseModel + # @!attribute [r] data + # + # @return [Array, nil] + optional :data, -> { Lithic::ArrayOf[Lithic::Models::Tokenization] } + + # @!parse + # # @return [Array] + # attr_writer :data + + # @!parse + # # @param data [Array] + # # + # def initialize(data: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_unpause_params.rb b/lib/lithic/models/tokenization_unpause_params.rb new file mode 100644 index 00000000..94063957 --- /dev/null +++ b/lib/lithic/models/tokenization_unpause_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationUnpauseParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_update_digital_card_art_params.rb b/lib/lithic/models/tokenization_update_digital_card_art_params.rb new file mode 100644 index 00000000..c61fdf60 --- /dev/null +++ b/lib/lithic/models/tokenization_update_digital_card_art_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationUpdateDigitalCardArtParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] digital_card_art_token + # Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!parse + # # @return [String] + # attr_writer :digital_card_art_token + + # @!parse + # # @param digital_card_art_token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(digital_card_art_token: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/tokenization_update_digital_card_art_response.rb b/lib/lithic/models/tokenization_update_digital_card_art_response.rb new file mode 100644 index 00000000..f430b899 --- /dev/null +++ b/lib/lithic/models/tokenization_update_digital_card_art_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationUpdateDigitalCardArtResponse < Lithic::BaseModel + # @!attribute [r] data + # + # @return [Lithic::Models::Tokenization, nil] + optional :data, -> { Lithic::Models::Tokenization } + + # @!parse + # # @return [Lithic::Models::Tokenization] + # attr_writer :data + + # @!parse + # # @param data [Lithic::Models::Tokenization] + # # + # def initialize(data: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction.rb b/lib/lithic/models/transaction.rb new file mode 100644 index 00000000..05ef13bb --- /dev/null +++ b/lib/lithic/models/transaction.rb @@ -0,0 +1,1613 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Transaction < Lithic::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute account_token + # The token for the account associated with this transaction. + # + # @return [String] + required :account_token, String + + # @!attribute acquirer_fee + # Fee assessed by the merchant and paid for by the cardholder in the smallest unit + # of the currency. Will be zero if no fee is assessed. Rebates may be transmitted + # as a negative value to indicate credited fees. + # + # @return [Integer, nil] + required :acquirer_fee, Integer, nil?: true + + # @!attribute acquirer_reference_number + # Unique identifier assigned to a transaction by the acquirer that can be used in + # dispute and chargeback filing. + # + # @return [String, nil] + required :acquirer_reference_number, String, nil?: true + + # @!attribute amount + # When the transaction is pending, this represents the authorization amount of the + # transaction in the anticipated settlement currency. Once the transaction has + # settled, this field represents the settled amount in the settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute amounts + # + # @return [Lithic::Models::Transaction::Amounts] + required :amounts, -> { Lithic::Models::Transaction::Amounts } + + # @!attribute authorization_amount + # The authorization amount of the transaction in the anticipated settlement + # currency. + # + # @return [Integer, nil] + required :authorization_amount, Integer, nil?: true + + # @!attribute authorization_code + # A fixed-width 6-digit numeric identifier that can be used to identify a + # transaction with networks. + # + # @return [String, nil] + required :authorization_code, String, nil?: true + + # @!attribute avs + # + # @return [Lithic::Models::Transaction::Avs, nil] + required :avs, -> { Lithic::Models::Transaction::Avs }, nil?: true + + # @!attribute card_token + # Token for the card used in this transaction. + # + # @return [String] + required :card_token, String + + # @!attribute cardholder_authentication + # + # @return [Lithic::Models::Transaction::CardholderAuthentication, nil] + required :cardholder_authentication, + -> { Lithic::Models::Transaction::CardholderAuthentication }, + nil?: true + + # @!attribute created + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute merchant + # + # @return [Lithic::Models::Transaction::Merchant] + required :merchant, -> { Lithic::Models::Transaction::Merchant } + + # @!attribute merchant_amount + # Analogous to the 'amount', but in the merchant currency. + # + # @return [Integer, nil] + required :merchant_amount, Integer, nil?: true + + # @!attribute merchant_authorization_amount + # Analogous to the 'authorization_amount', but in the merchant currency. + # + # @return [Integer, nil] + required :merchant_authorization_amount, Integer, nil?: true + + # @!attribute merchant_currency + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + # + # @return [String] + required :merchant_currency, String + + # @!attribute network + # Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, + # `VISA`, or `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the + # network code from the upstream provider. + # + # @return [Symbol, Lithic::Models::Transaction::Network, nil] + required :network, enum: -> { Lithic::Models::Transaction::Network }, nil?: true + + # @!attribute network_risk_score + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + # + # @return [Integer, nil] + required :network_risk_score, Integer, nil?: true + + # @!attribute pos + # + # @return [Lithic::Models::Transaction::Pos] + required :pos, -> { Lithic::Models::Transaction::Pos } + + # @!attribute result + # + # @return [Symbol, Lithic::Models::Transaction::Result] + required :result, enum: -> { Lithic::Models::Transaction::Result } + + # @!attribute settled_amount + # The settled amount of the transaction in the settlement currency. + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # Status of the transaction. + # + # @return [Symbol, Lithic::Models::Transaction::Status] + required :status, enum: -> { Lithic::Models::Transaction::Status } + + # @!attribute token_info + # + # @return [Lithic::Models::Transaction::TokenInfo, nil] + required :token_info, -> { Lithic::Models::Transaction::TokenInfo }, nil?: true + + # @!attribute updated + # Date and time when the transaction last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute [r] events + # + # @return [Array, nil] + optional :events, -> { Lithic::ArrayOf[Lithic::Models::Transaction::Event] } + + # @!parse + # # @return [Array] + # attr_writer :events + + # @!parse + # # @param token [String] + # # @param account_token [String] + # # @param acquirer_fee [Integer, nil] + # # @param acquirer_reference_number [String, nil] + # # @param amount [Integer] + # # @param amounts [Lithic::Models::Transaction::Amounts] + # # @param authorization_amount [Integer, nil] + # # @param authorization_code [String, nil] + # # @param avs [Lithic::Models::Transaction::Avs, nil] + # # @param card_token [String] + # # @param cardholder_authentication [Lithic::Models::Transaction::CardholderAuthentication, nil] + # # @param created [Time] + # # @param merchant [Lithic::Models::Transaction::Merchant] + # # @param merchant_amount [Integer, nil] + # # @param merchant_authorization_amount [Integer, nil] + # # @param merchant_currency [String] + # # @param network [Symbol, Lithic::Models::Transaction::Network, nil] + # # @param network_risk_score [Integer, nil] + # # @param pos [Lithic::Models::Transaction::Pos] + # # @param result [Symbol, Lithic::Models::Transaction::Result] + # # @param settled_amount [Integer] + # # @param status [Symbol, Lithic::Models::Transaction::Status] + # # @param token_info [Lithic::Models::Transaction::TokenInfo, nil] + # # @param updated [Time] + # # @param events [Array] + # # + # def initialize( + # token:, + # account_token:, + # acquirer_fee:, + # acquirer_reference_number:, + # amount:, + # amounts:, + # authorization_amount:, + # authorization_code:, + # avs:, + # card_token:, + # cardholder_authentication:, + # created:, + # merchant:, + # merchant_amount:, + # merchant_authorization_amount:, + # merchant_currency:, + # network:, + # network_risk_score:, + # pos:, + # result:, + # settled_amount:, + # status:, + # token_info:, + # updated:, + # events: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Amounts < Lithic::BaseModel + # @!attribute cardholder + # + # @return [Lithic::Models::Transaction::Amounts::Cardholder] + required :cardholder, -> { Lithic::Models::Transaction::Amounts::Cardholder } + + # @!attribute hold + # + # @return [Lithic::Models::Transaction::Amounts::Hold] + required :hold, -> { Lithic::Models::Transaction::Amounts::Hold } + + # @!attribute merchant + # + # @return [Lithic::Models::Transaction::Amounts::Merchant] + required :merchant, -> { Lithic::Models::Transaction::Amounts::Merchant } + + # @!attribute settlement + # + # @return [Lithic::Models::Transaction::Amounts::Settlement] + required :settlement, -> { Lithic::Models::Transaction::Amounts::Settlement } + + # @!parse + # # @param cardholder [Lithic::Models::Transaction::Amounts::Cardholder] + # # @param hold [Lithic::Models::Transaction::Amounts::Hold] + # # @param merchant [Lithic::Models::Transaction::Amounts::Merchant] + # # @param settlement [Lithic::Models::Transaction::Amounts::Settlement] + # # + # def initialize(cardholder:, hold:, merchant:, settlement:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Cardholder < Lithic::BaseModel + # @!attribute amount + # The estimated settled amount of the transaction in the cardholder billing + # currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute conversion_rate + # The exchange rate used to convert the merchant amount to the cardholder billing + # amount. + # + # @return [String] + required :conversion_rate, String + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param conversion_rate [String] + # # @param currency [String] + # # + # def initialize(amount:, conversion_rate:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Hold < Lithic::BaseModel + # @!attribute amount + # The pending amount of the transaction in the anticipated settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param currency [String] + # # + # def initialize(amount:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Merchant < Lithic::BaseModel + # @!attribute amount + # The settled amount of the transaction in the merchant currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param currency [String] + # # + # def initialize(amount:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Settlement < Lithic::BaseModel + # @!attribute amount + # The settled amount of the transaction in the settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param currency [String] + # # + # def initialize(amount:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + class Avs < Lithic::BaseModel + # @!attribute address + # Cardholder address + # + # @return [String] + required :address, String + + # @!attribute zipcode + # Cardholder ZIP code + # + # @return [String] + required :zipcode, String + + # @!parse + # # @param address [String] + # # @param zipcode [String] + # # + # def initialize(address:, zipcode:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class CardholderAuthentication < Lithic::BaseModel + # @!attribute three_ds_version + # The 3DS version used for the authentication + # + # @return [String, nil] + required :three_ds_version, String, api_name: :"3ds_version", nil?: true + + # @!attribute acquirer_exemption + # Whether an acquirer exemption applied to the transaction. + # + # @return [Symbol, Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption] + required :acquirer_exemption, + enum: -> { Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption } + + # @!attribute authentication_result + # Indicates what the outcome of the 3DS authentication process is. + # + # @return [Symbol, Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult] + required :authentication_result, + enum: -> { Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult } + + # @!attribute decision_made_by + # Indicates which party made the 3DS authentication decision. + # + # @return [Symbol, Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy] + required :decision_made_by, + enum: -> { Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy } + + # @!attribute liability_shift + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # * `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D Secure flow, chargeback liability shift applies. + # + # * `ACQUIRER_EXEMPTION`: The acquirer utilised an exemption to bypass Strong Customer Authentication (`transStatus = N`, or `transStatus = I`). Liability remains with the acquirer and in this case the `acquirer_exemption` field is expected to be not `NONE`. + # + # * `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the merchant is liable. + # + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + # + # @return [Symbol, Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift] + required :liability_shift, + enum: -> { Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift } + + # @!attribute three_ds_authentication_token + # Unique identifier you can use to match a given 3DS authentication (available via + # the three_ds_authentication.created event webhook) and the transaction. Note + # that in cases where liability shift does not occur, this token is matched to the + # transaction on a best-effort basis. + # + # @return [String, nil] + required :three_ds_authentication_token, String, nil?: true + + # @!attribute verification_attempted + # Indicates whether a 3DS challenge flow was used, and if so, what the + # verification method was. (deprecated, use `authentication_result`) + # + # @return [Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted] + required :verification_attempted, + enum: -> { Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted } + + # @!attribute verification_result + # Indicates whether a transaction is considered 3DS authenticated. (deprecated, + # use `authentication_result`) + # + # @return [Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult] + required :verification_result, + enum: -> { Lithic::Models::Transaction::CardholderAuthentication::VerificationResult } + + # @!parse + # # @param three_ds_version [String, nil] + # # @param acquirer_exemption [Symbol, Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption] + # # @param authentication_result [Symbol, Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult] + # # @param decision_made_by [Symbol, Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy] + # # @param liability_shift [Symbol, Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift] + # # @param three_ds_authentication_token [String, nil] + # # @param verification_attempted [Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted] + # # @param verification_result [Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult] + # # + # def initialize( + # three_ds_version:, + # acquirer_exemption:, + # authentication_result:, + # decision_made_by:, + # liability_shift:, + # three_ds_authentication_token:, + # verification_attempted:, + # verification_result:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Whether an acquirer exemption applied to the transaction. + module AcquirerExemption + extend Lithic::Enum + + AUTHENTICATION_OUTAGE_EXCEPTION = :AUTHENTICATION_OUTAGE_EXCEPTION + LOW_VALUE = :LOW_VALUE + MERCHANT_INITIATED_TRANSACTION = :MERCHANT_INITIATED_TRANSACTION + NONE = :NONE + RECURRING_PAYMENT = :RECURRING_PAYMENT + SECURE_CORPORATE_PAYMENT = :SECURE_CORPORATE_PAYMENT + STRONG_CUSTOMER_AUTHENTICATION_DELEGATION = :STRONG_CUSTOMER_AUTHENTICATION_DELEGATION + TRANSACTION_RISK_ANALYSIS = :TRANSACTION_RISK_ANALYSIS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates what the outcome of the 3DS authentication process is. + module AuthenticationResult + extend Lithic::Enum + + ATTEMPTS = :ATTEMPTS + DECLINE = :DECLINE + NONE = :NONE + SUCCESS = :SUCCESS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates which party made the 3DS authentication decision. + module DecisionMadeBy + extend Lithic::Enum + + CUSTOMER_ENDPOINT = :CUSTOMER_ENDPOINT + LITHIC_DEFAULT = :LITHIC_DEFAULT + LITHIC_RULES = :LITHIC_RULES + NETWORK = :NETWORK + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # * `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D Secure flow, chargeback liability shift applies. + # + # * `ACQUIRER_EXEMPTION`: The acquirer utilised an exemption to bypass Strong Customer Authentication (`transStatus = N`, or `transStatus = I`). Liability remains with the acquirer and in this case the `acquirer_exemption` field is expected to be not `NONE`. + # + # * `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the merchant is liable. + # + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + module LiabilityShift + extend Lithic::Enum + + NUMBER_3DS_AUTHENTICATED = :"3DS_AUTHENTICATED" + ACQUIRER_EXEMPTION = :ACQUIRER_EXEMPTION + NONE = :NONE + TOKEN_AUTHENTICATED = :TOKEN_AUTHENTICATED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether a 3DS challenge flow was used, and if so, what the + # verification method was. (deprecated, use `authentication_result`) + module VerificationAttempted + extend Lithic::Enum + + NONE = :NONE + OTHER = :OTHER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether a transaction is considered 3DS authenticated. (deprecated, + # use `authentication_result`) + module VerificationResult + extend Lithic::Enum + + CANCELLED = :CANCELLED + FAILED = :FAILED + FRICTIONLESS = :FRICTIONLESS + NOT_ATTEMPTED = :NOT_ATTEMPTED + REJECTED = :REJECTED + SUCCESS = :SUCCESS + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + class Merchant < Lithic::BaseModel + # @!attribute acceptor_id + # Unique alphanumeric identifier for the payment card acceptor (merchant). + # + # @return [String] + required :acceptor_id, String + + # @!attribute acquiring_institution_id + # Unique numeric identifier of the acquiring institution. + # + # @return [String] + required :acquiring_institution_id, String + + # @!attribute city + # City of card acceptor. Note that in many cases, particularly in card-not-present + # transactions, merchants may send through a phone number or URL in this field. + # + # @return [String] + required :city, String + + # @!attribute country + # Country or entity of card acceptor. Possible values are: (1) all ISO 3166-1 + # alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles. + # + # @return [String] + required :country, String + + # @!attribute descriptor + # Short description of card acceptor. + # + # @return [String] + required :descriptor, String + + # @!attribute mcc + # Merchant category code (MCC). A four-digit number listed in ISO 18245. An MCC is + # used to classify a business by the types of goods or services it provides. + # + # @return [String] + required :mcc, String + + # @!attribute state + # Geographic state of card acceptor. + # + # @return [String] + required :state, String + + # @!parse + # # @param acceptor_id [String] + # # @param acquiring_institution_id [String] + # # @param city [String] + # # @param country [String] + # # @param descriptor [String] + # # @param mcc [String] + # # @param state [String] + # # + # def initialize(acceptor_id:, acquiring_institution_id:, city:, country:, descriptor:, mcc:, state:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + # Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, + # `VISA`, or `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the + # network code from the upstream provider. + module Network + extend Lithic::Enum + + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Pos < Lithic::BaseModel + # @!attribute entry_mode + # + # @return [Lithic::Models::Transaction::Pos::EntryMode] + required :entry_mode, -> { Lithic::Models::Transaction::Pos::EntryMode } + + # @!attribute terminal + # + # @return [Lithic::Models::Transaction::Pos::Terminal] + required :terminal, -> { Lithic::Models::Transaction::Pos::Terminal } + + # @!parse + # # @param entry_mode [Lithic::Models::Transaction::Pos::EntryMode] + # # @param terminal [Lithic::Models::Transaction::Pos::Terminal] + # # + # def initialize(entry_mode:, terminal:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class EntryMode < Lithic::BaseModel + # @!attribute card + # Card presence indicator + # + # @return [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Card] + required :card, enum: -> { Lithic::Models::Transaction::Pos::EntryMode::Card } + + # @!attribute cardholder + # Cardholder presence indicator + # + # @return [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Cardholder] + required :cardholder, enum: -> { Lithic::Models::Transaction::Pos::EntryMode::Cardholder } + + # @!attribute pan + # Method of entry for the PAN + # + # @return [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Pan] + required :pan, enum: -> { Lithic::Models::Transaction::Pos::EntryMode::Pan } + + # @!attribute pin_entered + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + # + # @return [Boolean] + required :pin_entered, Lithic::BooleanModel + + # @!parse + # # @param card [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Card] + # # @param cardholder [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Cardholder] + # # @param pan [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Pan] + # # @param pin_entered [Boolean] + # # + # def initialize(card:, cardholder:, pan:, pin_entered:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Card presence indicator + module Card + extend Lithic::Enum + + NOT_PRESENT = :NOT_PRESENT + PREAUTHORIZED = :PREAUTHORIZED + PRESENT = :PRESENT + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Cardholder presence indicator + module Cardholder + extend Lithic::Enum + + DEFERRED_BILLING = :DEFERRED_BILLING + ELECTRONIC_ORDER = :ELECTRONIC_ORDER + INSTALLMENT = :INSTALLMENT + MAIL_ORDER = :MAIL_ORDER + NOT_PRESENT = :NOT_PRESENT + PREAUTHORIZED = :PREAUTHORIZED + PRESENT = :PRESENT + REOCCURRING = :REOCCURRING + TELEPHONE_ORDER = :TELEPHONE_ORDER + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Method of entry for the PAN + module Pan + extend Lithic::Enum + + AUTO_ENTRY = :AUTO_ENTRY + BAR_CODE = :BAR_CODE + CONTACTLESS = :CONTACTLESS + CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE + ECOMMERCE = :ECOMMERCE + ERROR_KEYED = :ERROR_KEYED + ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE + ICC = :ICC + KEY_ENTERED = :KEY_ENTERED + MAGNETIC_STRIPE = :MAGNETIC_STRIPE + MANUAL = :MANUAL + OCR = :OCR + SECURE_CARDLESS = :SECURE_CARDLESS + UNKNOWN = :UNKNOWN + UNSPECIFIED = :UNSPECIFIED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + class Terminal < Lithic::BaseModel + # @!attribute attended + # True if a clerk is present at the sale. + # + # @return [Boolean] + required :attended, Lithic::BooleanModel + + # @!attribute card_retention_capable + # True if the terminal is capable of retaining the card. + # + # @return [Boolean] + required :card_retention_capable, Lithic::BooleanModel + + # @!attribute on_premise + # True if the sale was made at the place of business (vs. mobile). + # + # @return [Boolean] + required :on_premise, Lithic::BooleanModel + + # @!attribute operator + # The person that is designated to swipe the card + # + # @return [Symbol, Lithic::Models::Transaction::Pos::Terminal::Operator] + required :operator, enum: -> { Lithic::Models::Transaction::Pos::Terminal::Operator } + + # @!attribute partial_approval_capable + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + # + # @return [Boolean] + required :partial_approval_capable, Lithic::BooleanModel + + # @!attribute pin_capability + # Status of whether the POS is able to accept PINs + # + # @return [Symbol, Lithic::Models::Transaction::Pos::Terminal::PinCapability] + required :pin_capability, enum: -> { Lithic::Models::Transaction::Pos::Terminal::PinCapability } + + # @!attribute type + # POS Type + # + # @return [Symbol, Lithic::Models::Transaction::Pos::Terminal::Type] + required :type, enum: -> { Lithic::Models::Transaction::Pos::Terminal::Type } + + # @!parse + # # @param attended [Boolean] + # # @param card_retention_capable [Boolean] + # # @param on_premise [Boolean] + # # @param operator [Symbol, Lithic::Models::Transaction::Pos::Terminal::Operator] + # # @param partial_approval_capable [Boolean] + # # @param pin_capability [Symbol, Lithic::Models::Transaction::Pos::Terminal::PinCapability] + # # @param type [Symbol, Lithic::Models::Transaction::Pos::Terminal::Type] + # # + # def initialize( + # attended:, + # card_retention_capable:, + # on_premise:, + # operator:, + # partial_approval_capable:, + # pin_capability:, + # type:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The person that is designated to swipe the card + module Operator + extend Lithic::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + CARDHOLDER = :CARDHOLDER + CARD_ACCEPTOR = :CARD_ACCEPTOR + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status of whether the POS is able to accept PINs + module PinCapability + extend Lithic::Enum + + CAPABLE = :CAPABLE + INOPERATIVE = :INOPERATIVE + NOT_CAPABLE = :NOT_CAPABLE + UNSPECIFIED = :UNSPECIFIED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # POS Type + module Type + extend Lithic::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + ATM = :ATM + AUTHORIZATION = :AUTHORIZATION + COUPON_MACHINE = :COUPON_MACHINE + DIAL_TERMINAL = :DIAL_TERMINAL + ECOMMERCE = :ECOMMERCE + ECR = :ECR + FUEL_MACHINE = :FUEL_MACHINE + HOME_TERMINAL = :HOME_TERMINAL + MICR = :MICR + OFF_PREMISE = :OFF_PREMISE + PAYMENT = :PAYMENT + PDA = :PDA + PHONE = :PHONE + POINT = :POINT + POS_TERMINAL = :POS_TERMINAL + PUBLIC_UTILITY = :PUBLIC_UTILITY + SELF_SERVICE = :SELF_SERVICE + TELEVISION = :TELEVISION + TELLER = :TELLER + TRAVELERS_CHECK_MACHINE = :TRAVELERS_CHECK_MACHINE + VENDING = :VENDING + VOICE = :VOICE + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + + module Result + extend Lithic::Enum + + ACCOUNT_STATE_TRANSACTION_FAIL = :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED = :APPROVED + BANK_CONNECTION_ERROR = :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED = :BANK_NOT_VERIFIED + CARD_CLOSED = :CARD_CLOSED + CARD_PAUSED = :CARD_PAUSED + DECLINED = :DECLINED + FRAUD_ADVICE = :FRAUD_ADVICE + IGNORED_TTL_EXPIRY = :IGNORED_TTL_EXPIRY + INACTIVE_ACCOUNT = :INACTIVE_ACCOUNT + INCORRECT_PIN = :INCORRECT_PIN + INVALID_CARD_DETAILS = :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD = :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION = :INVALID_TRANSACTION + MERCHANT_BLACKLIST = :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND = :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED = :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED = :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE = :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT = :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT = :USER_TRANSACTION_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status of the transaction. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + SETTLED = :SETTLED + VOIDED = :VOIDED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class TokenInfo < Lithic::BaseModel + # @!attribute wallet_type + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + # + # @return [Symbol, Lithic::Models::Transaction::TokenInfo::WalletType] + required :wallet_type, enum: -> { Lithic::Models::Transaction::TokenInfo::WalletType } + + # @!parse + # # @param wallet_type [Symbol, Lithic::Models::Transaction::TokenInfo::WalletType] + # # + # def initialize(wallet_type:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + module WalletType + extend Lithic::Enum + + APPLE_PAY = :APPLE_PAY + GOOGLE_PAY = :GOOGLE_PAY + MASTERPASS = :MASTERPASS + MERCHANT = :MERCHANT + OTHER = :OTHER + SAMSUNG_PAY = :SAMSUNG_PAY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + class Event < Lithic::BaseModel + # @!attribute token + # Transaction event identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount of the event in the settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute amounts + # + # @return [Lithic::Models::Transaction::Event::Amounts] + required :amounts, -> { Lithic::Models::Transaction::Event::Amounts } + + # @!attribute created + # RFC 3339 date and time this event entered the system. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::ArrayOf[enum: Lithic::Models::Transaction::Event::DetailedResult] } + + # @!attribute effective_polarity + # Indicates whether the transaction event is a credit or debit to the account. + # + # @return [Symbol, Lithic::Models::Transaction::Event::EffectivePolarity] + required :effective_polarity, enum: -> { Lithic::Models::Transaction::Event::EffectivePolarity } + + # @!attribute network_info + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo, nil] + required :network_info, -> { Lithic::Models::Transaction::Event::NetworkInfo }, nil?: true + + # @!attribute result + # + # @return [Symbol, Lithic::Models::Transaction::Event::Result] + required :result, enum: -> { Lithic::Models::Transaction::Event::Result } + + # @!attribute rule_results + # + # @return [Array] + required :rule_results, -> { Lithic::ArrayOf[Lithic::Models::Transaction::Event::RuleResult] } + + # @!attribute type + # Type of transaction event + # + # @return [Symbol, Lithic::Models::Transaction::Event::Type] + required :type, enum: -> { Lithic::Models::Transaction::Event::Type } + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param amounts [Lithic::Models::Transaction::Event::Amounts] + # # @param created [Time] + # # @param detailed_results [Array] + # # @param effective_polarity [Symbol, Lithic::Models::Transaction::Event::EffectivePolarity] + # # @param network_info [Lithic::Models::Transaction::Event::NetworkInfo, nil] + # # @param result [Symbol, Lithic::Models::Transaction::Event::Result] + # # @param rule_results [Array] + # # @param type [Symbol, Lithic::Models::Transaction::Event::Type] + # # + # def initialize( + # token:, + # amount:, + # amounts:, + # created:, + # detailed_results:, + # effective_polarity:, + # network_info:, + # result:, + # rule_results:, + # type:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Amounts < Lithic::BaseModel + # @!attribute cardholder + # + # @return [Lithic::Models::Transaction::Event::Amounts::Cardholder] + required :cardholder, -> { Lithic::Models::Transaction::Event::Amounts::Cardholder } + + # @!attribute merchant + # + # @return [Lithic::Models::Transaction::Event::Amounts::Merchant] + required :merchant, -> { Lithic::Models::Transaction::Event::Amounts::Merchant } + + # @!attribute settlement + # + # @return [Lithic::Models::Transaction::Event::Amounts::Settlement, nil] + required :settlement, -> { Lithic::Models::Transaction::Event::Amounts::Settlement }, nil?: true + + # @!parse + # # @param cardholder [Lithic::Models::Transaction::Event::Amounts::Cardholder] + # # @param merchant [Lithic::Models::Transaction::Event::Amounts::Merchant] + # # @param settlement [Lithic::Models::Transaction::Event::Amounts::Settlement, nil] + # # + # def initialize(cardholder:, merchant:, settlement:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Cardholder < Lithic::BaseModel + # @!attribute amount + # Amount of the event in the cardholder billing currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute conversion_rate + # Exchange rate used to convert the merchant amount to the cardholder billing + # amount. + # + # @return [String] + required :conversion_rate, String + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param conversion_rate [String] + # # @param currency [String] + # # + # def initialize(amount:, conversion_rate:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Merchant < Lithic::BaseModel + # @!attribute amount + # Amount of the event in the merchant currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param currency [String] + # # + # def initialize(amount:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Settlement < Lithic::BaseModel + # @!attribute amount + # Amount of the event, if it is financial, in the settlement currency. + # Non-financial events do not contain this amount because they do not move funds. + # + # @return [Integer] + required :amount, Integer + + # @!attribute conversion_rate + # Exchange rate used to convert the merchant amount to the settlement amount. + # + # @return [String] + required :conversion_rate, String + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!parse + # # @param amount [Integer] + # # @param conversion_rate [String] + # # @param currency [String] + # # + # def initialize(amount:, conversion_rate:, currency:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + module DetailedResult + extend Lithic::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT = :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE = :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_UNDER_REVIEW = :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT = :ADDRESS_INCORRECT + APPROVED = :APPROVED + AUTH_RULE_ALLOWED_COUNTRY = :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC = :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY = :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC = :AUTH_RULE_BLOCKED_MCC + CARD_CLOSED = :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE = :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED = :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT = :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID = :CARD_INVALID + CARD_NOT_ACTIVATED = :CARD_NOT_ACTIVATED + CARD_PAUSED = :CARD_PAUSED + CARD_PIN_INCORRECT = :CARD_PIN_INCORRECT + CARD_RESTRICTED = :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT = :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED = :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER = :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT = :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT = :CUSTOM_ASA_RESULT + DECLINED = :DECLINED + DO_NOT_HONOR = :DO_NOT_HONOR + DRIVER_NUMBER_INVALID = :DRIVER_NUMBER_INVALID + FORMAT_ERROR = :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE = :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR = :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT = :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE = :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID = :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED = :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED = :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED = :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED = :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION = :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED = :REVERSAL_UNMATCHED + SECURITY_VIOLATION = :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED = :SINGLE_USE_CARD_REATTEMPTED + TRANSACTION_INVALID = :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED = :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID = :VEHICLE_NUMBER_INVALID + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Indicates whether the transaction event is a credit or debit to the account. + module EffectivePolarity + extend Lithic::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class NetworkInfo < Lithic::BaseModel + # @!attribute acquirer + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo::Acquirer, nil] + required :acquirer, -> { Lithic::Models::Transaction::Event::NetworkInfo::Acquirer }, nil?: true + + # @!attribute mastercard + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo::Mastercard, nil] + required :mastercard, -> { Lithic::Models::Transaction::Event::NetworkInfo::Mastercard }, nil?: true + + # @!attribute visa + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo::Visa, nil] + required :visa, -> { Lithic::Models::Transaction::Event::NetworkInfo::Visa }, nil?: true + + # @!parse + # # Information provided by the card network in each event. This includes common + # # identifiers shared between you, Lithic, the card network and in some cases the + # # acquirer. These identifiers often link together events within the same + # # transaction lifecycle and can be used to locate a particular transaction, such + # # as during processing of disputes. Not all fields are available in all events, + # # and the presence of these fields is dependent on the card network and the event + # # type. If the field is populated by the network, we will pass it through as is + # # unless otherwise specified. Please consult the official network documentation + # # for more details about these fields and how to use them. + # # + # # @param acquirer [Lithic::Models::Transaction::Event::NetworkInfo::Acquirer, nil] + # # @param mastercard [Lithic::Models::Transaction::Event::NetworkInfo::Mastercard, nil] + # # @param visa [Lithic::Models::Transaction::Event::NetworkInfo::Visa, nil] + # # + # def initialize(acquirer:, mastercard:, visa:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Acquirer < Lithic::BaseModel + # @!attribute acquirer_reference_number + # Identifier assigned by the acquirer, applicable to dual-message transactions + # only. The acquirer reference number (ARN) is only populated once a transaction + # has been cleared, and it is not available in all transactions (such as automated + # fuel dispenser transactions). A single transaction can contain multiple ARNs if + # the merchant sends multiple clearings. + # + # @return [String, nil] + required :acquirer_reference_number, String, nil?: true + + # @!attribute retrieval_reference_number + # Identifier assigned by the acquirer. + # + # @return [String, nil] + required :retrieval_reference_number, String, nil?: true + + # @!parse + # # @param acquirer_reference_number [String, nil] + # # @param retrieval_reference_number [String, nil] + # # + # def initialize(acquirer_reference_number:, retrieval_reference_number:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Mastercard < Lithic::BaseModel + # @!attribute banknet_reference_number + # Identifier assigned by Mastercard. Guaranteed by Mastercard to be unique for any + # transaction within a specific financial network on any processing day. + # + # @return [String, nil] + required :banknet_reference_number, String, nil?: true + + # @!attribute original_banknet_reference_number + # Identifier assigned by Mastercard. Matches the `banknet_reference_number` of a + # prior related event. May be populated in authorization reversals, incremental + # authorizations (authorization requests that augment a previously authorized + # amount), automated fuel dispenser authorization advices and clearings, and + # financial authorizations. If the original banknet reference number contains all + # zeroes, then no actual reference number could be found by the network or + # acquirer. If Mastercard converts a transaction from dual-message to + # single-message, such as for certain ATM transactions, it will populate the + # original banknet reference number in the resulting financial authorization with + # the banknet reference number of the initial authorization, which Lithic does not + # receive. + # + # @return [String, nil] + required :original_banknet_reference_number, String, nil?: true + + # @!attribute original_switch_serial_number + # Identifier assigned by Mastercard. Matches the `switch_serial_number` of a prior + # related event. May be populated in returns and return reversals. Applicable to + # single-message transactions only. + # + # @return [String, nil] + required :original_switch_serial_number, String, nil?: true + + # @!attribute switch_serial_number + # Identifier assigned by Mastercard, applicable to single-message transactions + # only. + # + # @return [String, nil] + required :switch_serial_number, String, nil?: true + + # @!parse + # # @param banknet_reference_number [String, nil] + # # @param original_banknet_reference_number [String, nil] + # # @param original_switch_serial_number [String, nil] + # # @param switch_serial_number [String, nil] + # # + # def initialize( + # banknet_reference_number:, + # original_banknet_reference_number:, + # original_switch_serial_number:, + # switch_serial_number:, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Visa < Lithic::BaseModel + # @!attribute original_transaction_id + # Identifier assigned by Visa. Matches the `transaction_id` of a prior related + # event. May be populated in incremental authorizations (authorization requests + # that augment a previously authorized amount), authorization advices, financial + # authorizations, and clearings. + # + # @return [String, nil] + required :original_transaction_id, String, nil?: true + + # @!attribute transaction_id + # Identifier assigned by Visa to link original messages to subsequent messages. + # Guaranteed by Visa to be unique for each original authorization and financial + # authorization. + # + # @return [String, nil] + required :transaction_id, String, nil?: true + + # @!parse + # # @param original_transaction_id [String, nil] + # # @param transaction_id [String, nil] + # # + # def initialize(original_transaction_id:, transaction_id:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + + module Result + extend Lithic::Enum + + ACCOUNT_STATE_TRANSACTION_FAIL = :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED = :APPROVED + BANK_CONNECTION_ERROR = :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED = :BANK_NOT_VERIFIED + CARD_CLOSED = :CARD_CLOSED + CARD_PAUSED = :CARD_PAUSED + DECLINED = :DECLINED + FRAUD_ADVICE = :FRAUD_ADVICE + IGNORED_TTL_EXPIRY = :IGNORED_TTL_EXPIRY + INACTIVE_ACCOUNT = :INACTIVE_ACCOUNT + INCORRECT_PIN = :INCORRECT_PIN + INVALID_CARD_DETAILS = :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD = :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION = :INVALID_TRANSACTION + MERCHANT_BLACKLIST = :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND = :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED = :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED = :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE = :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT = :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT = :USER_TRANSACTION_LIMIT + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class RuleResult < Lithic::BaseModel + # @!attribute auth_rule_token + # The Auth Rule Token associated with the rule from which the decline originated. + # If this is set to null, then the decline was not associated with a + # customer-configured Auth Rule. This may happen in cases where a transaction is + # declined due to a Lithic-configured security or compliance rule, for example. + # + # @return [String, nil] + required :auth_rule_token, String, nil?: true + + # @!attribute explanation + # A human-readable explanation outlining the motivation for the rule's decline. + # + # @return [String, nil] + required :explanation, String, nil?: true + + # @!attribute name + # The name for the rule, if any was configured. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute result + # The detailed_result associated with this rule's decline. + # + # @return [Symbol, Lithic::Models::Transaction::Event::RuleResult::Result] + required :result, enum: -> { Lithic::Models::Transaction::Event::RuleResult::Result } + + # @!parse + # # @param auth_rule_token [String, nil] + # # @param explanation [String, nil] + # # @param name [String, nil] + # # @param result [Symbol, Lithic::Models::Transaction::Event::RuleResult::Result] + # # + # def initialize(auth_rule_token:, explanation:, name:, result:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The detailed_result associated with this rule's decline. + module Result + extend Lithic::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT = :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE = :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_UNDER_REVIEW = :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT = :ADDRESS_INCORRECT + APPROVED = :APPROVED + AUTH_RULE_ALLOWED_COUNTRY = :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC = :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY = :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC = :AUTH_RULE_BLOCKED_MCC + CARD_CLOSED = :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE = :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED = :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT = :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID = :CARD_INVALID + CARD_NOT_ACTIVATED = :CARD_NOT_ACTIVATED + CARD_PAUSED = :CARD_PAUSED + CARD_PIN_INCORRECT = :CARD_PIN_INCORRECT + CARD_RESTRICTED = :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT = :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED = :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER = :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT = :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT = :CUSTOM_ASA_RESULT + DECLINED = :DECLINED + DO_NOT_HONOR = :DO_NOT_HONOR + DRIVER_NUMBER_INVALID = :DRIVER_NUMBER_INVALID + FORMAT_ERROR = :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE = :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR = :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT = :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE = :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID = :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED = :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED = :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED = :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED = :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION = :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED = :REVERSAL_UNMATCHED + SECURITY_VIOLATION = :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED = :SINGLE_USE_CARD_REATTEMPTED + TRANSACTION_INVALID = :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED = :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID = :VEHICLE_NUMBER_INVALID + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # Type of transaction event + module Type + extend Lithic::Enum + + AUTHORIZATION = :AUTHORIZATION + AUTHORIZATION_ADVICE = :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY = :BALANCE_INQUIRY + CLEARING = :CLEARING + CORRECTION_CREDIT = :CORRECTION_CREDIT + CORRECTION_DEBIT = :CORRECTION_DEBIT + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE = :CREDIT_AUTHORIZATION_ADVICE + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + RETURN = :RETURN + RETURN_REVERSAL = :RETURN_REVERSAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end +end diff --git a/lib/lithic/models/transaction_expire_authorization_params.rb b/lib/lithic/models/transaction_expire_authorization_params.rb new file mode 100644 index 00000000..40cb8d91 --- /dev/null +++ b/lib/lithic/models/transaction_expire_authorization_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionExpireAuthorizationParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_list_params.rb b/lib/lithic/models/transaction_list_params.rb new file mode 100644 index 00000000..e1fec578 --- /dev/null +++ b/lib/lithic/models/transaction_list_params.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionListParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute [r] account_token + # Filters for transactions associated with a specific account. + # + # @return [String, nil] + optional :account_token, String + + # @!parse + # # @return [String] + # attr_writer :account_token + + # @!attribute [r] begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time, api_name: :begin + + # @!parse + # # @return [Time] + # attr_writer :begin_ + + # @!attribute [r] card_token + # Filters for transactions associated with a specific card. + # + # @return [String, nil] + optional :card_token, String + + # @!parse + # # @return [String] + # attr_writer :card_token + + # @!attribute [r] end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!parse + # # @return [Time] + # attr_writer :end_ + + # @!attribute [r] ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!parse + # # @return [String] + # attr_writer :ending_before + + # @!attribute [r] page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!parse + # # @return [Integer] + # attr_writer :page_size + + # @!attribute [r] result + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + # + # @return [Symbol, Lithic::Models::TransactionListParams::Result, nil] + optional :result, enum: -> { Lithic::Models::TransactionListParams::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::TransactionListParams::Result] + # attr_writer :result + + # @!attribute [r] starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!parse + # # @return [String] + # attr_writer :starting_after + + # @!attribute [r] status + # Filters for transactions using transaction status field. + # + # @return [Symbol, Lithic::Models::TransactionListParams::Status, nil] + optional :status, enum: -> { Lithic::Models::TransactionListParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::TransactionListParams::Status] + # attr_writer :status + + # @!parse + # # @param account_token [String] + # # @param begin_ [Time] + # # @param card_token [String] + # # @param end_ [Time] + # # @param ending_before [String] + # # @param page_size [Integer] + # # @param result [Symbol, Lithic::Models::TransactionListParams::Result] + # # @param starting_after [String] + # # @param status [Symbol, Lithic::Models::TransactionListParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # account_token: nil, + # begin_: nil, + # card_token: nil, + # end_: nil, + # ending_before: nil, + # page_size: nil, + # result: nil, + # starting_after: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Filters for transactions using transaction status field. + module Status + extend Lithic::Enum + + PENDING = :PENDING + VOIDED = :VOIDED + SETTLED = :SETTLED + DECLINED = :DECLINED + EXPIRED = :EXPIRED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/transaction_retrieve_params.rb b/lib/lithic/models/transaction_retrieve_params.rb new file mode 100644 index 00000000..2bcc9ea7 --- /dev/null +++ b/lib/lithic/models/transaction_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_advice_params.rb b/lib/lithic/models/transaction_simulate_authorization_advice_params.rb new file mode 100644 index 00000000..cdd89cb6 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_advice_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateAuthorizationAdviceParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize. response. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + # + # @return [Integer] + required :amount, Integer + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(token:, amount:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_advice_response.rb b/lib/lithic/models/transaction_simulate_authorization_advice_response.rb new file mode 100644 index 00000000..15f1975c --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_advice_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateAuthorizationAdviceResponse < Lithic::BaseModel + # @!attribute [r] token + # A unique token to reference this transaction. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!parse + # # @return [String] + # attr_writer :debugging_request_id + + # @!parse + # # @param token [String] + # # @param debugging_request_id [String] + # # + # def initialize(token: nil, debugging_request_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_params.rb b/lib/lithic/models/transaction_simulate_authorization_params.rb new file mode 100644 index 00000000..eec667fd --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_params.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateAuthorizationParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + # + # @return [Integer] + required :amount, Integer + + # @!attribute descriptor + # Merchant descriptor. + # + # @return [String] + required :descriptor, String + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute [r] mcc + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @return [String, nil] + optional :mcc, String + + # @!parse + # # @return [String] + # attr_writer :mcc + + # @!attribute [r] merchant_acceptor_id + # Unique identifier to identify the payment card acceptor. + # + # @return [String, nil] + optional :merchant_acceptor_id, String + + # @!parse + # # @return [String] + # attr_writer :merchant_acceptor_id + + # @!attribute [r] merchant_amount + # Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + # + # @return [Integer, nil] + optional :merchant_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :merchant_amount + + # @!attribute [r] merchant_currency + # 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + # + # @return [String, nil] + optional :merchant_currency, String + + # @!parse + # # @return [String] + # attr_writer :merchant_currency + + # @!attribute [r] partial_approval_capable + # Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + # + # @return [Boolean, nil] + optional :partial_approval_capable, Lithic::BooleanModel + + # @!parse + # # @return [Boolean] + # attr_writer :partial_approval_capable + + # @!attribute [r] pin + # Simulate entering a PIN. If omitted, PIN check will not be performed. + # + # @return [String, nil] + optional :pin, String + + # @!parse + # # @return [String] + # attr_writer :pin + + # @!attribute [r] status + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + # + # @return [Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status, nil] + optional :status, enum: -> { Lithic::Models::TransactionSimulateAuthorizationParams::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status] + # attr_writer :status + + # @!parse + # # @param amount [Integer] + # # @param descriptor [String] + # # @param pan [String] + # # @param mcc [String] + # # @param merchant_acceptor_id [String] + # # @param merchant_amount [Integer] + # # @param merchant_currency [String] + # # @param partial_approval_capable [Boolean] + # # @param pin [String] + # # @param status [Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize( + # amount:, + # descriptor:, + # pan:, + # mcc: nil, + # merchant_acceptor_id: nil, + # merchant_amount: nil, + # merchant_currency: nil, + # partial_approval_capable: nil, + # pin: nil, + # status: nil, + # request_options: {}, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + module Status + extend Lithic::Enum + + AUTHORIZATION = :AUTHORIZATION + BALANCE_INQUIRY = :BALANCE_INQUIRY + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_response.rb b/lib/lithic/models/transaction_simulate_authorization_response.rb new file mode 100644 index 00000000..140bf0c0 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_response.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateAuthorizationResponse < Lithic::BaseModel + # @!attribute [r] token + # A unique token to reference this transaction with later calls to void or clear + # the authorization. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!parse + # # @return [String] + # attr_writer :debugging_request_id + + # @!parse + # # @param token [String] + # # @param debugging_request_id [String] + # # + # def initialize(token: nil, debugging_request_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_clearing_params.rb b/lib/lithic/models/transaction_simulate_clearing_params.rb new file mode 100644 index 00000000..272f86fa --- /dev/null +++ b/lib/lithic/models/transaction_simulate_clearing_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateClearingParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize response. + # + # @return [String] + required :token, String + + # @!attribute [r] amount + # Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(token:, amount: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_clearing_response.rb b/lib/lithic/models/transaction_simulate_clearing_response.rb new file mode 100644 index 00000000..f519c774 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_clearing_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateClearingResponse < Lithic::BaseModel + # @!attribute [r] debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!parse + # # @return [String] + # attr_writer :debugging_request_id + + # @!parse + # # @param debugging_request_id [String] + # # + # def initialize(debugging_request_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_credit_authorization_params.rb b/lib/lithic/models/transaction_simulate_credit_authorization_params.rb new file mode 100644 index 00000000..a826ffe4 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_credit_authorization_params.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateCreditAuthorizationParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + # + # @return [Integer] + required :amount, Integer + + # @!attribute descriptor + # Merchant descriptor. + # + # @return [String] + required :descriptor, String + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute [r] mcc + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @return [String, nil] + optional :mcc, String + + # @!parse + # # @return [String] + # attr_writer :mcc + + # @!attribute [r] merchant_acceptor_id + # Unique identifier to identify the payment card acceptor. + # + # @return [String, nil] + optional :merchant_acceptor_id, String + + # @!parse + # # @return [String] + # attr_writer :merchant_acceptor_id + + # @!parse + # # @param amount [Integer] + # # @param descriptor [String] + # # @param pan [String] + # # @param mcc [String] + # # @param merchant_acceptor_id [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_credit_authorization_response.rb b/lib/lithic/models/transaction_simulate_credit_authorization_response.rb new file mode 100644 index 00000000..d8d216d5 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_credit_authorization_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateCreditAuthorizationResponse < Lithic::BaseModel + # @!attribute [r] token + # A unique token to reference this transaction. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!parse + # # @return [String] + # attr_writer :debugging_request_id + + # @!parse + # # @param token [String] + # # @param debugging_request_id [String] + # # + # def initialize(token: nil, debugging_request_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_params.rb b/lib/lithic/models/transaction_simulate_return_params.rb new file mode 100644 index 00000000..d234c9bd --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_params.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateReturnParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # Amount (in cents) to authorize. + # + # @return [Integer] + required :amount, Integer + + # @!attribute descriptor + # Merchant descriptor. + # + # @return [String] + required :descriptor, String + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!parse + # # @param amount [Integer] + # # @param descriptor [String] + # # @param pan [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(amount:, descriptor:, pan:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_response.rb b/lib/lithic/models/transaction_simulate_return_response.rb new file mode 100644 index 00000000..1995e2ee --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateReturnResponse < Lithic::BaseModel + # @!attribute [r] token + # A unique token to reference this transaction. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!parse + # # @return [String] + # attr_writer :debugging_request_id + + # @!parse + # # @param token [String] + # # @param debugging_request_id [String] + # # + # def initialize(token: nil, debugging_request_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_reversal_params.rb b/lib/lithic/models/transaction_simulate_return_reversal_params.rb new file mode 100644 index 00000000..3a0ebcd4 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_reversal_params.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateReturnReversalParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize response. + # + # @return [String] + required :token, String + + # @!parse + # # @param token [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(token:, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_reversal_response.rb b/lib/lithic/models/transaction_simulate_return_reversal_response.rb new file mode 100644 index 00000000..d93407a6 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_reversal_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateReturnReversalResponse < Lithic::BaseModel + # @!attribute [r] debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!parse + # # @return [String] + # attr_writer :debugging_request_id + + # @!parse + # # @param debugging_request_id [String] + # # + # def initialize(debugging_request_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transaction_simulate_void_params.rb b/lib/lithic/models/transaction_simulate_void_params.rb new file mode 100644 index 00000000..389e15d6 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_void_params.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateVoidParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize response. + # + # @return [String] + required :token, String + + # @!attribute [r] amount + # Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!attribute [r] type + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + # + # @return [Symbol, Lithic::Models::TransactionSimulateVoidParams::Type, nil] + optional :type, enum: -> { Lithic::Models::TransactionSimulateVoidParams::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::TransactionSimulateVoidParams::Type] + # attr_writer :type + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param type [Symbol, Lithic::Models::TransactionSimulateVoidParams::Type] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(token:, amount: nil, type: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + module Type + extend Lithic::Enum + + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/transaction_simulate_void_response.rb b/lib/lithic/models/transaction_simulate_void_response.rb new file mode 100644 index 00000000..988ebeab --- /dev/null +++ b/lib/lithic/models/transaction_simulate_void_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransactionSimulateVoidResponse < Lithic::BaseModel + # @!attribute [r] debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!parse + # # @return [String] + # attr_writer :debugging_request_id + + # @!parse + # # @param debugging_request_id [String] + # # + # def initialize(debugging_request_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rb b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rb new file mode 100644 index 00000000..a4146dd9 --- /dev/null +++ b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + class EnhancedCommercialDataRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rb b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rb new file mode 100644 index 00000000..c1a71c29 --- /dev/null +++ b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + class EnhancedCommercialDataRetrieveResponse < Lithic::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Lithic::ArrayOf[Lithic::Models::Transactions::Events::EnhancedData] } + + # @!parse + # # @param data [Array] + # # + # def initialize(data:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end +end diff --git a/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rb b/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rb new file mode 100644 index 00000000..1d135e6c --- /dev/null +++ b/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + module Events + class EnhancedCommercialDataRetrieveParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!parse + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end + end + end +end diff --git a/lib/lithic/models/transactions/events/enhanced_data.rb b/lib/lithic/models/transactions/events/enhanced_data.rb new file mode 100644 index 00000000..4740dc6d --- /dev/null +++ b/lib/lithic/models/transactions/events/enhanced_data.rb @@ -0,0 +1,543 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + module Events + class EnhancedData < Lithic::BaseModel + # @!attribute token + # A unique identifier for the enhanced commercial data. + # + # @return [String] + required :token, String + + # @!attribute common + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Common] + required :common, -> { Lithic::Models::Transactions::Events::EnhancedData::Common } + + # @!attribute event_token + # The token of the event that the enhanced data is associated with. + # + # @return [String] + required :event_token, String + + # @!attribute fleet + # + # @return [Array] + required :fleet, -> { Lithic::ArrayOf[Lithic::Models::Transactions::Events::EnhancedData::Fleet] } + + # @!attribute transaction_token + # The token of the transaction that the enhanced data is associated with. + # + # @return [String] + required :transaction_token, String + + # @!parse + # # @param token [String] + # # @param common [Lithic::Models::Transactions::Events::EnhancedData::Common] + # # @param event_token [String] + # # @param fleet [Array] + # # @param transaction_token [String] + # # + # def initialize(token:, common:, event_token:, fleet:, transaction_token:, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class Common < Lithic::BaseModel + # @!attribute line_items + # + # @return [Array] + required :line_items, + -> { Lithic::ArrayOf[Lithic::Models::Transactions::Events::EnhancedData::Common::LineItem] } + + # @!attribute tax + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Common::Tax] + required :tax, -> { Lithic::Models::Transactions::Events::EnhancedData::Common::Tax } + + # @!attribute [r] customer_reference_number + # A customer identifier. + # + # @return [String, nil] + optional :customer_reference_number, String + + # @!parse + # # @return [String] + # attr_writer :customer_reference_number + + # @!attribute [r] merchant_reference_number + # A merchant identifier. + # + # @return [String, nil] + optional :merchant_reference_number, String + + # @!parse + # # @return [String] + # attr_writer :merchant_reference_number + + # @!attribute [r] order_date + # The date of the order. + # + # @return [Date, nil] + optional :order_date, Date + + # @!parse + # # @return [Date] + # attr_writer :order_date + + # @!parse + # # @param line_items [Array] + # # @param tax [Lithic::Models::Transactions::Events::EnhancedData::Common::Tax] + # # @param customer_reference_number [String] + # # @param merchant_reference_number [String] + # # @param order_date [Date] + # # + # def initialize(line_items:, tax:, customer_reference_number: nil, merchant_reference_number: nil, order_date: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class LineItem < Lithic::BaseModel + # @!attribute [r] amount + # The price of the item purchased in merchant currency. + # + # @return [Float, nil] + optional :amount, Float + + # @!parse + # # @return [Float] + # attr_writer :amount + + # @!attribute [r] description + # A human-readable description of the item. + # + # @return [String, nil] + optional :description, String + + # @!parse + # # @return [String] + # attr_writer :description + + # @!attribute [r] product_code + # An identifier for the item purchased. + # + # @return [String, nil] + optional :product_code, String + + # @!parse + # # @return [String] + # attr_writer :product_code + + # @!attribute [r] quantity + # The quantity of the item purchased. + # + # @return [Float, nil] + optional :quantity, Float + + # @!parse + # # @return [Float] + # attr_writer :quantity + + # @!parse + # # An L2/L3 enhanced commercial data line item. + # # + # # @param amount [Float] + # # @param description [String] + # # @param product_code [String] + # # @param quantity [Float] + # # + # def initialize(amount: nil, description: nil, product_code: nil, quantity: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Tax < Lithic::BaseModel + # @!attribute [r] amount + # The amount of tax collected. + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!attribute [r] exempt + # A flag indicating whether the transaction is tax exempt or not. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt, nil] + optional :exempt, enum: -> { Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt } + + # @!parse + # # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt] + # attr_writer :exempt + + # @!attribute [r] merchant_tax_id + # The tax ID of the merchant. + # + # @return [String, nil] + optional :merchant_tax_id, String + + # @!parse + # # @return [String] + # attr_writer :merchant_tax_id + + # @!parse + # # @param amount [Integer] + # # @param exempt [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt] + # # @param merchant_tax_id [String] + # # + # def initialize(amount: nil, exempt: nil, merchant_tax_id: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # A flag indicating whether the transaction is tax exempt or not. + module Exempt + extend Lithic::Enum + + TAX_INCLUDED = :TAX_INCLUDED + TAX_NOT_INCLUDED = :TAX_NOT_INCLUDED + NOT_SUPPORTED = :NOT_SUPPORTED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + + class Fleet < Lithic::BaseModel + # @!attribute amount_totals + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals] + required :amount_totals, -> { Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals } + + # @!attribute fuel + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel] + required :fuel, -> { Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel } + + # @!attribute [r] driver_number + # The driver number entered into the terminal at the time of sale, with leading + # zeros stripped. + # + # @return [String, nil] + optional :driver_number, String + + # @!parse + # # @return [String] + # attr_writer :driver_number + + # @!attribute [r] odometer + # The odometer reading entered into the terminal at the time of sale. + # + # @return [Integer, nil] + optional :odometer, Integer + + # @!parse + # # @return [Integer] + # attr_writer :odometer + + # @!attribute [r] service_type + # The type of fuel service. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType, nil] + optional :service_type, + enum: -> { Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType } + + # @!parse + # # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType] + # attr_writer :service_type + + # @!attribute [r] vehicle_number + # The vehicle number entered into the terminal at the time of sale, with leading + # zeros stripped. + # + # @return [String, nil] + optional :vehicle_number, String + + # @!parse + # # @return [String] + # attr_writer :vehicle_number + + # @!parse + # # @param amount_totals [Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals] + # # @param fuel [Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel] + # # @param driver_number [String] + # # @param odometer [Integer] + # # @param service_type [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType] + # # @param vehicle_number [String] + # # + # def initialize(amount_totals:, fuel:, driver_number: nil, odometer: nil, service_type: nil, vehicle_number: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + class AmountTotals < Lithic::BaseModel + # @!attribute [r] discount + # The discount applied to the gross sale amount. + # + # @return [Integer, nil] + optional :discount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :discount + + # @!attribute [r] gross_sale + # The gross sale amount. + # + # @return [Integer, nil] + optional :gross_sale, Integer + + # @!parse + # # @return [Integer] + # attr_writer :gross_sale + + # @!attribute [r] net_sale + # The amount after discount. + # + # @return [Integer, nil] + optional :net_sale, Integer + + # @!parse + # # @return [Integer] + # attr_writer :net_sale + + # @!parse + # # @param discount [Integer] + # # @param gross_sale [Integer] + # # @param net_sale [Integer] + # # + # def initialize(discount: nil, gross_sale: nil, net_sale: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + + class Fuel < Lithic::BaseModel + # @!attribute [r] quantity + # The quantity of fuel purchased. + # + # @return [Float, nil] + optional :quantity, Float + + # @!parse + # # @return [Float] + # attr_writer :quantity + + # @!attribute [r] type + # The type of fuel purchased. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type, nil] + optional :type, enum: -> { Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type] + # attr_writer :type + + # @!attribute [r] unit_of_measure + # Unit of measure for fuel disbursement. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure, nil] + optional :unit_of_measure, + enum: -> { Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure } + + # @!parse + # # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure] + # attr_writer :unit_of_measure + + # @!attribute [r] unit_price + # The price per unit of fuel. + # + # @return [Integer, nil] + optional :unit_price, Integer + + # @!parse + # # @return [Integer] + # attr_writer :unit_price + + # @!parse + # # @param quantity [Float] + # # @param type [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type] + # # @param unit_of_measure [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure] + # # @param unit_price [Integer] + # # + # def initialize(quantity: nil, type: nil, unit_of_measure: nil, unit_price: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # The type of fuel purchased. + module Type + extend Lithic::Enum + + UNKNOWN = :UNKNOWN + REGULAR = :REGULAR + MID_PLUS = :MID_PLUS + PREMIUM_SUPER = :PREMIUM_SUPER + MID_PLUS_2 = :MID_PLUS_2 + PREMIUM_SUPER_2 = :PREMIUM_SUPER_2 + ETHANOL_5_7_BLEND = :ETHANOL_5_7_BLEND + MID_PLUS_ETHANOL_5_7_PERCENT_BLEND = :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND + ETHANOL_7_7_PERCENT_BLEND = :ETHANOL_7_7_PERCENT_BLEND + MID_PLUS_ETHANOL_7_7_PERCENT_BLEND = :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND + GREEN_GASOLINE_REGULAR = :GREEN_GASOLINE_REGULAR + GREEN_GASOLINE_MID_PLUS = :GREEN_GASOLINE_MID_PLUS + GREEN_GASOLINE_PREMIUM_SUPER = :GREEN_GASOLINE_PREMIUM_SUPER + REGULAR_DIESEL_2 = :REGULAR_DIESEL_2 + PREMIUM_DIESEL_2 = :PREMIUM_DIESEL_2 + REGULAR_DIESEL_1 = :REGULAR_DIESEL_1 + COMPRESSED_NATURAL_GAS = :COMPRESSED_NATURAL_GAS + LIQUID_PROPANE_GAS = :LIQUID_PROPANE_GAS + LIQUID_NATURAL_GAS = :LIQUID_NATURAL_GAS + E_85 = :E_85 + REFORMULATED_1 = :REFORMULATED_1 + REFORMULATED_2 = :REFORMULATED_2 + REFORMULATED_3 = :REFORMULATED_3 + REFORMULATED_4 = :REFORMULATED_4 + REFORMULATED_5 = :REFORMULATED_5 + DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE = :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE + DIESEL_OFF_ROAD_NON_TAXABLE = :DIESEL_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE + UNDEFINED_FUEL = :UNDEFINED_FUEL + RACING_FUEL = :RACING_FUEL + MID_PLUS_2_10_PERCENT_BLEND = :MID_PLUS_2_10_PERCENT_BLEND + PREMIUM_SUPER_2_10_PERCENT_BLEND = :PREMIUM_SUPER_2_10_PERCENT_BLEND + MID_PLUS_ETHANOL_2_15_PERCENT_BLEND = :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND + REGULAR_ETHANOL_10_PERCENT_BLEND = :REGULAR_ETHANOL_10_PERCENT_BLEND + MID_PLUS_ETHANOL_10_PERCENT_BLEND = :MID_PLUS_ETHANOL_10_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND + B2_DIESEL_BLEND_2_PERCENT_BIODIESEL = :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL + B5_DIESEL_BLEND_5_PERCENT_BIODIESEL = :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL + B10_DIESEL_BLEND_10_PERCENT_BIODIESEL = :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL + B11_DIESEL_BLEND_11_PERCENT_BIODIESEL = :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL + B15_DIESEL_BLEND_15_PERCENT_BIODIESEL = :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL + B20_DIESEL_BLEND_20_PERCENT_BIODIESEL = :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL + B100_DIESEL_BLEND_100_PERCENT_BIODIESEL = :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL + B1_DIESEL_BLEND_1_PERCENT_BIODIESEL = :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL + ADDITIZED_DIESEL_2 = :ADDITIZED_DIESEL_2 + ADDITIZED_DIESEL_3 = :ADDITIZED_DIESEL_3 + RENEWABLE_DIESEL_R95 = :RENEWABLE_DIESEL_R95 + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT = :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT + DIESEL_EXHAUST_FLUID = :DIESEL_EXHAUST_FLUID + PREMIUM_DIESEL_1 = :PREMIUM_DIESEL_1 + REGULAR_ETHANOL_15_PERCENT_BLEND = :REGULAR_ETHANOL_15_PERCENT_BLEND + MID_PLUS_ETHANOL_15_PERCENT_BLEND = :MID_PLUS_ETHANOL_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND + PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL = + :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL + PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL = + :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL + B75_DIESEL_BLEND_75_PERCENT_BIODIESEL = :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL + B99_DIESEL_BLEND_99_PERCENT_BIODIESEL = :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL + MISCELLANEOUS_FUEL = :MISCELLANEOUS_FUEL + JET_FUEL = :JET_FUEL + AVIATION_FUEL_REGULAR = :AVIATION_FUEL_REGULAR + AVIATION_FUEL_PREMIUM = :AVIATION_FUEL_PREMIUM + AVIATION_FUEL_JP8 = :AVIATION_FUEL_JP8 + AVIATION_FUEL_4 = :AVIATION_FUEL_4 + AVIATION_FUEL_5 = :AVIATION_FUEL_5 + BIOJET_DIESEL = :BIOJET_DIESEL + AVIATION_BIOFUEL_GASOLINE = :AVIATION_BIOFUEL_GASOLINE + MISCELLANEOUS_AVIATION_FUEL = :MISCELLANEOUS_AVIATION_FUEL + MARINE_FUEL_1 = :MARINE_FUEL_1 + MARINE_FUEL_2 = :MARINE_FUEL_2 + MARINE_FUEL_3 = :MARINE_FUEL_3 + MARINE_FUEL_4 = :MARINE_FUEL_4 + MARINE_FUEL_5 = :MARINE_FUEL_5 + MARINE_OTHER = :MARINE_OTHER + MARINE_DIESEL = :MARINE_DIESEL + MISCELLANEOUS_MARINE_FUEL = :MISCELLANEOUS_MARINE_FUEL + KEROSENE_LOW_SULFUR = :KEROSENE_LOW_SULFUR + WHITE_GAS = :WHITE_GAS + HEATING_OIL = :HEATING_OIL + OTHER_FUEL_NON_TAXABLE = :OTHER_FUEL_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR = :KEROSENE_ULTRA_LOW_SULFUR + KEROSENE_LOW_SULFUR_NON_TAXABLE = :KEROSENE_LOW_SULFUR_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE = :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE + EVC_1_LEVEL_1_CHARGE_110_V_15_AMP = :EVC_1_LEVEL_1_CHARGE_110V_15_AMP + EVC_2_LEVEL_2_CHARGE_240_V_15_40_AMP = :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP + EVC_3_LEVEL_3_CHARGE_480_V_3_PHASE_CHARGE = :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE + BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE + DIESEL_1_OFF_ROAD_NON_TAXABLE = :DIESEL_1_OFF_ROAD_NON_TAXABLE + DIESEL_2_OFF_ROAD_NON_TAXABLE = :DIESEL_2_OFF_ROAD_NON_TAXABLE + DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE = :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE + DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE = :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE + ADDITIVE_DOSAGE = :ADDITIVE_DOSAGE + ETHANOL_BLENDS_E16_E84 = :ETHANOL_BLENDS_E16_E84 + LOW_OCTANE_UNL = :LOW_OCTANE_UNL + BLENDED_DIESEL_1_AND_2 = :BLENDED_DIESEL_1_AND_2 + OFF_ROAD_REGULAR_NON_TAXABLE = :OFF_ROAD_REGULAR_NON_TAXABLE + OFF_ROAD_MID_PLUS_NON_TAXABLE = :OFF_ROAD_MID_PLUS_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE = :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE + OFF_ROAD_MID_PLUS_2_NON_TAXABLE = :OFF_ROAD_MID_PLUS_2_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE = :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE + RECREATIONAL_FUEL_90_OCTANE = :RECREATIONAL_FUEL_90_OCTANE + HYDROGEN_H35 = :HYDROGEN_H35 + HYDROGEN_H70 = :HYDROGEN_H70 + RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE = :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE = + :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE + MISCELLANEOUS_OTHER_FUEL = :MISCELLANEOUS_OTHER_FUEL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Unit of measure for fuel disbursement. + module UnitOfMeasure + extend Lithic::Enum + + GALLONS = :GALLONS + LITERS = :LITERS + POUNDS = :POUNDS + KILOGRAMS = :KILOGRAMS + IMPERIAL_GALLONS = :IMPERIAL_GALLONS + NOT_APPLICABLE = :NOT_APPLICABLE + UNKNOWN = :UNKNOWN + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # The type of fuel service. + module ServiceType + extend Lithic::Enum + + UNKNOWN = :UNKNOWN + UNDEFINED = :UNDEFINED + SELF_SERVICE = :SELF_SERVICE + FULL_SERVICE = :FULL_SERVICE + NON_FUEL_ONLY = :NON_FUEL_ONLY + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end + end + end + end +end diff --git a/lib/lithic/models/transfer.rb b/lib/lithic/models/transfer.rb new file mode 100644 index 00000000..b28d4f6c --- /dev/null +++ b/lib/lithic/models/transfer.rb @@ -0,0 +1,396 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Transfer < Lithic::BaseModel + # @!attribute [r] token + # Globally unique identifier for the transfer event. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] category + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + # + # @return [Symbol, Lithic::Models::Transfer::Category, nil] + optional :category, enum: -> { Lithic::Models::Transfer::Category } + + # @!parse + # # @return [Symbol, Lithic::Models::Transfer::Category] + # attr_writer :category + + # @!attribute [r] created + # Date and time when the transfer occurred. UTC time zone. + # + # @return [Time, nil] + optional :created, Time + + # @!parse + # # @return [Time] + # attr_writer :created + + # @!attribute [r] currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + # + # @return [String, nil] + optional :currency, String + + # @!parse + # # @return [String] + # attr_writer :currency + + # @!attribute [r] descriptor + # A string that provides a description of the transfer; may be useful to display + # to users. + # + # @return [String, nil] + optional :descriptor, String + + # @!parse + # # @return [String] + # attr_writer :descriptor + + # @!attribute [r] events + # A list of all financial events that have modified this trasnfer. + # + # @return [Array, nil] + optional :events, -> { Lithic::ArrayOf[Lithic::Models::Transfer::Event] } + + # @!parse + # # @return [Array] + # attr_writer :events + + # @!attribute [r] from_balance + # The updated balance of the sending financial account. + # + # @return [Array, nil] + optional :from_balance, -> { Lithic::ArrayOf[Lithic::Models::Balance] } + + # @!parse + # # @return [Array] + # attr_writer :from_balance + + # @!attribute [r] pending_amount + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + # + # @return [Integer, nil] + optional :pending_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :pending_amount + + # @!attribute [r] result + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::Transfer::Result, nil] + optional :result, enum: -> { Lithic::Models::Transfer::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::Transfer::Result] + # attr_writer :result + + # @!attribute [r] settled_amount + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents). + # + # @return [Integer, nil] + optional :settled_amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :settled_amount + + # @!attribute [r] status + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + # + # @return [Symbol, Lithic::Models::Transfer::Status, nil] + optional :status, enum: -> { Lithic::Models::Transfer::Status } + + # @!parse + # # @return [Symbol, Lithic::Models::Transfer::Status] + # attr_writer :status + + # @!attribute [r] to_balance + # The updated balance of the receiving financial account. + # + # @return [Array, nil] + optional :to_balance, -> { Lithic::ArrayOf[Lithic::Models::Balance] } + + # @!parse + # # @return [Array] + # attr_writer :to_balance + + # @!attribute [r] updated + # Date and time when the financial transaction was last updated. UTC time zone. + # + # @return [Time, nil] + optional :updated, Time + + # @!parse + # # @return [Time] + # attr_writer :updated + + # @!parse + # # @param token [String] + # # @param category [Symbol, Lithic::Models::Transfer::Category] + # # @param created [Time] + # # @param currency [String] + # # @param descriptor [String] + # # @param events [Array] + # # @param from_balance [Array] + # # @param pending_amount [Integer] + # # @param result [Symbol, Lithic::Models::Transfer::Result] + # # @param settled_amount [Integer] + # # @param status [Symbol, Lithic::Models::Transfer::Status] + # # @param to_balance [Array] + # # @param updated [Time] + # # + # def initialize( + # token: nil, + # category: nil, + # created: nil, + # currency: nil, + # descriptor: nil, + # events: nil, + # from_balance: nil, + # pending_amount: nil, + # result: nil, + # settled_amount: nil, + # status: nil, + # to_balance: nil, + # updated: nil, + # ** + # ) + # super + # end + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + module Category + extend Lithic::Enum + + TRANSFER = :TRANSFER + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + class Event < Lithic::BaseModel + # @!attribute [r] token + # Globally unique identifier. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] amount + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + # + # @return [Integer, nil] + optional :amount, Integer + + # @!parse + # # @return [Integer] + # attr_writer :amount + + # @!attribute [r] created + # Date and time when the financial event occurred. UTC time zone. + # + # @return [Time, nil] + optional :created, Time + + # @!parse + # # @return [Time] + # attr_writer :created + + # @!attribute [r] result + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::Transfer::Event::Result, nil] + optional :result, enum: -> { Lithic::Models::Transfer::Event::Result } + + # @!parse + # # @return [Symbol, Lithic::Models::Transfer::Event::Result] + # attr_writer :result + + # @!attribute [r] type + # + # @return [Symbol, Lithic::Models::Transfer::Event::Type, nil] + optional :type, enum: -> { Lithic::Models::Transfer::Event::Type } + + # @!parse + # # @return [Symbol, Lithic::Models::Transfer::Event::Type] + # attr_writer :type + + # @!parse + # # @param token [String] + # # @param amount [Integer] + # # @param created [Time] + # # @param result [Symbol, Lithic::Models::Transfer::Event::Result] + # # @param type [Symbol, Lithic::Models::Transfer::Event::Type] + # # + # def initialize(token: nil, amount: nil, created: nil, result: nil, type: nil, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + module Type + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED = :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED = :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + AUTHORIZATION = :AUTHORIZATION + AUTHORIZATION_ADVICE = :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY = :BALANCE_INQUIRY + BILLING_ERROR = :BILLING_ERROR + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + CARD_TO_CARD = :CARD_TO_CARD + CASH_BACK = :CASH_BACK + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CLEARING = :CLEARING + CORRECTION_CREDIT = :CORRECTION_CREDIT + CORRECTION_DEBIT = :CORRECTION_DEBIT + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE = :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON = :DISPUTE_WON + EXTERNAL_ACH_CANCELED = :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED = :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED = :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED = :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED = :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED = :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED = :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED = :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED = :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED = :EXTERNAL_CHECK_SETTLED + EXTERNAL_TRANSFER_CANCELED = :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED = :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED = :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED = :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED = :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED = :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED = :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED = :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED = :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED = :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST = :INTEREST + INTEREST_REVERSAL = :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT = :INTERNAL_ADJUSTMENT + LATE_PAYMENT = :LATE_PAYMENT + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + RETURN = :RETURN + RETURN_REVERSAL = :RETURN_REVERSAL + TRANSFER = :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS = :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + module Status + extend Lithic::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + SETTLED = :SETTLED + VOIDED = :VOIDED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end + end +end diff --git a/lib/lithic/models/transfer_create_params.rb b/lib/lithic/models/transfer_create_params.rb new file mode 100644 index 00000000..7ff8cc0a --- /dev/null +++ b/lib/lithic/models/transfer_create_params.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransferCreateParams < Lithic::BaseModel + # @!parse + # extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # @!attribute amount + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + # + # @return [Integer] + required :amount, Integer + + # @!attribute from + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :from, String + + # @!attribute to + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :to, String + + # @!attribute [r] token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!parse + # # @return [String] + # attr_writer :token + + # @!attribute [r] memo + # Optional descriptor for the transfer. + # + # @return [String, nil] + optional :memo, String + + # @!parse + # # @return [String] + # attr_writer :memo + + # @!parse + # # @param amount [Integer] + # # @param from [String] + # # @param to [String] + # # @param token [String] + # # @param memo [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + # # + # def initialize(amount:, from:, to:, token: nil, memo: nil, request_options: {}, **) = super + + # def initialize: (Hash | Lithic::BaseModel) -> void + end + end +end diff --git a/lib/lithic/models/verification_method.rb b/lib/lithic/models/verification_method.rb new file mode 100644 index 00000000..c13a80c1 --- /dev/null +++ b/lib/lithic/models/verification_method.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Models + module VerificationMethod + extend Lithic::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + EXTERNALLY_VERIFIED = :EXTERNALLY_VERIFIED + + finalize! + + # @!parse + # # @return [Array] + # def self.values; end + end + end +end diff --git a/lib/lithic/pooled_net_requester.rb b/lib/lithic/pooled_net_requester.rb new file mode 100644 index 00000000..b985ff90 --- /dev/null +++ b/lib/lithic/pooled_net_requester.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +module Lithic + # @api private + class PooledNetRequester + # from the golang stdlib + # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 + KEEP_ALIVE_TIMEOUT = 30 + + class << self + # @api private + # + # @param url [URI::Generic] + # + # @return [Net::HTTP] + def connect(url) + port = + case [url.port, url.scheme] + in [Integer, _] + url.port + in [nil, "http" | "ws"] + Net::HTTP.http_default_port + in [nil, "https" | "wss"] + Net::HTTP.https_default_port + end + + Net::HTTP.new(url.host, port).tap do + _1.use_ssl = %w[https wss].include?(url.scheme) + _1.max_retries = 0 + end + end + + # @api private + # + # @param conn [Net::HTTP] + # @param deadline [Float] + def calibrate_socket_timeout(conn, deadline) + timeout = deadline - Lithic::Util.monotonic_secs + conn.open_timeout = conn.read_timeout = conn.write_timeout = conn.continue_timeout = timeout + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @param blk [Proc] + # + # @yieldparam [String] + # @return [Net::HTTPGenericRequest] + def build_request(request, &) + method, url, headers, body = request.fetch_values(:method, :url, :headers, :body) + req = Net::HTTPGenericRequest.new( + method.to_s.upcase, + !body.nil?, + method != :head, + url.to_s + ) + + headers.each { req[_1] = _2 } + + case body + in nil + nil + in String + req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"] + req.body_stream = Lithic::Util::ReadIOAdapter.new(body, &) + in StringIO + req["content-length"] ||= body.size.to_s unless req["transfer-encoding"] + req.body_stream = Lithic::Util::ReadIOAdapter.new(body, &) + in IO | Enumerator + req["transfer-encoding"] ||= "chunked" unless req["content-length"] + req.body_stream = Lithic::Util::ReadIOAdapter.new(body, &) + end + + req + end + end + + # @api private + # + # @param url [URI::Generic] + # @param deadline [Float] + # @param blk [Proc] + # + # @raise [Timeout::Error] + # @yieldparam [Net::HTTP] + private def with_pool(url, deadline:, &blk) + origin = Lithic::Util.uri_origin(url) + timeout = deadline - Lithic::Util.monotonic_secs + pool = + @mutex.synchronize do + @pools[origin] ||= ConnectionPool.new(size: @size) do + self.class.connect(url) + end + end + + pool.with(timeout: timeout, &blk) + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Float] :deadline + # + # @return [Array(Integer, Net::HTTPResponse, Enumerable)] + def execute(request) + url, deadline = request.fetch_values(:url, :deadline) + + eof = false + finished = false + enum = Enumerator.new do |y| + with_pool(url, deadline: deadline) do |conn| + next if finished + + req = self.class.build_request(request) do + self.class.calibrate_socket_timeout(conn, deadline) + end + + self.class.calibrate_socket_timeout(conn, deadline) + unless conn.started? + conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT + conn.start + end + + self.class.calibrate_socket_timeout(conn, deadline) + conn.request(req) do |rsp| + y << [conn, req, rsp] + break if finished + + rsp.read_body do |bytes| + y << bytes + break if finished + + self.class.calibrate_socket_timeout(conn, deadline) + end + eof = true + end + end + rescue Timeout::Error + raise Lithic::APITimeoutError + end + + conn, _, response = enum.next + body = Lithic::Util.fused_enum(enum, external: true) do + finished = true + tap do + enum.next + rescue StopIteration + nil + end + conn.finish if !eof && conn&.started? + end + [Integer(response.code), response, (response.body = body)] + end + + # @api private + # + # @param size [Integer] + def initialize(size: Etc.nprocessors) + @mutex = Mutex.new + @size = size + @pools = {} + end + end +end diff --git a/lib/lithic/request_options.rb b/lib/lithic/request_options.rb new file mode 100644 index 00000000..6513f873 --- /dev/null +++ b/lib/lithic/request_options.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Lithic + # @api private + module RequestParameters + # @!parse + # # Options to specify HTTP behaviour for this request. + # # @return [Lithic::RequestOptions, Hash{Symbol=>Object}] + # attr_accessor :request_options + + # @param mod [Module] + def self.included(mod) + return unless mod <= Lithic::BaseModel + + mod.extend(Lithic::RequestParameters::Converter) + mod.optional(:request_options, Lithic::RequestOptions) + end + + # @api private + module Converter + # @api private + # + # @param params [Object] + # + # @return [Array(Object, Hash{Symbol=>Object})] + def dump_request(params) + case (dumped = dump(params)) + in Hash + [dumped.except(:request_options), dumped[:request_options]] + else + [dumped, nil] + end + end + end + end + + # Specify HTTP behaviour to use for a specific request. These options supplement + # or override those provided at the client level. + # + # When making a request, you can pass an actual {RequestOptions} instance, or + # simply pass a Hash with symbol keys matching the attributes on this class. + class RequestOptions < Lithic::BaseModel + # @api private + # + # @param opts [Lithic::RequestOptions, Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + def self.validate!(opts) + case opts + in Lithic::RequestOptions | Hash + opts.to_h.each_key do |k| + unless fields.include?(k) + raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}") + end + end + + # @!attribute idempotency_key + # Idempotency key to send with request and all associated retries. Will only be + # sent for write requests. + # + # @return [String, nil] + optional :idempotency_key, String + + # @!attribute extra_query + # Extra query params to send with the request. These are `.merge`’d into any + # `query` given at the client level. + # + # @return [Hash{String=>Array, String, nil}, nil] + optional :extra_query, Lithic::HashOf[Lithic::ArrayOf[String]] + + # @!attribute extra_headers + # Extra headers to send with the request. These are `.merged`’d into any + # `extra_headers` given at the client level. + # + # @return [Hash{String=>String, nil}, nil] + optional :extra_headers, Lithic::HashOf[String, nil?: true] + + # @!attribute extra_body + # Extra data to send with the request. These are deep merged into any data + # generated as part of the normal request. + # + # @return [Object, nil] + optional :extra_body, Lithic::HashOf[Lithic::Unknown] + + # @!attribute max_retries + # Maximum number of retries to attempt after a failed initial request. + # + # @return [Integer, nil] + optional :max_retries, Integer + + # @!attribute timeout + # Request timeout in seconds. + # + # @return [Float, nil] + optional :timeout, Float + + # @!parse + # # Returns a new instance of RequestOptions. + # # + # # @param values [Hash{Symbol=>Object}] + # # + # def initialize(values = {}) = super + end +end diff --git a/lib/lithic/resources/account_holders.rb b/lib/lithic/resources/account_holders.rb new file mode 100644 index 00000000..df3f4bd1 --- /dev/null +++ b/lib/lithic/resources/account_holders.rb @@ -0,0 +1,428 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AccountHolders + # Create an account holder and initiate the appropriate onboarding workflow. + # Account holders and accounts have a 1:1 relationship. When an account holder is + # successfully created an associated account is also created. All calls to this + # endpoint will return an immediate response - though in some cases, the response + # may indicate the enrollment is under review or further action will be needed to + # complete the account enrollment process. This endpoint can only be used on + # accounts that are part of the program that the calling API key manages. + # + # @param params [Lithic::Models::AccountHolderCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :beneficial_owner_entities List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background. If no business owner is an entity, pass in an + # empty list. However, either this parameter or `beneficial_owner_individuals` + # must be populated. on entities that should be included. + # + # @option params [Array] :beneficial_owner_individuals List of all direct and indirect individuals with >25% ownership in the company. + # If no entity or individual owns >25% of the company, and the largest shareholder + # is an individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. If no + # individual is an entity, pass in an empty list. However, either this parameter + # or `beneficial_owner_entities` must be populated. + # + # @option params [Lithic::Models::AccountHolderCreateParams::BusinessEntity] :business_entity Information for business for which the account is being opened and KYB is being + # run. + # + # @option params [Lithic::Models::AccountHolderCreateParams::ControlPerson] :control_person An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @option params [String] :nature_of_business Short description of the company's line of business (i.e., what does the company + # do?). + # + # @option params [String] :tos_timestamp An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + # + # @option params [Symbol, Lithic::Models::AccountHolderCreateParams::Workflow] :workflow Specifies the workflow type. This must be 'KYC_EXEMPT' + # + # @option params [Lithic::Models::AccountHolderCreateParams::Individual] :individual Information on individual for whom the account is being opened and KYC is being + # run. + # + # @option params [Lithic::Models::Address] :address KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @option params [String] :email The KYC Exempt user's email + # + # @option params [String] :first_name The KYC Exempt user's first name + # + # @option params [Symbol, Lithic::Models::AccountHolderCreateParams::KYCExemptionType] :kyc_exemption_type Specifies the type of KYC Exempt user + # + # @option params [String] :last_name The KYC Exempt user's last name + # + # @option params [String] :phone_number The KYC Exempt user's phone number, entered in E.164 format. + # + # @option params [String] :external_id A user provided id that can be used to link an account holder with an external + # system + # + # @option params [String] :kyb_passed_timestamp An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + # + # @option params [String] :website_url Company website URL. + # + # @option params [String] :kyc_passed_timestamp An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + # + # @option params [String] :business_account_token Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AccountHolderCreateResponse] + def create(params) + parsed, options = Lithic::Models::AccountHolderCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/account_holders", + body: parsed, + model: Lithic::Models::AccountHolderCreateResponse, + options: options + ) + end + + # Get an Individual or Business Account Holder and/or their KYC or KYB evaluation + # status. + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param params [Lithic::Models::AccountHolderRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AccountHolder] + def retrieve(account_holder_token, params = {}) + @client.request( + method: :get, + path: ["v1/account_holders/%0s", account_holder_token], + model: Lithic::Models::AccountHolder, + options: params[:request_options] + ) + end + + # Update the information associated with a particular account holder (including + # business owners and control persons associated to a business account). If Lithic + # is performing KYB or KYC and additional verification is required we will run the + # individual's or business's updated information again and return whether the + # status is accepted or pending (i.e., further action required). All calls to this + # endpoint will return an immediate response - though in some cases, the response + # may indicate the workflow is under review or further action will be needed to + # complete the evaluation process. This endpoint can only be used on existing + # accounts that are part of the program that the calling API key manages. + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param params [Lithic::Models::AccountHolderUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :beneficial_owner_entities List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background. If no business owner is an entity, pass in an empty + # list. However, either this parameter or `beneficial_owner_individuals` must be + # populated. on entities that should be included. + # + # @option params [Array] :beneficial_owner_individuals List of all individuals with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an + # individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background on individuals that should be included. If no individual + # is an entity, pass in an empty list. However, either this parameter or + # `beneficial_owner_entities` must be populated. + # + # @option params [Lithic::Models::AccountHolderUpdateParams::BusinessEntity] :business_entity Information for business for which the account is being opened and KYB is being + # run. + # + # @option params [Lithic::Models::AccountHolderUpdateParams::ControlPerson] :control_person An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @option params [String] :external_id A user provided id that can be used to link an account holder with an external + # system + # + # @option params [String] :nature_of_business Short description of the company's line of business (i.e., what does the company + # do?). + # + # @option params [String] :website_url Company website URL. + # + # @option params [Lithic::Models::AccountHolderUpdateParams::Individual] :individual Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @option params [Lithic::Models::AddressUpdate] :address Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + # + # @option params [String] :business_account_token Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # account holder is associated. + # + # @option params [String] :email Allowed for all Account Holders. Account holder's email address. The primary + # purpose of this field is for cardholder identification and verification during + # the digital wallet tokenization process. + # + # @option params [String] :first_name Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + # + # @option params [String] :last_name Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + # + # @option params [String] :legal_business_name Allowed for BYO-KYB. Legal business name of the account holder. + # + # @option params [String] :phone_number Allowed for all Account Holders. Account holder's phone number, entered in E.164 + # format. The primary purpose of this field is for cardholder identification and + # verification during the digital wallet tokenization process. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, Lithic::Models::AccountHolderUpdateResponse::PatchResponse] + def update(account_holder_token, params = {}) + parsed, options = Lithic::Models::AccountHolderUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/account_holders/%0s", account_holder_token], + body: parsed, + model: Lithic::Models::AccountHolderUpdateResponse, + options: options + ) + end + + # Get a list of individual or business account holders and their KYC or KYB + # evaluation status. + # + # @param params [Lithic::Models::AccountHolderListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [String] :email Email address of the account holder. The query must be an exact match, case + # insensitive. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [String] :external_id If applicable, represents the external_id associated with the account_holder. + # + # @option params [String] :first_name (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + # + # @option params [String] :last_name (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + # + # @option params [String] :legal_business_name (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + # + # @option params [Integer] :limit The number of account_holders to limit the response to. + # + # @option params [String] :phone_number Phone number of the account holder. The query must be an exact match. + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(params = {}) + parsed, options = Lithic::Models::AccountHolderListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/account_holders", + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::AccountHolder, + options: options + ) + end + + # Retrieve the status of account holder document uploads, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a previous account holder document upload has + # failed, you can use this endpoint to get a new upload URL for the failed image + # upload. + # + # When a new document upload is generated for a failed attempt, the response will + # show an additional entry in the `required_document_uploads` list in a `PENDING` + # state for the corresponding `image_type`. + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param params [Lithic::Models::AccountHolderListDocumentsParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AccountHolderListDocumentsResponse] + def list_documents(account_holder_token, params = {}) + @client.request( + method: :get, + path: ["v1/account_holders/%0s/documents", account_holder_token], + model: Lithic::Models::AccountHolderListDocumentsResponse, + options: params[:request_options] + ) + end + + # Check the status of an account holder document upload, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a document upload has failed, you can use this + # endpoint to get a new upload URL for the failed image upload. + # + # When a new account holder document upload is generated for a failed attempt, the + # response will show an additional entry in the `required_document_uploads` array + # in a `PENDING` state for the corresponding `image_type`. + # + # @param document_token [String] Globally unique identifier for the document. + # + # @param params [Lithic::Models::AccountHolderRetrieveDocumentParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_holder_token Globally unique identifier for the account holder. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Document] + def retrieve_document(document_token, params) + parsed, options = Lithic::Models::AccountHolderRetrieveDocumentParams.dump_request(params) + account_holder_token = + parsed.delete(:account_holder_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/account_holders/%0s/documents/%1s", account_holder_token, document_token], + model: Lithic::Models::Document, + options: options + ) + end + + # Simulates a review for an account holder document upload. + # + # @param params [Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams, Hash{Symbol=>Object}] . + # + # @option params [String] :document_upload_token The account holder document upload which to perform the simulation upon. + # + # @option params [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status] :status An account holder document's upload status for use within the simulation. + # + # @option params [Array] :accepted_entity_status_reasons A list of status reasons associated with a KYB account holder in PENDING_REVIEW + # + # @option params [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason] :status_reason Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Document] + def simulate_enrollment_document_review(params) + parsed, options = + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/account_holders/enrollment_document_review", + body: parsed, + model: Lithic::Models::Document, + options: options + ) + end + + # Simulates an enrollment review for an account holder. This endpoint is only + # applicable for workflows that may required intervention such as `KYB_BASIC`. + # + # @param params [Lithic::Models::AccountHolderSimulateEnrollmentReviewParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_holder_token The account holder which to perform the simulation upon. + # + # @option params [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status] :status An account holder's status for use within the simulation. + # + # @option params [Array] :status_reasons Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse] + def simulate_enrollment_review(params = {}) + parsed, options = Lithic::Models::AccountHolderSimulateEnrollmentReviewParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/account_holders/enrollment_review", + body: parsed, + model: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse, + options: options + ) + end + + # Use this endpoint to identify which type of supported government-issued + # documentation you will upload for further verification. It will return two URLs + # to upload your document images to - one for the front image and one for the back + # image. + # + # This endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state. + # + # Uploaded images must either be a `jpg` or `png` file, and each must be less than + # 15 MiB. Once both required uploads have been successfully completed, your + # document will be run through KYC verification. + # + # If you have registered a webhook, you will receive evaluation updates for any + # document submission evaluations, as well as for any failed document uploads. + # + # Two document submission attempts are permitted via this endpoint before a + # `REJECTED` status is returned and the account creation process is ended. + # Currently only one type of account holder document is supported per KYC + # verification. + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param params [Lithic::Models::AccountHolderUploadDocumentParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType] :document_type The type of document to upload + # + # @option params [String] :entity_token Globally unique identifier for the entity. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Document] + def upload_document(account_holder_token, params) + parsed, options = Lithic::Models::AccountHolderUploadDocumentParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/account_holders/%0s/documents", account_holder_token], + body: parsed, + model: Lithic::Models::Document, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/accounts.rb b/lib/lithic/resources/accounts.rb new file mode 100644 index 00000000..56b0e924 --- /dev/null +++ b/lib/lithic/resources/accounts.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Accounts + # Get account configuration such as spend limits. + # + # @param account_token [String] Globally unique identifier for account. + # + # @param params [Lithic::Models::AccountRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Account] + def retrieve(account_token, params = {}) + @client.request( + method: :get, + path: ["v1/accounts/%0s", account_token], + model: Lithic::Models::Account, + options: params[:request_options] + ) + end + + # Update account configuration such as state or spend limits. Can only be run on + # accounts that are part of the program managed by this API key. Accounts that are + # in the `PAUSED` state will not be able to transact or create new cards. + # + # @param account_token [String] Globally unique identifier for account. + # + # @param params [Lithic::Models::AccountUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :daily_spend_limit Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + # + # @option params [Integer] :lifetime_spend_limit Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + # + # @option params [Integer] :monthly_spend_limit Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + # + # @option params [Symbol, Lithic::Models::AccountUpdateParams::State] :state Account states. + # + # @option params [Lithic::Models::AccountUpdateParams::VerificationAddress] :verification_address Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Authorization Rules. The field will be removed from + # the schema in a future release. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Account] + def update(account_token, params = {}) + parsed, options = Lithic::Models::AccountUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/accounts/%0s", account_token], + body: parsed, + model: Lithic::Models::Account, + options: options + ) + end + + # List account configurations. + # + # @param params [Lithic::Models::AccountListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::AccountListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/accounts", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Account, + options: options + ) + end + + # Get an Account's available spend limits, which is based on the spend limit + # configured on the Account and the amount already spent over the spend limit's + # duration. For example, if the Account has a daily spend limit of $1000 + # configured, and has spent $600 in the last 24 hours, the available spend limit + # returned would be $400. + # + # @param account_token [String] Globally unique identifier for account. + # + # @param params [Lithic::Models::AccountRetrieveSpendLimitsParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AccountSpendLimits] + def retrieve_spend_limits(account_token, params = {}) + @client.request( + method: :get, + path: ["v1/accounts/%0s/spend_limits", account_token], + model: Lithic::Models::AccountSpendLimits, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/aggregate_balances.rb b/lib/lithic/resources/aggregate_balances.rb new file mode 100644 index 00000000..98f3019e --- /dev/null +++ b/lib/lithic/resources/aggregate_balances.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AggregateBalances + # Get the aggregated balance across all end-user accounts by financial account + # type + # + # @param params [Lithic::Models::AggregateBalanceListParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType] :financial_account_type Get the aggregate balance for a given Financial Account type. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(params = {}) + parsed, options = Lithic::Models::AggregateBalanceListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/aggregate_balances", + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::AggregateBalance, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/auth_rules.rb b/lib/lithic/resources/auth_rules.rb new file mode 100644 index 00000000..24e05c76 --- /dev/null +++ b/lib/lithic/resources/auth_rules.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthRules + # @return [Lithic::Resources::AuthRules::V2] + attr_reader :v2 + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @v2 = Lithic::Resources::AuthRules::V2.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/auth_rules/v2.rb b/lib/lithic/resources/auth_rules/v2.rb new file mode 100644 index 00000000..802ed32d --- /dev/null +++ b/lib/lithic/resources/auth_rules/v2.rb @@ -0,0 +1,300 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthRules + class V2 + # @return [Lithic::Resources::AuthRules::V2::Backtests] + attr_reader :backtests + + # Creates a new V2 authorization rule in draft mode + # + # @param params [Lithic::Models::AuthRules::V2CreateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :account_tokens Account tokens to which the Auth Rule applies. + # + # @option params [Array] :card_tokens Card tokens to which the Auth Rule applies. + # + # @option params [Boolean] :program_level Whether the Auth Rule applies to all authorizations on the card program. + # + # @option params [String, nil] :name Auth Rule Name + # + # @option params [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] :parameters Parameters for the Auth Rule + # + # @option params [Symbol, Lithic::Models::AuthRules::V2CreateParams::Type] :type The type of Auth Rule + # + # @option params [Array] :excluded_card_tokens Card tokens to which the Auth Rule does not apply. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2CreateResponse] + def create(params) + parsed, options = Lithic::Models::AuthRules::V2CreateParams.dump_request(params) + @client.request( + method: :post, + path: "v2/auth_rules", + body: parsed, + model: Lithic::Models::AuthRules::V2CreateResponse, + options: options + ) + end + + # Fetches a V2 authorization rule by its token + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2RetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2RetrieveResponse] + def retrieve(auth_rule_token, params = {}) + @client.request( + method: :get, + path: ["v2/auth_rules/%0s", auth_rule_token], + model: Lithic::Models::AuthRules::V2RetrieveResponse, + options: params[:request_options] + ) + end + + # Updates a V2 authorization rule's properties + # + # If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + # is provided, this will replace existing associations with the provided list of + # entities. + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2UpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :account_tokens Account tokens to which the Auth Rule applies. + # + # @option params [String, nil] :name Auth Rule Name + # + # @option params [Symbol, Lithic::Models::AuthRules::V2UpdateParams::State] :state The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @option params [Array] :card_tokens Card tokens to which the Auth Rule applies. + # + # @option params [Array] :excluded_card_tokens Card tokens to which the Auth Rule does not apply. + # + # @option params [Boolean] :program_level Whether the Auth Rule applies to all authorizations on the card program. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2UpdateResponse] + def update(auth_rule_token, params = {}) + parsed, options = Lithic::Models::AuthRules::V2UpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v2/auth_rules/%0s", auth_rule_token], + body: parsed, + model: Lithic::Models::AuthRules::V2UpdateResponse, + options: options + ) + end + + # Lists V2 authorization rules + # + # @param params [Lithic::Models::AuthRules::V2ListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token Only return Authorization Rules that are bound to the provided account token. + # + # @option params [String] :card_token Only return Authorization Rules that are bound to the provided card token. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::AuthRules::V2ListParams.dump_request(params) + @client.request( + method: :get, + path: "v2/auth_rules", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::AuthRules::V2ListResponse, + options: options + ) + end + + # Deletes a V2 authorization rule + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2DeleteParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def delete(auth_rule_token, params = {}) + @client.request( + method: :delete, + path: ["v2/auth_rules/%0s", auth_rule_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Associates a V2 authorization rule with a card program, the provided account(s) + # or card(s). + # + # Prefer using the `PATCH` method for this operation. + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2ApplyParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :account_tokens Account tokens to which the Auth Rule applies. + # + # @option params [Array] :card_tokens Card tokens to which the Auth Rule applies. + # + # @option params [Boolean] :program_level Whether the Auth Rule applies to all authorizations on the card program. + # + # @option params [Array] :excluded_card_tokens Card tokens to which the Auth Rule does not apply. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2ApplyResponse] + def apply(auth_rule_token, params) + parsed, options = Lithic::Models::AuthRules::V2ApplyParams.dump_request(params) + @client.request( + method: :post, + path: ["v2/auth_rules/%0s/apply", auth_rule_token], + body: parsed, + model: Lithic::Models::AuthRules::V2ApplyResponse, + options: options + ) + end + + # Creates a new draft version of a rule that will be ran in shadow mode. + # + # This can also be utilized to reset the draft parameters, causing a draft version + # to no longer be ran in shadow mode. + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2DraftParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, nil] :parameters Parameters for the Auth Rule + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2DraftResponse] + def draft(auth_rule_token, params = {}) + parsed, options = Lithic::Models::AuthRules::V2DraftParams.dump_request(params) + @client.request( + method: :post, + path: ["v2/auth_rules/%0s/draft", auth_rule_token], + body: parsed, + model: Lithic::Models::AuthRules::V2DraftResponse, + options: options + ) + end + + # Promotes the draft version of an authorization rule to the currently active + # version such that it is enforced in the authorization stream. + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2PromoteParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2PromoteResponse] + def promote(auth_rule_token, params = {}) + @client.request( + method: :post, + path: ["v2/auth_rules/%0s/promote", auth_rule_token], + model: Lithic::Models::AuthRules::V2PromoteResponse, + options: params[:request_options] + ) + end + + # Requests a performance report of an authorization rule to be asynchronously + # generated. Reports can only be run on rules in draft or active mode and will + # included approved and declined statistics as well as examples. The generated + # report will be delivered asynchronously through a webhook with `event_type` = + # `auth_rules.performance_report.created`. See the docs on setting up + # [webhook subscriptions](https://docs.lithic.com/docs/events-api). + # + # Reports are generated based on data collected by Lithic's authorization + # processing system in the trailing week. The performance of the auth rule will be + # assessed on the configuration of the auth rule at the time the report is + # requested. This implies that if a performance report is requested, right after + # updating an auth rule, depending on the number of authorizations processed for a + # card program, it may be the case that no data is available for the report. + # Therefore Lithic recommends to decouple making updates to an Auth Rule, and + # requesting performance reports. + # + # To make this concrete, consider the following example: + # + # 1. At time `t`, a new Auth Rule is created, and applies to all authorizations on + # a card program. The Auth Rule has not yet been promoted, causing the draft + # version of the rule to be applied in shadow mode. + # 2. At time `t + 1 hour` a performance report is requested for the Auth Rule. + # This performance report will _only_ contain data for the Auth Rule being + # executed in the window between `t` and `t + 1 hour`. This is because Lithic's + # transaction processing system will only start capturing data for the Auth + # Rule at the time it is created. + # 3. At time `t + 2 hours` the draft version of the Auth Rule is promoted to the + # active version of the Auth Rule by calling the + # `/v2/auth_rules/{auth_rule_token}/promote` endpoint. If a performance report + # is requested at this moment it will still only contain data for this version + # of the rule, but the window of available data will now span from `t` to + # `t + 2 hours`. + # 4. At time `t + 3 hours` a new version of the rule is drafted by calling the + # `/v2/auth_rules/{auth_rule_token}/draft` endpoint. If a performance report is + # requested right at this moment, it will only contain data for authorizations + # to which both the active version and the draft version is applied. Lithic + # does this to ensure that performance reports represent a fair comparison + # between rules. Because there may be no authorizations in this window, and + # because there may be some lag before data is available in a performance + # report, the requested performance report could contain no to little data. + # 5. At time `t + 4 hours` another performance report is requested: this time the + # performance report will contain data from the window between `t + 3 hours` + # and `t + 4 hours`, for any authorizations to which both the current version + # of the authorization rule (in enforcing mode) and the draft version of the + # authorization rule (in shadow mode) applied. + # + # Note that generating a report may take up to 15 minutes and that delivery is not + # guaranteed. Customers are required to have created an event subscription to + # receive the webhook. Additionally, there is a delay of approximately 15 minutes + # between when Lithic's transaction processing systems have processed the + # transaction, and when a transaction will be included in the report. + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2ReportParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2ReportResponse] + def report(auth_rule_token, params = {}) + @client.request( + method: :post, + path: ["v2/auth_rules/%0s/report", auth_rule_token], + model: Lithic::Models::AuthRules::V2ReportResponse, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @backtests = Lithic::Resources::AuthRules::V2::Backtests.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/auth_rules/v2/backtests.rb b/lib/lithic/resources/auth_rules/v2/backtests.rb new file mode 100644 index 00000000..f985b7b4 --- /dev/null +++ b/lib/lithic/resources/auth_rules/v2/backtests.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthRules + class V2 + class Backtests + # Initiates a request to asynchronously generate a backtest for an authorization + # rule. During backtesting, both the active version (if one exists) and the draft + # version of the Authorization Rule are evaluated by replaying historical + # transaction data against the rule's conditions. This process allows customers to + # simulate and understand the effects of proposed rule changes before deployment. + # The generated backtest report provides detailed results showing whether the + # draft version of the Auth Rule would have approved or declined historical + # transactions which were processed during the backtest period. These reports help + # evaluate how changes to rule configurations might affect overall transaction + # approval rates. + # + # The generated backtest report will be delivered asynchronously through a webhook + # with `event_type` = `auth_rules.backtest_report.created`. See the docs on + # setting up [webhook subscriptions](https://docs.lithic.com/docs/events-api). It + # is also possible to request backtest reports on-demand through the + # `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}` + # endpoint. + # + # Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting + # for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e. + # where Lithic has pre-calculated the requested velocity metrics for historical + # transactions), a backtest may be feasible. However, such cases are uncommon and + # customers should not anticipate support for velocity backtests under most + # configurations. If a historical transaction does not feature the required inputs + # to evaluate the rule, then it will not be included in the final backtest report. + # + # @param auth_rule_token [String] Globally unique identifier for the Auth Rule. + # + # @param params [Lithic::Models::AuthRules::V2::BacktestCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :end_ The end time of the backtest. + # + # @option params [Time] :start The start time of the backtest. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2::BacktestCreateResponse] + def create(auth_rule_token, params = {}) + parsed, options = Lithic::Models::AuthRules::V2::BacktestCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v2/auth_rules/%0s/backtests", auth_rule_token], + body: parsed, + model: Lithic::Models::AuthRules::V2::BacktestCreateResponse, + options: options + ) + end + + # Returns the backtest results of an authorization rule (if available). + # + # Backtesting is an asynchronous process that requires time to complete. If a + # customer retrieves the backtest results using this endpoint before the report is + # fully generated, the response will return null for `results.current_version` and + # `results.draft_version`. Customers are advised to wait for the backtest creation + # process to complete (as indicated by the webhook event + # auth_rules.backtest_report.created) before retrieving results from this + # endpoint. + # + # Backtesting is an asynchronous process, while the backtest is being processed, + # results will not be available which will cause `results.current_version` and + # `results.draft_version` objects to contain `null`. The entries in `results` will + # also always represent the configuration of the rule at the time requests are + # made to this endpoint. For example, the results for `current_version` in the + # served backtest report will be consistent with which version of the rule is + # currently activated in the Auth Stream, regardless of which version of the rule + # was active in the Auth Stream at the time a backtest is requested. + # + # @param auth_rule_backtest_token [String] Globally unique identifier for an Auth Rule backtest. + # + # @param params [Lithic::Models::AuthRules::V2::BacktestRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [String] :auth_rule_token Globally unique identifier for the Auth Rule. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults] + def retrieve(auth_rule_backtest_token, params) + parsed, options = Lithic::Models::AuthRules::V2::BacktestRetrieveParams.dump_request(params) + auth_rule_token = + parsed.delete(:auth_rule_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v2/auth_rules/%0s/backtests/%1s", auth_rule_token, auth_rule_backtest_token], + model: Lithic::Models::AuthRules::V2::BacktestResults, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/auth_stream_enrollment.rb b/lib/lithic/resources/auth_stream_enrollment.rb new file mode 100644 index 00000000..c0643527 --- /dev/null +++ b/lib/lithic/resources/auth_stream_enrollment.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthStreamEnrollment + # Retrieve the ASA HMAC secret key. If one does not exist for your program yet, + # calling this endpoint will create one for you. The headers (which you can use to + # verify webhooks) will begin appearing shortly after calling this endpoint for + # the first time. See + # [this page](https://docs.lithic.com/docs/auth-stream-access-asa#asa-webhook-verification) + # for more detail about verifying ASA webhooks. + # + # @param params [Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::AuthStreamSecret] + def retrieve_secret(params = {}) + @client.request( + method: :get, + path: "v1/auth_stream/secret", + model: Lithic::Models::AuthStreamSecret, + options: params[:request_options] + ) + end + + # Generate a new ASA HMAC secret key. The old ASA HMAC secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /auth_stream/secret`](https://docs.lithic.com/reference/getauthstreamsecret) + # request to retrieve the new secret key. + # + # @param params [Lithic::Models::AuthStreamEnrollmentRotateSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def rotate_secret(params = {}) + @client.request( + method: :post, + path: "v1/auth_stream/secret/rotate", + model: NilClass, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/balances.rb b/lib/lithic/resources/balances.rb new file mode 100644 index 00000000..cb4e67f2 --- /dev/null +++ b/lib/lithic/resources/balances.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Balances + # Get the balances for a program, business, or a given end-user account + # + # @param params [Lithic::Models::BalanceListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token List balances for all financial accounts of a given account_token. + # + # @option params [Time] :balance_date UTC date and time of the balances to retrieve. Defaults to latest available + # balances + # + # @option params [String] :business_account_token List balances for all financial accounts of a given business_account_token. + # + # @option params [Symbol, Lithic::Models::BalanceListParams::FinancialAccountType] :financial_account_type List balances for a given Financial Account type. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(params = {}) + parsed, options = Lithic::Models::BalanceListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/balances", + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::Balance, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/book_transfers.rb b/lib/lithic/resources/book_transfers.rb new file mode 100644 index 00000000..14872d93 --- /dev/null +++ b/lib/lithic/resources/book_transfers.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class BookTransfers + # Book transfer funds between two financial accounts or between a financial + # account and card + # + # @param params [Lithic::Models::BookTransferCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + # + # @option params [Symbol, Lithic::Models::BookTransferCreateParams::Category] :category Category of the book transfer + # + # @option params [String] :from_financial_account_token Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @option params [String] :subtype The program specific subtype code for the specified category/type. + # + # @option params [String] :to_financial_account_token Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + # + # @option params [Symbol, Lithic::Models::BookTransferCreateParams::Type] :type Type of book_transfer + # + # @option params [String] :token Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @option params [String] :memo Optional descriptor for the transfer. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::BookTransferResponse] + def create(params) + parsed, options = Lithic::Models::BookTransferCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/book_transfers", + body: parsed, + model: Lithic::Models::BookTransferResponse, + options: options + ) + end + + # Get book transfer by token + # + # @param book_transfer_token [String] Id of the book transfer to retrieve + # + # @param params [Lithic::Models::BookTransferRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::BookTransferResponse] + def retrieve(book_transfer_token, params = {}) + @client.request( + method: :get, + path: ["v1/book_transfers/%0s", book_transfer_token], + model: Lithic::Models::BookTransferResponse, + options: params[:request_options] + ) + end + + # List book transfers + # + # @param params [Lithic::Models::BookTransferListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [String] :business_account_token + # + # @option params [Symbol, Lithic::Models::BookTransferListParams::Category] :category Book Transfer category to be returned. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [String] :financial_account_token Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [Symbol, Lithic::Models::BookTransferListParams::Result] :result Book transfer result to be returned. + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::BookTransferListParams::Status] :status Book transfer status to be returned. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::BookTransferListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/book_transfers", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::BookTransferResponse, + options: options + ) + end + + # Reverse a book transfer + # + # @param book_transfer_token [String] Id of the book transfer to retrieve + # + # @param params [Lithic::Models::BookTransferReverseParams, Hash{Symbol=>Object}] . + # + # @option params [String] :memo Optional descriptor for the reversal. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::BookTransferResponse] + def reverse(book_transfer_token, params = {}) + parsed, options = Lithic::Models::BookTransferReverseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/book_transfers/%0s/reverse", book_transfer_token], + body: parsed, + model: Lithic::Models::BookTransferResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/card_programs.rb b/lib/lithic/resources/card_programs.rb new file mode 100644 index 00000000..6092fc2f --- /dev/null +++ b/lib/lithic/resources/card_programs.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CardPrograms + # Get card program. + # + # @param card_program_token [String] Globally unique identifier for the card program. + # + # @param params [Lithic::Models::CardProgramRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::CardProgram] + def retrieve(card_program_token, params = {}) + @client.request( + method: :get, + path: ["v1/card_programs/%0s", card_program_token], + model: Lithic::Models::CardProgram, + options: params[:request_options] + ) + end + + # List card programs. + # + # @param params [Lithic::Models::CardProgramListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::CardProgramListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/card_programs", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::CardProgram, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/cards.rb b/lib/lithic/resources/cards.rb new file mode 100644 index 00000000..fc1e7c1e --- /dev/null +++ b/lib/lithic/resources/cards.rb @@ -0,0 +1,556 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Cards + # @return [Lithic::Resources::Cards::AggregateBalances] + attr_reader :aggregate_balances + + # @return [Lithic::Resources::Cards::Balances] + attr_reader :balances + + # @return [Lithic::Resources::Cards::FinancialTransactions] + attr_reader :financial_transactions + + # Create a new virtual or physical card. Parameters `shipping_address` and + # `product_id` only apply to physical cards. + # + # @param params [Lithic::Models::CardCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::CardCreateParams::Type] :type Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + # + # @option params [String] :account_token Globally unique identifier for the account that the card will be associated + # with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + # + # @option params [String] :card_program_token For card programs with more than one BIN range. This must be configured with + # Lithic before use. Identifies the card program/BIN range under which to create + # the card. If omitted, will utilize the program's default `card_program_token`. + # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + # + # @option params [Lithic::Models::Carrier] :carrier + # + # @option params [String] :digital_card_art_token Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @option params [String] :exp_month Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date will be generated. + # + # @option params [String] :exp_year Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date will be generated. + # + # @option params [String] :memo Friendly name to identify the card. + # + # @option params [String] :pin Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and + # `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + # + # @option params [String] :product_id Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + # + # @option params [String] :replacement_account_token Restricted field limited to select use cases. Lithic will reach out directly if + # this field should be used. Globally unique identifier for the replacement card's + # account. If this field is specified, `replacement_for` must also be specified. + # If `replacement_for` is specified and this field is omitted, the replacement + # card's account will be inferred from the card being replaced. + # + # @option params [String] :replacement_for Globally unique identifier for the card that this card will replace. If the card + # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is + # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + # + # @option params [Lithic::Models::ShippingAddress] :shipping_address + # + # @option params [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] :shipping_method Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @option params [Integer] :spend_limit Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + # + # @option params [Symbol, Lithic::Models::SpendLimitDuration] :spend_limit_duration Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @option params [Symbol, Lithic::Models::CardCreateParams::State] :state Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Card] + def create(params) + parsed, options = Lithic::Models::CardCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/cards", + body: parsed, + model: Lithic::Models::Card, + options: options + ) + end + + # Get card configuration such as spend limit and state. + # + # @param card_token [String] + # + # @param params [Lithic::Models::CardRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Card] + def retrieve(card_token, params = {}) + @client.request( + method: :get, + path: ["v1/cards/%0s", card_token], + model: Lithic::Models::Card, + options: params[:request_options] + ) + end + + # Update the specified properties of the card. Unsupplied properties will remain + # unchanged. + # + # _Note: setting a card to a `CLOSED` state is a final action that cannot be + # undone._ + # + # @param card_token [String] + # + # @param params [Lithic::Models::CardUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :digital_card_art_token Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @option params [String] :memo Friendly name to identify the card. + # + # @option params [String] :pin Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + # + # @option params [Symbol, Lithic::Models::CardUpdateParams::PinStatus] :pin_status Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + # + # @option params [Integer] :spend_limit Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + # + # @option params [Symbol, Lithic::Models::SpendLimitDuration] :spend_limit_duration Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @option params [Symbol, Lithic::Models::CardUpdateParams::State] :state Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Card] + def update(card_token, params = {}) + parsed, options = Lithic::Models::CardUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/cards/%0s", card_token], + body: parsed, + model: Lithic::Models::Card, + options: options + ) + end + + # List cards. + # + # @param params [Lithic::Models::CardListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token Returns cards associated with the specified account. + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::CardListParams::State] :state Returns cards with the specified state. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::CardListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/cards", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Card, + options: options + ) + end + + # Convert a virtual card into a physical card and manufacture it. Customer must + # supply relevant fields for physical card creation including `product_id`, + # `carrier`, `shipping_method`, and `shipping_address`. The card token will be + # unchanged. The card's type will be altered to `PHYSICAL`. The card will be set + # to state `PENDING_FULFILLMENT` and fulfilled at next fulfillment cycle. Virtual + # cards created on card programs which do not support physical cards cannot be + # converted. The card program cannot be changed as part of the conversion. Cards + # must be in an `OPEN` state to be converted. Only applies to cards of type + # `VIRTUAL` (or existing cards with deprecated types of `DIGITAL_WALLET` and + # `UNLOCKED`). + # + # @param card_token [String] + # + # @param params [Lithic::Models::CardConvertPhysicalParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::Models::ShippingAddress] :shipping_address The shipping address this card will be sent to. + # + # @option params [Lithic::Models::Carrier] :carrier If omitted, the previous carrier will be used. + # + # @option params [String] :product_id Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @option params [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod] :shipping_method Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Card] + def convert_physical(card_token, params) + parsed, options = Lithic::Models::CardConvertPhysicalParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%0s/convert_physical", card_token], + body: parsed, + model: Lithic::Models::Card, + options: options + ) + end + + # Handling full card PANs and CVV codes requires that you comply with the Payment + # Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce + # their compliance obligations by leveraging our embedded card UI solution + # documented below. + # + # In this setup, PANs and CVV codes are presented to the end-user via a card UI + # that we provide, optionally styled in the customer's branding using a specified + # css stylesheet. A user's browser makes the request directly to api.lithic.com, + # so card PANs and CVVs never touch the API customer's servers while full card + # data is displayed to their end-users. The response contains an HTML document + # (see Embedded Card UI or Changelog for upcoming changes in January). This means + # that the url for the request can be inserted straight into the `src` attribute + # of an iframe. + # + # ```html + # + # ``` + # + # You should compute the request payload on the server side. You can render it (or + # the whole iframe) on the server or make an ajax call from your front end code, + # but **do not ever embed your API key into front end code, as doing so introduces + # a serious security vulnerability**. + # + # @param params [Lithic::Models::CardEmbedParams, Hash{Symbol=>Object}] . + # + # @option params [String] :embed_request A base64 encoded JSON string of an EmbedRequest to specify which card to load. + # + # @option params [String] :hmac SHA256 HMAC of the embed_request JSON string with base64 digest. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [String] + def embed(params) + parsed, options = Lithic::Models::CardEmbedParams.dump_request(params) + @client.request( + method: :get, + path: "v1/embed/card", + query: parsed, + headers: {"accept" => "text/html"}, + model: String, + options: options + ) + end + + # Allow your cardholders to directly add payment cards to the device's digital + # wallet (e.g. Apple Pay) with one touch from your app. + # + # This requires some additional setup and configuration. Please + # [Contact Us](https://lithic.com/contact) or your Customer Success representative + # for more information. + # + # @param card_token [String] The unique token of the card to add to the device's digital wallet. + # + # @param params [Lithic::Models::CardProvisionParams, Hash{Symbol=>Object}] . + # + # @option params [String] :certificate Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + # + # @option params [String] :client_device_id Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + # + # @option params [String] :client_wallet_account_id Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + # + # @option params [Symbol, Lithic::Models::CardProvisionParams::DigitalWallet] :digital_wallet Name of digital wallet provider. + # + # @option params [String] :nonce Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + # + # @option params [String] :nonce_signature Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::CardProvisionResponse] + def provision(card_token, params = {}) + parsed, options = Lithic::Models::CardProvisionParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%0s/provision", card_token], + body: parsed, + model: Lithic::Models::CardProvisionResponse, + options: options + ) + end + + # Initiate print and shipment of a duplicate physical card (e.g. card is + # physically damaged). The PAN, expiry, and CVC2 will remain the same and the + # original card can continue to be used until the new card is activated. Only + # applies to cards of type `PHYSICAL`. A card can be replaced or renewed a total + # of 8 times. + # + # @param card_token [String] + # + # @param params [Lithic::Models::CardReissueParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::Models::Carrier] :carrier If omitted, the previous carrier will be used. + # + # @option params [String] :product_id Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @option params [Lithic::Models::ShippingAddress] :shipping_address If omitted, the previous shipping address will be used. + # + # @option params [Symbol, Lithic::Models::CardReissueParams::ShippingMethod] :shipping_method Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Card] + def reissue(card_token, params = {}) + parsed, options = Lithic::Models::CardReissueParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%0s/reissue", card_token], + body: parsed, + model: Lithic::Models::Card, + options: options + ) + end + + # Creates a new card with the same card token and PAN, but updated expiry and CVC2 + # code. The original card will keep working for card-present transactions until + # the new card is activated. For card-not-present transactions, the original card + # details (expiry, CVC2) will also keep working until the new card is activated. + # Applies to card types `PHYSICAL` and `VIRTUAL`. A card can be replaced or + # renewed a total of 8 times. + # + # @param card_token [String] + # + # @param params [Lithic::Models::CardRenewParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::Models::ShippingAddress] :shipping_address The shipping address this card will be sent to. + # + # @option params [Lithic::Models::Carrier] :carrier If omitted, the previous carrier will be used. + # + # @option params [String] :exp_month Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date six years in the future will be generated. + # + # @option params [String] :exp_year Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date six years in the future will be generated. + # + # @option params [String] :product_id Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @option params [Symbol, Lithic::Models::CardRenewParams::ShippingMethod] :shipping_method Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Card] + def renew(card_token, params) + parsed, options = Lithic::Models::CardRenewParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%0s/renew", card_token], + body: parsed, + model: Lithic::Models::Card, + options: options + ) + end + + # Get a Card's available spend limit, which is based on the spend limit configured + # on the Card and the amount already spent over the spend limit's duration. For + # example, if the Card has a monthly spend limit of $1000 configured, and has + # spent $600 in the last month, the available spend limit returned would be $400. + # + # @param card_token [String] + # + # @param params [Lithic::Models::CardRetrieveSpendLimitsParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::CardSpendLimits] + def retrieve_spend_limits(card_token, params = {}) + @client.request( + method: :get, + path: ["v1/cards/%0s/spend_limits", card_token], + model: Lithic::Models::CardSpendLimits, + options: params[:request_options] + ) + end + + # Get card configuration such as spend limit and state. Customers must be PCI + # compliant to use this endpoint. Please contact + # [support@lithic.com](mailto:support@lithic.com) for questions. _Note: this is a + # `POST` endpoint because it is more secure to send sensitive data in a request + # body than in a URL._ + # + # @param params [Lithic::Models::CardSearchByPanParams, Hash{Symbol=>Object}] . + # + # @option params [String] :pan The PAN for the card being retrieved. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Card] + def search_by_pan(params) + parsed, options = Lithic::Models::CardSearchByPanParams.dump_request(params) + @client.request( + method: :post, + path: "v1/cards/search_by_pan", + body: parsed, + model: Lithic::Models::Card, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @aggregate_balances = Lithic::Resources::Cards::AggregateBalances.new(client: client) + @balances = Lithic::Resources::Cards::Balances.new(client: client) + @financial_transactions = Lithic::Resources::Cards::FinancialTransactions.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/cards/aggregate_balances.rb b/lib/lithic/resources/cards/aggregate_balances.rb new file mode 100644 index 00000000..50839d7c --- /dev/null +++ b/lib/lithic/resources/cards/aggregate_balances.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Cards + class AggregateBalances + # Get the aggregated card balance across all end-user accounts. + # + # @param params [Lithic::Models::Cards::AggregateBalanceListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token Cardholder to retrieve aggregate balances for. + # + # @option params [String] :business_account_token Business to retrieve aggregate balances for. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(params = {}) + parsed, options = Lithic::Models::Cards::AggregateBalanceListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/cards/aggregate_balances", + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::Cards::AggregateBalanceListResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/cards/balances.rb b/lib/lithic/resources/cards/balances.rb new file mode 100644 index 00000000..ee38dc8a --- /dev/null +++ b/lib/lithic/resources/cards/balances.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Cards + class Balances + # Get the balances for a given card. + # + # @param card_token [String] + # + # @param params [Lithic::Models::Cards::BalanceListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :balance_date UTC date of the balance to retrieve. Defaults to latest available balance + # + # @option params [String] :last_transaction_event_token Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(card_token, params = {}) + parsed, options = Lithic::Models::Cards::BalanceListParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/cards/%0s/balances", card_token], + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::Cards::BalanceListResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/cards/financial_transactions.rb b/lib/lithic/resources/cards/financial_transactions.rb new file mode 100644 index 00000000..f133fb85 --- /dev/null +++ b/lib/lithic/resources/cards/financial_transactions.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Cards + class FinancialTransactions + # Get the card financial transaction for the provided token. + # + # @param financial_transaction_token [String] Globally unique identifier for financial transaction token. + # + # @param params [Lithic::Models::Cards::FinancialTransactionRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [String] :card_token + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialTransaction] + def retrieve(financial_transaction_token, params) + parsed, options = Lithic::Models::Cards::FinancialTransactionRetrieveParams.dump_request(params) + card_token = + parsed.delete(:card_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/cards/%0s/financial_transactions/%1s", card_token, financial_transaction_token], + model: Lithic::Models::FinancialTransaction, + options: options + ) + end + + # List the financial transactions for a given card. + # + # @param card_token [String] + # + # @param params [Lithic::Models::Cards::FinancialTransactionListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category] :category Financial Transaction category to be returned. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result] :result Financial Transaction result to be returned. + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status] :status Financial Transaction status to be returned. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(card_token, params = {}) + parsed, options = Lithic::Models::Cards::FinancialTransactionListParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/cards/%0s/financial_transactions", card_token], + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::FinancialTransaction, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/credit_products.rb b/lib/lithic/resources/credit_products.rb new file mode 100644 index 00000000..54b3b4e9 --- /dev/null +++ b/lib/lithic/resources/credit_products.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CreditProducts + # @return [Lithic::Resources::CreditProducts::ExtendedCredit] + attr_reader :extended_credit + + # @return [Lithic::Resources::CreditProducts::PrimeRates] + attr_reader :prime_rates + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @extended_credit = Lithic::Resources::CreditProducts::ExtendedCredit.new(client: client) + @prime_rates = Lithic::Resources::CreditProducts::PrimeRates.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/credit_products/extended_credit.rb b/lib/lithic/resources/credit_products/extended_credit.rb new file mode 100644 index 00000000..fccd76c5 --- /dev/null +++ b/lib/lithic/resources/credit_products/extended_credit.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CreditProducts + class ExtendedCredit + # Get the extended credit for a given credit product under a program + # + # @param credit_product_token [String] Credit Product Token + # + # @param params [Lithic::Models::CreditProducts::ExtendedCreditRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::CreditProducts::CreditProductsExtendedCredit] + def retrieve(credit_product_token, params = {}) + @client.request( + method: :get, + path: ["v1/credit_products/%0s/extended_credit", credit_product_token], + model: Lithic::Models::CreditProducts::CreditProductsExtendedCredit, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/credit_products/prime_rates.rb b/lib/lithic/resources/credit_products/prime_rates.rb new file mode 100644 index 00000000..4ec6dea2 --- /dev/null +++ b/lib/lithic/resources/credit_products/prime_rates.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CreditProducts + class PrimeRates + # Post Credit Product Prime Rate + # + # @param credit_product_token [String] Globally unique identifier for credit products. + # + # @param params [Lithic::Models::CreditProducts::PrimeRateCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :effective_date Date the rate goes into effect + # + # @option params [String] :rate The rate in decimal format + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def create(credit_product_token, params) + parsed, options = Lithic::Models::CreditProducts::PrimeRateCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/credit_products/%0s/prime_rates", credit_product_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # Get Credit Product Prime Rates + # + # @param credit_product_token [String] Globally unique identifier for credit products. + # + # @param params [Lithic::Models::CreditProducts::PrimeRateRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :ending_before The effective date that the prime rates ends before + # + # @option params [Date] :starting_after The effective date that the prime rate starts after + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::CreditProducts::PrimeRateRetrieveResponse] + def retrieve(credit_product_token, params = {}) + parsed, options = Lithic::Models::CreditProducts::PrimeRateRetrieveParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/credit_products/%0s/prime_rates", credit_product_token], + query: parsed, + model: Lithic::Models::CreditProducts::PrimeRateRetrieveResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/digital_card_art.rb b/lib/lithic/resources/digital_card_art.rb new file mode 100644 index 00000000..b86920b7 --- /dev/null +++ b/lib/lithic/resources/digital_card_art.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class DigitalCardArt + # Get digital card art by token. + # + # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @param params [Lithic::Models::DigitalCardArtRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::DigitalCardArtAPI] + def retrieve(digital_card_art_token, params = {}) + @client.request( + method: :get, + path: ["v1/digital_card_art/%0s", digital_card_art_token], + model: Lithic::Models::DigitalCardArtAPI, + options: params[:request_options] + ) + end + + # List digital card art. + # + # @param params [Lithic::Models::DigitalCardArtListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::DigitalCardArtListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/digital_card_art", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::DigitalCardArtAPI, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/disputes.rb b/lib/lithic/resources/disputes.rb new file mode 100644 index 00000000..eb27c46f --- /dev/null +++ b/lib/lithic/resources/disputes.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Disputes + # Initiate a dispute. + # + # @param params [Lithic::Models::DisputeCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount Amount to dispute + # + # @option params [Symbol, Lithic::Models::DisputeCreateParams::Reason] :reason Reason for dispute + # + # @option params [String] :transaction_token Transaction to dispute + # + # @option params [Time] :customer_filed_date Date the customer filed the dispute + # + # @option params [String] :customer_note Customer description of dispute + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Dispute] + def create(params) + parsed, options = Lithic::Models::DisputeCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/disputes", + body: parsed, + model: Lithic::Models::Dispute, + options: options + ) + end + + # Get dispute. + # + # @param dispute_token [String] + # + # @param params [Lithic::Models::DisputeRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Dispute] + def retrieve(dispute_token, params = {}) + @client.request( + method: :get, + path: ["v1/disputes/%0s", dispute_token], + model: Lithic::Models::Dispute, + options: params[:request_options] + ) + end + + # Update dispute. Can only be modified if status is `NEW`. + # + # @param dispute_token [String] + # + # @param params [Lithic::Models::DisputeUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount Amount to dispute + # + # @option params [Time] :customer_filed_date Date the customer filed the dispute + # + # @option params [String] :customer_note Customer description of dispute + # + # @option params [Symbol, Lithic::Models::DisputeUpdateParams::Reason] :reason Reason for dispute + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Dispute] + def update(dispute_token, params = {}) + parsed, options = Lithic::Models::DisputeUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/disputes/%0s", dispute_token], + body: parsed, + model: Lithic::Models::Dispute, + options: options + ) + end + + # List disputes. + # + # @param params [Lithic::Models::DisputeListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::DisputeListParams::Status] :status List disputes of a specific status. + # + # @option params [Array] :transaction_tokens Transaction tokens to filter by. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::DisputeListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/disputes", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Dispute, + options: options + ) + end + + # Withdraw dispute. + # + # @param dispute_token [String] + # + # @param params [Lithic::Models::DisputeDeleteParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Dispute] + def delete(dispute_token, params = {}) + @client.request( + method: :delete, + path: ["v1/disputes/%0s", dispute_token], + model: Lithic::Models::Dispute, + options: params[:request_options] + ) + end + + # Soft delete evidence for a dispute. Evidence will not be reviewed or submitted + # by Lithic after it is withdrawn. + # + # @param evidence_token [String] + # + # @param params [Lithic::Models::DisputeDeleteEvidenceParams, Hash{Symbol=>Object}] . + # + # @option params [String] :dispute_token + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::DisputeEvidence] + def delete_evidence(evidence_token, params) + parsed, options = Lithic::Models::DisputeDeleteEvidenceParams.dump_request(params) + dispute_token = + parsed.delete(:dispute_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/disputes/%0s/evidences/%1s", dispute_token, evidence_token], + model: Lithic::Models::DisputeEvidence, + options: options + ) + end + + # Use this endpoint to upload evidences for the dispute. It will return a URL to + # upload your documents to. The URL will expire in 30 minutes. + # + # Uploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be + # less than 5 GiB. + # + # @param dispute_token [String] + # + # @param params [Lithic::Models::DisputeInitiateEvidenceUploadParams, Hash{Symbol=>Object}] . + # + # @option params [String] :filename Filename of the evidence. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::DisputeEvidence] + def initiate_evidence_upload(dispute_token, params = {}) + parsed, options = Lithic::Models::DisputeInitiateEvidenceUploadParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/disputes/%0s/evidences", dispute_token], + body: parsed, + model: Lithic::Models::DisputeEvidence, + options: options + ) + end + + # List evidence metadata for a dispute. + # + # @param dispute_token [String] + # + # @param params [Lithic::Models::DisputeListEvidencesParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list_evidences(dispute_token, params = {}) + parsed, options = Lithic::Models::DisputeListEvidencesParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/disputes/%0s/evidences", dispute_token], + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::DisputeEvidence, + options: options + ) + end + + # Get a dispute's evidence metadata. + # + # @param evidence_token [String] + # + # @param params [Lithic::Models::DisputeRetrieveEvidenceParams, Hash{Symbol=>Object}] . + # + # @option params [String] :dispute_token + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::DisputeEvidence] + def retrieve_evidence(evidence_token, params) + parsed, options = Lithic::Models::DisputeRetrieveEvidenceParams.dump_request(params) + dispute_token = + parsed.delete(:dispute_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/disputes/%0s/evidences/%1s", dispute_token, evidence_token], + model: Lithic::Models::DisputeEvidence, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/events.rb b/lib/lithic/resources/events.rb new file mode 100644 index 00000000..4d7b3192 --- /dev/null +++ b/lib/lithic/resources/events.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Events + # @return [Lithic::Resources::Events::Subscriptions] + attr_reader :subscriptions + + # Get an event. + # + # @param event_token [String] + # + # @param params [Lithic::Models::EventRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Event] + def retrieve(event_token, params = {}) + @client.request( + method: :get, + path: ["v1/events/%0s", event_token], + model: Lithic::Models::Event, + options: params[:request_options] + ) + end + + # List all events. + # + # @param params [Lithic::Models::EventListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Array] :event_types Event types to filter events by. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Boolean] :with_content Whether to include the event payload content in the response. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::EventListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/events", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Event, + options: options + ) + end + + # List all the message attempts for a given event. + # + # @param event_token [String] + # + # @param params [Lithic::Models::EventListAttemptsParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::EventListAttemptsParams::Status] :status + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list_attempts(event_token, params = {}) + parsed, options = Lithic::Models::EventListAttemptsParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/events/%0s/attempts", event_token], + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::MessageAttempt, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @subscriptions = Lithic::Resources::Events::Subscriptions.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/events/subscriptions.rb b/lib/lithic/resources/events/subscriptions.rb new file mode 100644 index 00000000..5bd10ef6 --- /dev/null +++ b/lib/lithic/resources/events/subscriptions.rb @@ -0,0 +1,285 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Events + class Subscriptions + # Create a new event subscription. + # + # @param params [Lithic::Models::Events::SubscriptionCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :url URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @option params [String] :description Event subscription description. + # + # @option params [Boolean] :disabled Whether the event subscription is active (false) or inactive (true). + # + # @option params [Array] :event_types Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::EventSubscription] + def create(params) + parsed, options = Lithic::Models::Events::SubscriptionCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/event_subscriptions", + body: parsed, + model: Lithic::Models::EventSubscription, + options: options + ) + end + + # Get an event subscription. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::EventSubscription] + def retrieve(event_subscription_token, params = {}) + @client.request( + method: :get, + path: ["v1/event_subscriptions/%0s", event_subscription_token], + model: Lithic::Models::EventSubscription, + options: params[:request_options] + ) + end + + # Update an event subscription. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :url URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @option params [String] :description Event subscription description. + # + # @option params [Boolean] :disabled Whether the event subscription is active (false) or inactive (true). + # + # @option params [Array] :event_types Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::EventSubscription] + def update(event_subscription_token, params) + parsed, options = Lithic::Models::Events::SubscriptionUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/event_subscriptions/%0s", event_subscription_token], + body: parsed, + model: Lithic::Models::EventSubscription, + options: options + ) + end + + # List all the event subscriptions. + # + # @param params [Lithic::Models::Events::SubscriptionListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::Events::SubscriptionListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/event_subscriptions", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::EventSubscription, + options: options + ) + end + + # Delete an event subscription. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionDeleteParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def delete(event_subscription_token, params = {}) + @client.request( + method: :delete, + path: ["v1/event_subscriptions/%0s", event_subscription_token], + model: NilClass, + options: params[:request_options] + ) + end + + # List all the message attempts for a given event subscription. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionListAttemptsParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status] :status + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list_attempts(event_subscription_token, params = {}) + parsed, options = Lithic::Models::Events::SubscriptionListAttemptsParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/event_subscriptions/%0s/attempts", event_subscription_token], + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::MessageAttempt, + options: options + ) + end + + # Resend all failed messages since a given time. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionRecoverParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def recover(event_subscription_token, params = {}) + parsed, options = Lithic::Models::Events::SubscriptionRecoverParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/event_subscriptions/%0s/recover", event_subscription_token], + query: parsed, + model: NilClass, + options: options + ) + end + + # Replays messages to the endpoint. Only messages that were created after `begin` + # will be sent. Messages that were previously sent to the endpoint are not resent. + # Message will be retried if endpoint responds with a non-2xx status code. See + # [Retry Schedule](https://docs.lithic.com/docs/events-api#retry-schedule) for + # details. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionReplayMissingParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def replay_missing(event_subscription_token, params = {}) + parsed, options = Lithic::Models::Events::SubscriptionReplayMissingParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/event_subscriptions/%0s/replay_missing", event_subscription_token], + query: parsed, + model: NilClass, + options: options + ) + end + + # Get the secret for an event subscription. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionRetrieveSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Events::SubscriptionRetrieveSecretResponse] + def retrieve_secret(event_subscription_token, params = {}) + @client.request( + method: :get, + path: ["v1/event_subscriptions/%0s/secret", event_subscription_token], + model: Lithic::Models::Events::SubscriptionRetrieveSecretResponse, + options: params[:request_options] + ) + end + + # Rotate the secret for an event subscription. The previous secret will be valid + # for the next 24 hours. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionRotateSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def rotate_secret(event_subscription_token, params = {}) + @client.request( + method: :post, + path: ["v1/event_subscriptions/%0s/secret/rotate", event_subscription_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Send an example message for event. + # + # @param event_subscription_token [String] + # + # @param params [Lithic::Models::Events::SubscriptionSendSimulatedExampleParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType] :event_type Event type to send example message for. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def send_simulated_example(event_subscription_token, params = {}) + parsed, options = Lithic::Models::Events::SubscriptionSendSimulatedExampleParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/simulate/event_subscriptions/%0s/send_example", event_subscription_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/external_bank_accounts.rb b/lib/lithic/resources/external_bank_accounts.rb new file mode 100644 index 00000000..c39f09a6 --- /dev/null +++ b/lib/lithic/resources/external_bank_accounts.rb @@ -0,0 +1,214 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ExternalBankAccounts + # @return [Lithic::Resources::ExternalBankAccounts::MicroDeposits] + attr_reader :micro_deposits + + # Creates an external bank account within a program or Lithic account. + # + # @param params [Lithic::Models::ExternalBankAccountCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_number Account Number + # + # @option params [String] :country The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @option params [String] :currency currency of the external account 3-character alphabetic ISO 4217 code + # + # @option params [String] :financial_account_token The financial account token of the operating account to fund the micro deposits + # + # @option params [String] :owner Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @option params [Symbol, Lithic::Models::OwnerType] :owner_type Owner Type + # + # @option params [String] :routing_number Routing Number + # + # @option params [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Type] :type Account Type + # + # @option params [Symbol, Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod] :verification_method Verification Method + # + # @option params [String] :processor_token + # + # @option params [String] :account_token Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @option params [Lithic::Models::ExternalBankAccountAddress] :address Address + # + # @option params [String] :company_id Optional field that helps identify bank accounts in receipts + # + # @option params [Date] :dob Date of Birth of the Individual that owns the external bank account + # + # @option params [String] :doing_business_as Doing Business As + # + # @option params [String] :name The nickname for this External Bank Account + # + # @option params [String] :user_defined_id User Defined ID + # + # @option params [Boolean] :verification_enforcement + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalBankAccountCreateResponse] + def create(params) + parsed, options = Lithic::Models::ExternalBankAccountCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/external_bank_accounts", + body: parsed, + model: Lithic::Models::ExternalBankAccountCreateResponse, + options: options + ) + end + + # Get the external bank account by token. + # + # @param external_bank_account_token [String] + # + # @param params [Lithic::Models::ExternalBankAccountRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalBankAccountRetrieveResponse] + def retrieve(external_bank_account_token, params = {}) + @client.request( + method: :get, + path: ["v1/external_bank_accounts/%0s", external_bank_account_token], + model: Lithic::Models::ExternalBankAccountRetrieveResponse, + options: params[:request_options] + ) + end + + # Update the external bank account by token. + # + # @param external_bank_account_token [String] + # + # @param params [Lithic::Models::ExternalBankAccountUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::Models::ExternalBankAccountAddress] :address Address + # + # @option params [String] :company_id Optional field that helps identify bank accounts in receipts + # + # @option params [Date] :dob Date of Birth of the Individual that owns the external bank account + # + # @option params [String] :doing_business_as Doing Business As + # + # @option params [String] :name The nickname for this External Bank Account + # + # @option params [String] :owner Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @option params [Symbol, Lithic::Models::OwnerType] :owner_type Owner Type + # + # @option params [Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type] :type + # + # @option params [String] :user_defined_id User Defined ID + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalBankAccountUpdateResponse] + def update(external_bank_account_token, params = {}) + parsed, options = Lithic::Models::ExternalBankAccountUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/external_bank_accounts/%0s", external_bank_account_token], + body: parsed, + model: Lithic::Models::ExternalBankAccountUpdateResponse, + options: options + ) + end + + # List all the external bank accounts for the provided search criteria. + # + # @param params [Lithic::Models::ExternalBankAccountListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token + # + # @option params [Array] :account_types + # + # @option params [Array] :countries + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Array] :owner_types + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Array] :states + # + # @option params [Array] :verification_states + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::ExternalBankAccountListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/external_bank_accounts", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::ExternalBankAccountListResponse, + options: options + ) + end + + # Retry external bank account micro deposit verification. + # + # @param external_bank_account_token [String] + # + # @param params [Lithic::Models::ExternalBankAccountRetryMicroDepositsParams, Hash{Symbol=>Object}] . + # + # @option params [String] :financial_account_token + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse] + def retry_micro_deposits(external_bank_account_token, params = {}) + parsed, options = Lithic::Models::ExternalBankAccountRetryMicroDepositsParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%0s/retry_micro_deposits", external_bank_account_token], + body: parsed, + model: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse, + options: options + ) + end + + # Retry external bank account prenote verification. + # + # @param external_bank_account_token [String] + # + # @param params [Lithic::Models::ExternalBankAccountRetryPrenoteParams, Hash{Symbol=>Object}] . + # + # @option params [String] :financial_account_token + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalBankAccountRetryPrenoteResponse] + def retry_prenote(external_bank_account_token, params = {}) + parsed, options = Lithic::Models::ExternalBankAccountRetryPrenoteParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%0s/retry_prenote", external_bank_account_token], + body: parsed, + model: Lithic::Models::ExternalBankAccountRetryPrenoteResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @micro_deposits = Lithic::Resources::ExternalBankAccounts::MicroDeposits.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/external_bank_accounts/micro_deposits.rb b/lib/lithic/resources/external_bank_accounts/micro_deposits.rb new file mode 100644 index 00000000..fb78fb6f --- /dev/null +++ b/lib/lithic/resources/external_bank_accounts/micro_deposits.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ExternalBankAccounts + class MicroDeposits + # Verify the external bank account by providing the micro deposit amounts. + # + # @param external_bank_account_token [String] + # + # @param params [Lithic::Models::ExternalBankAccounts::MicroDepositCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Array] :micro_deposits + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse] + def create(external_bank_account_token, params) + parsed, options = Lithic::Models::ExternalBankAccounts::MicroDepositCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%0s/micro_deposits", external_bank_account_token], + body: parsed, + model: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/external_payments.rb b/lib/lithic/resources/external_payments.rb new file mode 100644 index 00000000..fe949377 --- /dev/null +++ b/lib/lithic/resources/external_payments.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ExternalPayments + # Create external payment + # + # @param params [Lithic::Models::ExternalPaymentCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount + # + # @option params [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] :category + # + # @option params [Date] :effective_date + # + # @option params [String] :financial_account_token + # + # @option params [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] :payment_type + # + # @option params [String] :token + # + # @option params [String] :memo + # + # @option params [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo] :progress_to + # + # @option params [String] :user_defined_id + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalPayment] + def create(params) + parsed, options = Lithic::Models::ExternalPaymentCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/external_payments", + body: parsed, + model: Lithic::Models::ExternalPayment, + options: options + ) + end + + # Get external payment + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param params [Lithic::Models::ExternalPaymentRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalPayment] + def retrieve(external_payment_token, params = {}) + @client.request( + method: :get, + path: ["v1/external_payments/%0s", external_payment_token], + model: Lithic::Models::ExternalPayment, + options: params[:request_options] + ) + end + + # List external payments + # + # @param params [Lithic::Models::ExternalPaymentListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [String] :business_account_token + # + # @option params [Symbol, Lithic::Models::ExternalPaymentListParams::Category] :category External Payment category to be returned. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [String] :financial_account_token Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [Symbol, Lithic::Models::ExternalPaymentListParams::Result] :result External Payment result to be returned. + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::ExternalPaymentListParams::Status] :status Book transfer status to be returned. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::ExternalPaymentListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/external_payments", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::ExternalPayment, + options: options + ) + end + + # Cancel external payment + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param params [Lithic::Models::ExternalPaymentCancelParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :effective_date + # + # @option params [String] :memo + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalPayment] + def cancel(external_payment_token, params) + parsed, options = Lithic::Models::ExternalPaymentCancelParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%0s/cancel", external_payment_token], + body: parsed, + model: Lithic::Models::ExternalPayment, + options: options + ) + end + + # Release external payment + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param params [Lithic::Models::ExternalPaymentReleaseParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :effective_date + # + # @option params [String] :memo + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalPayment] + def release(external_payment_token, params) + parsed, options = Lithic::Models::ExternalPaymentReleaseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%0s/release", external_payment_token], + body: parsed, + model: Lithic::Models::ExternalPayment, + options: options + ) + end + + # Reverse external payment + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param params [Lithic::Models::ExternalPaymentReverseParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :effective_date + # + # @option params [String] :memo + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalPayment] + def reverse(external_payment_token, params) + parsed, options = Lithic::Models::ExternalPaymentReverseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%0s/reverse", external_payment_token], + body: parsed, + model: Lithic::Models::ExternalPayment, + options: options + ) + end + + # Settle external payment + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param params [Lithic::Models::ExternalPaymentSettleParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :effective_date + # + # @option params [String] :memo + # + # @option params [Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo] :progress_to + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ExternalPayment] + def settle(external_payment_token, params) + parsed, options = Lithic::Models::ExternalPaymentSettleParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%0s/settle", external_payment_token], + body: parsed, + model: Lithic::Models::ExternalPayment, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts.rb b/lib/lithic/resources/financial_accounts.rb new file mode 100644 index 00000000..412f1043 --- /dev/null +++ b/lib/lithic/resources/financial_accounts.rb @@ -0,0 +1,152 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + # @return [Lithic::Resources::FinancialAccounts::Balances] + attr_reader :balances + + # @return [Lithic::Resources::FinancialAccounts::FinancialTransactions] + attr_reader :financial_transactions + + # @return [Lithic::Resources::FinancialAccounts::CreditConfiguration] + attr_reader :credit_configuration + + # @return [Lithic::Resources::FinancialAccounts::Statements] + attr_reader :statements + + # @return [Lithic::Resources::FinancialAccounts::LoanTapes] + attr_reader :loan_tapes + + # Create a new financial account + # + # @param params [Lithic::Models::FinancialAccountCreateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :nickname Body param: + # + # @option params [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] :type Body param: + # + # @option params [String] :account_token Body param: + # + # @option params [Boolean] :is_for_benefit_of Body param: + # + # @option params [String] :idempotency_key Header param: + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccount] + def create(params) + parsed, options = Lithic::Models::FinancialAccountCreateParams.dump_request(params) + header_params = [:"Idempotency-Key"] + @client.request( + method: :post, + path: "v1/financial_accounts", + headers: parsed.slice(*header_params), + body: parsed.except(*header_params), + model: Lithic::Models::FinancialAccount, + options: options + ) + end + + # Get a financial account + # + # @param financial_account_token [String] + # + # @param params [Lithic::Models::FinancialAccountRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccount] + def retrieve(financial_account_token, params = {}) + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s", financial_account_token], + model: Lithic::Models::FinancialAccount, + options: params[:request_options] + ) + end + + # Update a financial account + # + # @param financial_account_token [String] + # + # @param params [Lithic::Models::FinancialAccountUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :nickname + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccount] + def update(financial_account_token, params = {}) + parsed, options = Lithic::Models::FinancialAccountUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/financial_accounts/%0s", financial_account_token], + body: parsed, + model: Lithic::Models::FinancialAccount, + options: options + ) + end + + # Retrieve information on your financial accounts including routing and account + # number. + # + # @param params [Lithic::Models::FinancialAccountListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token List financial accounts for a given account_token or business_account_token + # + # @option params [String] :business_account_token List financial accounts for a given business_account_token + # + # @option params [Symbol, Lithic::Models::FinancialAccountListParams::Type] :type List financial accounts of a given type + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(params = {}) + parsed, options = Lithic::Models::FinancialAccountListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/financial_accounts", + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::FinancialAccount, + options: options + ) + end + + # Update financial account status + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param params [Lithic::Models::FinancialAccountUpdateStatusParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status] :status Status of the financial account + # + # @option params [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason, nil] :status_change_reason Reason for the financial account status change + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccount] + def update_status(financial_account_token, params) + parsed, options = Lithic::Models::FinancialAccountUpdateStatusParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/financial_accounts/%0s/update_status", financial_account_token], + body: parsed, + model: Lithic::Models::FinancialAccount, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @balances = Lithic::Resources::FinancialAccounts::Balances.new(client: client) + @financial_transactions = Lithic::Resources::FinancialAccounts::FinancialTransactions.new(client: client) + @credit_configuration = Lithic::Resources::FinancialAccounts::CreditConfiguration.new(client: client) + @statements = Lithic::Resources::FinancialAccounts::Statements.new(client: client) + @loan_tapes = Lithic::Resources::FinancialAccounts::LoanTapes.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/balances.rb b/lib/lithic/resources/financial_accounts/balances.rb new file mode 100644 index 00000000..2f41c9a0 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/balances.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class Balances + # Get the balances for a given financial account. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param params [Lithic::Models::FinancialAccounts::BalanceListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :balance_date UTC date of the balance to retrieve. Defaults to latest available balance + # + # @option params [String] :last_transaction_event_token Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(financial_account_token, params = {}) + parsed, options = Lithic::Models::FinancialAccounts::BalanceListParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s/balances", financial_account_token], + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::FinancialAccounts::BalanceListResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/credit_configuration.rb b/lib/lithic/resources/financial_accounts/credit_configuration.rb new file mode 100644 index 00000000..2ac4d177 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/credit_configuration.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class CreditConfiguration + # Get an Account's credit configuration + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param params [Lithic::Models::FinancialAccounts::CreditConfigurationRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig] + def retrieve(financial_account_token, params = {}) + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s/credit_configuration", financial_account_token], + model: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig, + options: params[:request_options] + ) + end + + # Update an account's credit configuration + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param params [Lithic::Models::FinancialAccounts::CreditConfigurationUpdateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :credit_limit + # + # @option params [String] :credit_product_token Globally unique identifier for the credit product + # + # @option params [String] :external_bank_account_token + # + # @option params [String] :tier Tier to assign to a financial account + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig] + def update(financial_account_token, params = {}) + parsed, options = Lithic::Models::FinancialAccounts::CreditConfigurationUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/financial_accounts/%0s/credit_configuration", financial_account_token], + body: parsed, + model: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/financial_transactions.rb b/lib/lithic/resources/financial_accounts/financial_transactions.rb new file mode 100644 index 00000000..8fc5e59d --- /dev/null +++ b/lib/lithic/resources/financial_accounts/financial_transactions.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class FinancialTransactions + # Get the financial transaction for the provided token. + # + # @param financial_transaction_token [String] Globally unique identifier for financial transaction token. + # + # @param params [Lithic::Models::FinancialAccounts::FinancialTransactionRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [String] :financial_account_token Globally unique identifier for financial account. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialTransaction] + def retrieve(financial_transaction_token, params) + parsed, options = + Lithic::Models::FinancialAccounts::FinancialTransactionRetrieveParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: [ + "v1/financial_accounts/%0s/financial_transactions/%1s", + financial_account_token, + financial_transaction_token + ], + model: Lithic::Models::FinancialTransaction, + options: options + ) + end + + # List the financial transactions for a given financial account. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param params [Lithic::Models::FinancialAccounts::FinancialTransactionListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category] :category Financial Transaction category to be returned. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result] :result Financial Transaction result to be returned. + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status] :status Financial Transaction status to be returned. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::SinglePage] + def list(financial_account_token, params = {}) + parsed, options = Lithic::Models::FinancialAccounts::FinancialTransactionListParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s/financial_transactions", financial_account_token], + query: parsed, + page: Lithic::SinglePage, + model: Lithic::Models::FinancialTransaction, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/loan_tapes.rb b/lib/lithic/resources/financial_accounts/loan_tapes.rb new file mode 100644 index 00000000..06e7a59f --- /dev/null +++ b/lib/lithic/resources/financial_accounts/loan_tapes.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class LoanTapes + # Get a specific loan tape for a given financial account. + # + # @param loan_tape_token [String] Globally unique identifier for loan tape. + # + # @param params [Lithic::Models::FinancialAccounts::LoanTapeRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [String] :financial_account_token Globally unique identifier for financial account. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccounts::LoanTape] + def retrieve(loan_tape_token, params) + parsed, options = Lithic::Models::FinancialAccounts::LoanTapeRetrieveParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s/loan_tapes/%1s", financial_account_token, loan_tape_token], + model: Lithic::Models::FinancialAccounts::LoanTape, + options: options + ) + end + + # List the loan tapes for a given financial account. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param params [Lithic::Models::FinancialAccounts::LoanTapeListParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :begin_ Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + # + # @option params [Date] :end_ Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(financial_account_token, params = {}) + parsed, options = Lithic::Models::FinancialAccounts::LoanTapeListParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s/loan_tapes", financial_account_token], + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::FinancialAccounts::LoanTape, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/statements.rb b/lib/lithic/resources/financial_accounts/statements.rb new file mode 100644 index 00000000..ca42f325 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/statements.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class Statements + # @return [Lithic::Resources::FinancialAccounts::Statements::LineItems] + attr_reader :line_items + + # Get a specific statement for a given financial account. + # + # @param statement_token [String] Globally unique identifier for statements. + # + # @param params [Lithic::Models::FinancialAccounts::StatementRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [String] :financial_account_token Globally unique identifier for financial account. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::FinancialAccounts::Statement] + def retrieve(statement_token, params) + parsed, options = Lithic::Models::FinancialAccounts::StatementRetrieveParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s/statements/%1s", financial_account_token, statement_token], + model: Lithic::Models::FinancialAccounts::Statement, + options: options + ) + end + + # List the statements for a given financial account. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param params [Lithic::Models::FinancialAccounts::StatementListParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :begin_ Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + # + # @option params [Date] :end_ Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Boolean] :include_initial_statements Whether to include the initial statement. It is not included by default. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(financial_account_token, params = {}) + parsed, options = Lithic::Models::FinancialAccounts::StatementListParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/financial_accounts/%0s/statements", financial_account_token], + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::FinancialAccounts::Statement, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @line_items = Lithic::Resources::FinancialAccounts::Statements::LineItems.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/statements/line_items.rb b/lib/lithic/resources/financial_accounts/statements/line_items.rb new file mode 100644 index 00000000..677770ce --- /dev/null +++ b/lib/lithic/resources/financial_accounts/statements/line_items.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class Statements + class LineItems + # List the line items for a given statement within a given financial account. + # + # @param statement_token [String] Path param: Globally unique identifier for statements. + # + # @param params [Lithic::Models::FinancialAccounts::Statements::LineItemListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :financial_account_token Path param: Globally unique identifier for financial account. + # + # @option params [String] :ending_before Query param: A cursor representing an item's token before which a page of + # results should end. Used to retrieve the previous page of results before this + # item. + # + # @option params [Integer] :page_size Query param: Page size (for pagination). + # + # @option params [String] :starting_after Query param: A cursor representing an item's token after which a page of results + # should begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(statement_token, params) + parsed, options = Lithic::Models::FinancialAccounts::Statements::LineItemListParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: [ + "v1/financial_accounts/%0s/statements/%1s/line_items", + financial_account_token, + statement_token + ], + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/management_operations.rb b/lib/lithic/resources/management_operations.rb new file mode 100644 index 00000000..b82d1ce5 --- /dev/null +++ b/lib/lithic/resources/management_operations.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ManagementOperations + # Create management operation + # + # @param params [Lithic::Models::ManagementOperationCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount + # + # @option params [Symbol, Lithic::Models::ManagementOperationCreateParams::Category] :category + # + # @option params [Symbol, Lithic::Models::ManagementOperationCreateParams::Direction] :direction + # + # @option params [Date] :effective_date + # + # @option params [Symbol, Lithic::Models::ManagementOperationCreateParams::EventType] :event_type + # + # @option params [String] :financial_account_token + # + # @option params [String] :token + # + # @option params [String] :memo + # + # @option params [String] :subtype + # + # @option params [String] :user_defined_id + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ManagementOperationTransaction] + def create(params) + parsed, options = Lithic::Models::ManagementOperationCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/management_operations", + body: parsed, + model: Lithic::Models::ManagementOperationTransaction, + options: options + ) + end + + # Get management operation + # + # @param management_operation_token [String] Globally unique identifier for the management operation + # + # @param params [Lithic::Models::ManagementOperationRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ManagementOperationTransaction] + def retrieve(management_operation_token, params = {}) + @client.request( + method: :get, + path: ["v1/management_operations/%0s", management_operation_token], + model: Lithic::Models::ManagementOperationTransaction, + options: params[:request_options] + ) + end + + # List management operations + # + # @param params [Lithic::Models::ManagementOperationListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [String] :business_account_token + # + # @option params [Symbol, Lithic::Models::ManagementOperationListParams::Category] :category Management operation category to be returned. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [String] :financial_account_token Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::ManagementOperationListParams::Status] :status Management operation status to be returned. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::ManagementOperationListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/management_operations", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::ManagementOperationTransaction, + options: options + ) + end + + # Reverse a management operation + # + # @param management_operation_token [String] Globally unique identifier for the management operation + # + # @param params [Lithic::Models::ManagementOperationReverseParams, Hash{Symbol=>Object}] . + # + # @option params [Date] :effective_date + # + # @option params [String] :memo + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ManagementOperationTransaction] + def reverse(management_operation_token, params) + parsed, options = Lithic::Models::ManagementOperationReverseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/management_operations/%0s/reverse", management_operation_token], + body: parsed, + model: Lithic::Models::ManagementOperationTransaction, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/payments.rb b/lib/lithic/resources/payments.rb new file mode 100644 index 00000000..19bd82ab --- /dev/null +++ b/lib/lithic/resources/payments.rb @@ -0,0 +1,226 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Payments + # Initiates a payment between a financial account and an external bank account. + # + # @param params [Lithic::Models::PaymentCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount + # + # @option params [String] :external_bank_account_token + # + # @option params [String] :financial_account_token + # + # @option params [Symbol, Lithic::Models::PaymentCreateParams::Method] :method_ + # + # @option params [Lithic::Models::PaymentCreateParams::MethodAttributes] :method_attributes + # + # @option params [Symbol, Lithic::Models::PaymentCreateParams::Type] :type + # + # @option params [String] :token Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @option params [String] :memo + # + # @option params [String] :user_defined_id + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::PaymentCreateResponse] + def create(params) + parsed, options = Lithic::Models::PaymentCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/payments", + body: parsed, + model: Lithic::Models::PaymentCreateResponse, + options: options + ) + end + + # Get the payment by token. + # + # @param payment_token [String] + # + # @param params [Lithic::Models::PaymentRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Payment] + def retrieve(payment_token, params = {}) + @client.request( + method: :get, + path: ["v1/payments/%0s", payment_token], + model: Lithic::Models::Payment, + options: params[:request_options] + ) + end + + # List all the payments for the provided search criteria. + # + # @param params [Lithic::Models::PaymentListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [String] :business_account_token + # + # @option params [Symbol, Lithic::Models::PaymentListParams::Category] :category + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [String] :financial_account_token + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [Symbol, Lithic::Models::PaymentListParams::Result] :result + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::PaymentListParams::Status] :status + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::PaymentListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/payments", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Payment, + options: options + ) + end + + # Retry an origination which has been returned. + # + # @param payment_token [String] + # + # @param params [Lithic::Models::PaymentRetryParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::PaymentRetryResponse] + def retry_(payment_token, params = {}) + @client.request( + method: :post, + path: ["v1/payments/%0s/retry", payment_token], + model: Lithic::Models::PaymentRetryResponse, + options: params[:request_options] + ) + end + + # Simulate payment lifecycle event + # + # @param payment_token [String] + # + # @param params [Lithic::Models::PaymentSimulateActionParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::PaymentSimulateActionParams::EventType] :event_type Event Type + # + # @option params [Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason] :decline_reason Decline reason + # + # @option params [String] :return_reason_code Return Reason Code + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::PaymentSimulateActionResponse] + def simulate_action(payment_token, params) + parsed, options = Lithic::Models::PaymentSimulateActionParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/simulate/payments/%0s/action", payment_token], + body: parsed, + model: Lithic::Models::PaymentSimulateActionResponse, + options: options + ) + end + + # Simulates a receipt of a Payment. + # + # @param params [Lithic::Models::PaymentSimulateReceiptParams, Hash{Symbol=>Object}] . + # + # @option params [String] :token Payment token + # + # @option params [Integer] :amount Amount + # + # @option params [String] :financial_account_token Financial Account Token + # + # @option params [Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType] :receipt_type Receipt Type + # + # @option params [String] :memo Memo + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::PaymentSimulateReceiptResponse] + def simulate_receipt(params) + parsed, options = Lithic::Models::PaymentSimulateReceiptParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/payments/receipt", + body: parsed, + model: Lithic::Models::PaymentSimulateReceiptResponse, + options: options + ) + end + + # Simulates a release of a Payment. + # + # @param params [Lithic::Models::PaymentSimulateReleaseParams, Hash{Symbol=>Object}] . + # + # @option params [String] :payment_token Payment Token + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::PaymentSimulateReleaseResponse] + def simulate_release(params) + parsed, options = Lithic::Models::PaymentSimulateReleaseParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/payments/release", + body: parsed, + model: Lithic::Models::PaymentSimulateReleaseResponse, + options: options + ) + end + + # Simulates a return of a Payment. + # + # @param params [Lithic::Models::PaymentSimulateReturnParams, Hash{Symbol=>Object}] . + # + # @option params [String] :payment_token Payment Token + # + # @option params [String] :return_reason_code Return Reason Code + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::PaymentSimulateReturnResponse] + def simulate_return(params) + parsed, options = Lithic::Models::PaymentSimulateReturnParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/payments/return", + body: parsed, + model: Lithic::Models::PaymentSimulateReturnResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/reports.rb b/lib/lithic/resources/reports.rb new file mode 100644 index 00000000..0a3c30bb --- /dev/null +++ b/lib/lithic/resources/reports.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Reports + # @return [Lithic::Resources::Reports::Settlement] + attr_reader :settlement + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @settlement = Lithic::Resources::Reports::Settlement.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/reports/settlement.rb b/lib/lithic/resources/reports/settlement.rb new file mode 100644 index 00000000..96b16189 --- /dev/null +++ b/lib/lithic/resources/reports/settlement.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Reports + class Settlement + # @return [Lithic::Resources::Reports::Settlement::NetworkTotals] + attr_reader :network_totals + + # List details. + # + # @param report_date [Date] Date of the settlement report to retrieve. Not available in sandbox. + # + # @param params [Lithic::Models::Reports::SettlementListDetailsParams, Hash{Symbol=>Object}] . + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list_details(report_date, params = {}) + parsed, options = Lithic::Models::Reports::SettlementListDetailsParams.dump_request(params) + @client.request( + method: :get, + path: ["v1/reports/settlement/details/%0s", report_date], + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::SettlementDetail, + options: options + ) + end + + # Get the settlement report for a specified report date. Not available in sandbox. + # + # @param report_date [Date] Date of the settlement report to retrieve. + # + # @param params [Lithic::Models::Reports::SettlementSummaryParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::SettlementReport] + def summary(report_date, params = {}) + @client.request( + method: :get, + path: ["v1/reports/settlement/summary/%0s", report_date], + model: Lithic::Models::SettlementReport, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @network_totals = Lithic::Resources::Reports::Settlement::NetworkTotals.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/reports/settlement/network_totals.rb b/lib/lithic/resources/reports/settlement/network_totals.rb new file mode 100644 index 00000000..85516343 --- /dev/null +++ b/lib/lithic/resources/reports/settlement/network_totals.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Reports + class Settlement + class NetworkTotals + # Retrieve a specific network total record by token. Not available in sandbox. + # + # @param token [String] Token of the network total record to retrieve + # + # @param params [Lithic::Models::Reports::Settlement::NetworkTotalRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse] + def retrieve(token, params = {}) + @client.request( + method: :get, + path: ["v1/reports/settlement/network_totals/%0s", token], + model: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse, + options: params[:request_options] + ) + end + + # List network total records with optional filters. Not available in sandbox. + # + # @param params [Lithic::Models::Reports::Settlement::NetworkTotalListParams, Hash{Symbol=>Object}] . + # + # @option params [Time] :begin_ Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + # + # @option params [Time] :end_ Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [String] :institution_id Institution ID to filter on. + # + # @option params [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network] :network Network to filter on. + # + # @option params [Integer] :page_size Number of records per page. + # + # @option params [Date] :report_date Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + # + # @option params [Date] :report_date_begin Earliest report date to filter on, inclusive (YYYY-MM-DD). + # + # @option params [Date] :report_date_end Latest report date to filter on, inclusive (YYYY-MM-DD). + # + # @option params [String] :settlement_institution_id Settlement institution ID to filter on. + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::Reports::Settlement::NetworkTotalListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/reports/settlement/network_totals", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Reports::Settlement::NetworkTotalListResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/responder_endpoints.rb b/lib/lithic/resources/responder_endpoints.rb new file mode 100644 index 00000000..df1fc0cc --- /dev/null +++ b/lib/lithic/resources/responder_endpoints.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ResponderEndpoints + # Enroll a responder endpoint + # + # @param params [Lithic::Models::ResponderEndpointCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::ResponderEndpointCreateParams::Type] :type The type of the endpoint. + # + # @option params [String] :url The URL for the responder endpoint (must be http(s)). + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ResponderEndpointCreateResponse] + def create(params = {}) + parsed, options = Lithic::Models::ResponderEndpointCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/responder_endpoints", + body: parsed, + model: Lithic::Models::ResponderEndpointCreateResponse, + options: options + ) + end + + # Disenroll a responder endpoint + # + # @param params [Lithic::Models::ResponderEndpointDeleteParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type] :type The type of the endpoint. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def delete(params) + parsed, options = Lithic::Models::ResponderEndpointDeleteParams.dump_request(params) + @client.request( + method: :delete, + path: "v1/responder_endpoints", + query: parsed, + model: NilClass, + options: options + ) + end + + # Check the status of a responder endpoint + # + # @param params [Lithic::Models::ResponderEndpointCheckStatusParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type] :type The type of the endpoint. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ResponderEndpointStatus] + def check_status(params) + parsed, options = Lithic::Models::ResponderEndpointCheckStatusParams.dump_request(params) + @client.request( + method: :get, + path: "v1/responder_endpoints", + query: parsed, + model: Lithic::Models::ResponderEndpointStatus, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/three_ds.rb b/lib/lithic/resources/three_ds.rb new file mode 100644 index 00000000..4532aba0 --- /dev/null +++ b/lib/lithic/resources/three_ds.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ThreeDS + # @return [Lithic::Resources::ThreeDS::Authentication] + attr_reader :authentication + + # @return [Lithic::Resources::ThreeDS::Decisioning] + attr_reader :decisioning + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @authentication = Lithic::Resources::ThreeDS::Authentication.new(client: client) + @decisioning = Lithic::Resources::ThreeDS::Decisioning.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/three_ds/authentication.rb b/lib/lithic/resources/three_ds/authentication.rb new file mode 100644 index 00000000..cf8f14e3 --- /dev/null +++ b/lib/lithic/resources/three_ds/authentication.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ThreeDS + class Authentication + # Get 3DS Authentication by token + # + # @param three_ds_authentication_token [String] 3DS Authentication Token + # + # @param params [Lithic::Models::ThreeDS::AuthenticationRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ThreeDS::AuthenticationRetrieveResponse] + def retrieve(three_ds_authentication_token, params = {}) + @client.request( + method: :get, + path: ["v1/three_ds_authentication/%0s", three_ds_authentication_token], + model: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse, + options: params[:request_options] + ) + end + + # Simulates a 3DS authentication request from the payment network as if it came + # from an ACS. If you're configured for 3DS Customer Decisioning, simulating + # authentications requires your customer decisioning endpoint to be set up + # properly (respond with a valid JSON). + # + # @param params [Lithic::Models::ThreeDS::AuthenticationSimulateParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] :merchant + # + # @option params [String] :pan Sixteen digit card number. + # + # @option params [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] :transaction + # + # @option params [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck] :card_expiry_check When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ThreeDS::AuthenticationSimulateResponse] + def simulate(params) + parsed, options = Lithic::Models::ThreeDS::AuthenticationSimulateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/three_ds_authentication/simulate", + body: parsed, + model: Lithic::Models::ThreeDS::AuthenticationSimulateResponse, + options: options + ) + end + + # Endpoint for simulating entering OTP into 3DS Challenge UI. A call to + # /v1/three_ds_authentication/simulate that resulted in triggered SMS-OTP + # challenge must precede. Only a single attempt is supported; upon entering OTP, + # the challenge is either approved or declined. + # + # @param params [Lithic::Models::ThreeDS::AuthenticationSimulateOtpEntryParams, Hash{Symbol=>Object}] . + # + # @option params [String] :token A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + # + # @option params [String] :otp The OTP entered by the cardholder + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def simulate_otp_entry(params) + parsed, options = Lithic::Models::ThreeDS::AuthenticationSimulateOtpEntryParams.dump_request(params) + @client.request( + method: :post, + path: "v1/three_ds_decisioning/simulate/enter_otp", + body: parsed, + model: NilClass, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/three_ds/decisioning.rb b/lib/lithic/resources/three_ds/decisioning.rb new file mode 100644 index 00000000..ff66edbc --- /dev/null +++ b/lib/lithic/resources/three_ds/decisioning.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ThreeDS + class Decisioning + # Card program's response to a 3DS Challenge Request (CReq) + # + # @param params [Lithic::Models::ThreeDS::DecisioningChallengeResponseParams, Hash{Symbol=>Object}] . + # + # @option params [String] :token Globally unique identifier for the 3DS authentication. This token is sent as + # part of the initial 3DS Decisioning Request and as part of the 3DS Challenge + # Event in the [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) + # object + # + # @option params [Symbol, Lithic::Models::ThreeDS::ChallengeResult] :challenge_response Whether the Cardholder has Approved or Declined the issued Challenge + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def challenge_response(params) + parsed, options = Lithic::Models::ThreeDS::DecisioningChallengeResponseParams.dump_request(params) + @client.request( + method: :post, + path: "v1/three_ds_decisioning/challenge_response", + body: parsed, + model: NilClass, + options: options + ) + end + + # Retrieve the 3DS Decisioning HMAC secret key. If one does not exist for your + # program yet, calling this endpoint will create one for you. The headers (which + # you can use to verify 3DS Decisioning requests) will begin appearing shortly + # after calling this endpoint for the first time. See + # [this page](https://docs.lithic.com/docs/3ds-decisioning#3ds-decisioning-hmac-secrets) + # for more detail about verifying 3DS Decisioning requests. + # + # @param params [Lithic::Models::ThreeDS::DecisioningRetrieveSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse] + def retrieve_secret(params = {}) + @client.request( + method: :get, + path: "v1/three_ds_decisioning/secret", + model: Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse, + options: params[:request_options] + ) + end + + # Generate a new 3DS Decisioning HMAC secret key. The old secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /three_ds_decisioning/secret`](https://docs.lithic.com/reference/getthreedsdecisioningsecret) + # request to retrieve the new secret key. + # + # @param params [Lithic::Models::ThreeDS::DecisioningRotateSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def rotate_secret(params = {}) + @client.request( + method: :post, + path: "v1/three_ds_decisioning/secret/rotate", + model: NilClass, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/tokenization_decisioning.rb b/lib/lithic/resources/tokenization_decisioning.rb new file mode 100644 index 00000000..002a37a2 --- /dev/null +++ b/lib/lithic/resources/tokenization_decisioning.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TokenizationDecisioning + # Retrieve the Tokenization Decisioning secret key. If one does not exist your + # program yet, calling this endpoint will create one for you. The headers of the + # Tokenization Decisioning request will contain a hmac signature which you can use + # to verify requests originate from Lithic. See + # [this page](https://docs.lithic.com/docs/events-api#verifying-webhooks) for more + # detail about verifying Tokenization Decisioning requests. + # + # @param params [Lithic::Models::TokenizationDecisioningRetrieveSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TokenizationSecret] + def retrieve_secret(params = {}) + @client.request( + method: :get, + path: "v1/tokenization_decisioning/secret", + model: Lithic::Models::TokenizationSecret, + options: params[:request_options] + ) + end + + # Generate a new Tokenization Decisioning secret key. The old Tokenization + # Decisioning secret key will be deactivated 24 hours after a successful request + # to this endpoint. + # + # @param params [Lithic::Models::TokenizationDecisioningRotateSecretParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TokenizationDecisioningRotateSecretResponse] + def rotate_secret(params = {}) + @client.request( + method: :post, + path: "v1/tokenization_decisioning/secret/rotate", + model: Lithic::Models::TokenizationDecisioningRotateSecretResponse, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/tokenizations.rb b/lib/lithic/resources/tokenizations.rb new file mode 100644 index 00000000..4b66404a --- /dev/null +++ b/lib/lithic/resources/tokenizations.rb @@ -0,0 +1,271 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Tokenizations + # Get tokenization + # + # @param tokenization_token [String] Tokenization token + # + # @param params [Lithic::Models::TokenizationRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TokenizationRetrieveResponse] + def retrieve(tokenization_token, params = {}) + @client.request( + method: :get, + path: ["v1/tokenizations/%0s", tokenization_token], + model: Lithic::Models::TokenizationRetrieveResponse, + options: params[:request_options] + ) + end + + # List card tokenizations + # + # @param params [Lithic::Models::TokenizationListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token Filters for tokenizations associated with a specific account. + # + # @option params [Date] :begin_ Filter for tokenizations created after this date. + # + # @option params [String] :card_token Filters for tokenizations associated with a specific card. + # + # @option params [Date] :end_ Filter for tokenizations created before this date. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel] :tokenization_channel Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::TokenizationListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/tokenizations", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Tokenization, + options: options + ) + end + + # This endpoint is used to ask the card network to activate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network activates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. The endpoint may only + # be used on digital wallet tokenizations with status `INACTIVE`, + # `PENDING_ACTIVATION`, or `PENDING_2FA`. This will put the tokenization in an + # active state, and transactions will be allowed. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @param tokenization_token [String] Tokenization token + # + # @param params [Lithic::Models::TokenizationActivateParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def activate(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%0s/activate", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used to ask the card network to deactivate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network deactivates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. Authorizations + # attempted with a deactivated tokenization will be blocked and will not be + # forwarded to Lithic from the network. Deactivating the token is a permanent + # operation. If the target is a digital wallet tokenization, it will be removed + # from its device. Reach out at [lithic.com/contact](https://lithic.com/contact) + # for more information. + # + # @param tokenization_token [String] Tokenization token + # + # @param params [Lithic::Models::TokenizationDeactivateParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def deactivate(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%0s/deactivate", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used to ask the card network to pause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network pauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `ACTIVE`. A paused token will prevent + # merchants from sending authorizations, and is a temporary status that can be + # changed. Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # + # @param tokenization_token [String] Tokenization token + # + # @param params [Lithic::Models::TokenizationPauseParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def pause(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%0s/pause", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used to ask the card network to send another activation code to + # a cardholder that has already tried tokenizing a card. A successful response + # indicates that the request was successfully delivered to the card network. The + # endpoint may only be used on Mastercard digital wallet tokenizations with status + # `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`. The network will send a new + # activation code to the one of the contact methods provided in the initial + # tokenization flow. If a user fails to enter the code correctly 3 times, the + # contact method will not be eligible for resending the activation code, and the + # cardholder must restart the provision process. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @param tokenization_token [String] Tokenization token + # + # @param params [Lithic::Models::TokenizationResendActivationCodeParams, Hash{Symbol=>Object}] . + # + # @option params [Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType] :activation_method_type The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def resend_activation_code(tokenization_token, params = {}) + parsed, options = Lithic::Models::TokenizationResendActivationCodeParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/tokenizations/%0s/resend_activation_code", tokenization_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # This endpoint is used to simulate a card's tokenization in the Digital Wallet + # and merchant tokenization ecosystem. + # + # @param params [Lithic::Models::TokenizationSimulateParams, Hash{Symbol=>Object}] . + # + # @option params [String] :cvv The three digit cvv for the card. + # + # @option params [String] :expiration_date The expiration date of the card in 'MM/YY' format. + # + # @option params [String] :pan The sixteen digit card number. + # + # @option params [Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource] :tokenization_source The source of the tokenization request. + # + # @option params [Integer] :account_score The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + # + # @option params [Integer] :device_score The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + # + # @option params [String] :entity Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + # + # @option params [Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision] :wallet_recommended_decision The decision that the Digital Wallet's recommend + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TokenizationSimulateResponse] + def simulate(params) + parsed, options = Lithic::Models::TokenizationSimulateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/tokenizations", + body: parsed, + model: Lithic::Models::TokenizationSimulateResponse, + options: options + ) + end + + # This endpoint is used to ask the card network to unpause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network unpauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `PAUSED`. This will put the tokenization in an + # active state, and transactions may resume. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @param tokenization_token [String] Tokenization token + # + # @param params [Lithic::Models::TokenizationUnpauseParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def unpause(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%0s/unpause", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used update the digital card art for a digital wallet + # tokenization. A successful response indicates that the card network has updated + # the tokenization's art, and the tokenization's `digital_cart_art_token` field + # was updated. The endpoint may not be used on tokenizations with status + # `DEACTIVATED`. Note that this updates the art for one specific tokenization, not + # all tokenizations for a card. New tokenizations for a card will be created with + # the art referenced in the card object's `digital_card_art_token` field. Reach + # out at [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @param tokenization_token [String] Tokenization token + # + # @param params [Lithic::Models::TokenizationUpdateDigitalCardArtParams, Hash{Symbol=>Object}] . + # + # @option params [String] :digital_card_art_token Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TokenizationUpdateDigitalCardArtResponse] + def update_digital_card_art(tokenization_token, params = {}) + parsed, options = Lithic::Models::TokenizationUpdateDigitalCardArtParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/tokenizations/%0s/update_digital_card_art", tokenization_token], + body: parsed, + model: Lithic::Models::TokenizationUpdateDigitalCardArtResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/transactions.rb b/lib/lithic/resources/transactions.rb new file mode 100644 index 00000000..7e3615af --- /dev/null +++ b/lib/lithic/resources/transactions.rb @@ -0,0 +1,343 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + # @return [Lithic::Resources::Transactions::EnhancedCommercialData] + attr_reader :enhanced_commercial_data + + # @return [Lithic::Resources::Transactions::Events] + attr_reader :events + + # Get a specific card transaction. All amounts are in the smallest unit of their + # respective currency (e.g., cents for USD). + # + # @param transaction_token [String] Globally unique identifier for the transaction. + # + # @param params [Lithic::Models::TransactionRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Transaction] + def retrieve(transaction_token, params = {}) + @client.request( + method: :get, + path: ["v1/transactions/%0s", transaction_token], + model: Lithic::Models::Transaction, + options: params[:request_options] + ) + end + + # List card transactions. All amounts are in the smallest unit of their respective + # currency (e.g., cents for USD) and inclusive of any acquirer fees. + # + # @param params [Lithic::Models::TransactionListParams, Hash{Symbol=>Object}] . + # + # @option params [String] :account_token Filters for transactions associated with a specific account. + # + # @option params [Time] :begin_ Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @option params [String] :card_token Filters for transactions associated with a specific card. + # + # @option params [Time] :end_ Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @option params [String] :ending_before A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @option params [Integer] :page_size Page size (for pagination). + # + # @option params [Symbol, Lithic::Models::TransactionListParams::Result] :result Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + # + # @option params [String] :starting_after A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @option params [Symbol, Lithic::Models::TransactionListParams::Status] :status Filters for transactions using transaction status field. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::CursorPage] + def list(params = {}) + parsed, options = Lithic::Models::TransactionListParams.dump_request(params) + @client.request( + method: :get, + path: "v1/transactions", + query: parsed, + page: Lithic::CursorPage, + model: Lithic::Models::Transaction, + options: options + ) + end + + # Expire authorization + # + # @param transaction_token [String] The token of the transaction to expire. + # + # @param params [Lithic::Models::TransactionExpireAuthorizationParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [nil] + def expire_authorization(transaction_token, params = {}) + @client.request( + method: :post, + path: ["v1/transactions/%0s/expire_authorization", transaction_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Simulates an authorization request from the card network as if it came from a + # merchant acquirer. If you are configured for ASA, simulating authorizations + # requires your ASA client to be set up properly, i.e. be able to respond to the + # ASA request with a valid JSON. For users that are not configured for ASA, a + # daily transaction limit of $5000 USD is applied by default. You can update this + # limit via the + # [update account](https://docs.lithic.com/reference/patchaccountbytoken) + # endpoint. + # + # @param params [Lithic::Models::TransactionSimulateAuthorizationParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + # + # @option params [String] :descriptor Merchant descriptor. + # + # @option params [String] :pan Sixteen digit card number. + # + # @option params [String] :mcc Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @option params [String] :merchant_acceptor_id Unique identifier to identify the payment card acceptor. + # + # @option params [Integer] :merchant_amount Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + # + # @option params [String] :merchant_currency 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + # + # @option params [Boolean] :partial_approval_capable Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + # + # @option params [String] :pin Simulate entering a PIN. If omitted, PIN check will not be performed. + # + # @option params [Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status] :status Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TransactionSimulateAuthorizationResponse] + def simulate_authorization(params) + parsed, options = Lithic::Models::TransactionSimulateAuthorizationParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/authorize", + body: parsed, + model: Lithic::Models::TransactionSimulateAuthorizationResponse, + options: options + ) + end + + # Simulates an authorization advice from the card network as if it came from a + # merchant acquirer. An authorization advice changes the pending amount of the + # transaction. + # + # @param params [Lithic::Models::TransactionSimulateAuthorizationAdviceParams, Hash{Symbol=>Object}] . + # + # @option params [String] :token The transaction token returned from the /v1/simulate/authorize. response. + # + # @option params [Integer] :amount Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TransactionSimulateAuthorizationAdviceResponse] + def simulate_authorization_advice(params) + parsed, options = Lithic::Models::TransactionSimulateAuthorizationAdviceParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/authorization_advice", + body: parsed, + model: Lithic::Models::TransactionSimulateAuthorizationAdviceResponse, + options: options + ) + end + + # Clears an existing authorization, either debit or credit. After this event, the + # transaction transitions from `PENDING` to `SETTLED` status. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + # + # @param params [Lithic::Models::TransactionSimulateClearingParams, Hash{Symbol=>Object}] . + # + # @option params [String] :token The transaction token returned from the /v1/simulate/authorize response. + # + # @option params [Integer] :amount Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TransactionSimulateClearingResponse] + def simulate_clearing(params) + parsed, options = Lithic::Models::TransactionSimulateClearingParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/clearing", + body: parsed, + model: Lithic::Models::TransactionSimulateClearingResponse, + options: options + ) + end + + # Simulates a credit authorization advice from the card network. This message + # indicates that the network approved a credit authorization on your behalf. + # + # @param params [Lithic::Models::TransactionSimulateCreditAuthorizationParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + # + # @option params [String] :descriptor Merchant descriptor. + # + # @option params [String] :pan Sixteen digit card number. + # + # @option params [String] :mcc Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @option params [String] :merchant_acceptor_id Unique identifier to identify the payment card acceptor. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TransactionSimulateCreditAuthorizationResponse] + def simulate_credit_authorization(params) + parsed, options = Lithic::Models::TransactionSimulateCreditAuthorizationParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/credit_authorization_advice", + body: parsed, + model: Lithic::Models::TransactionSimulateCreditAuthorizationResponse, + options: options + ) + end + + # Returns, or refunds, an amount back to a card. Returns simulated via this + # endpoint clear immediately, without prior authorization, and result in a + # `SETTLED` transaction status. + # + # @param params [Lithic::Models::TransactionSimulateReturnParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount Amount (in cents) to authorize. + # + # @option params [String] :descriptor Merchant descriptor. + # + # @option params [String] :pan Sixteen digit card number. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TransactionSimulateReturnResponse] + def simulate_return(params) + parsed, options = Lithic::Models::TransactionSimulateReturnParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/return", + body: parsed, + model: Lithic::Models::TransactionSimulateReturnResponse, + options: options + ) + end + + # Reverses a return, i.e. a credit transaction with a `SETTLED` status. Returns + # can be financial credit authorizations, or credit authorizations that have + # cleared. + # + # @param params [Lithic::Models::TransactionSimulateReturnReversalParams, Hash{Symbol=>Object}] . + # + # @option params [String] :token The transaction token returned from the /v1/simulate/authorize response. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TransactionSimulateReturnReversalResponse] + def simulate_return_reversal(params) + parsed, options = Lithic::Models::TransactionSimulateReturnReversalParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/return_reversal", + body: parsed, + model: Lithic::Models::TransactionSimulateReturnReversalResponse, + options: options + ) + end + + # Voids a pending authorization. If `amount` is not set, the full amount will be + # voided. Can be used on partially voided transactions but not partially cleared + # transactions. _Simulating an authorization expiry on credit authorizations or + # credit authorization advice is not currently supported but will be added soon._ + # + # @param params [Lithic::Models::TransactionSimulateVoidParams, Hash{Symbol=>Object}] . + # + # @option params [String] :token The transaction token returned from the /v1/simulate/authorize response. + # + # @option params [Integer] :amount Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. + # + # @option params [Symbol, Lithic::Models::TransactionSimulateVoidParams::Type] :type Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::TransactionSimulateVoidResponse] + def simulate_void(params) + parsed, options = Lithic::Models::TransactionSimulateVoidParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/void", + body: parsed, + model: Lithic::Models::TransactionSimulateVoidResponse, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @enhanced_commercial_data = Lithic::Resources::Transactions::EnhancedCommercialData.new(client: client) + @events = Lithic::Resources::Transactions::Events.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/transactions/enhanced_commercial_data.rb b/lib/lithic/resources/transactions/enhanced_commercial_data.rb new file mode 100644 index 00000000..bf1557bd --- /dev/null +++ b/lib/lithic/resources/transactions/enhanced_commercial_data.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + class EnhancedCommercialData + # Get all L2/L3 enhanced commercial data associated with a transaction. Not + # available in sandbox. + # + # @param transaction_token [String] The token of the transaction that the enhanced data is associated with. + # + # @param params [Lithic::Models::Transactions::EnhancedCommercialDataRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse] + def retrieve(transaction_token, params = {}) + @client.request( + method: :get, + path: ["v1/transactions/%0s/enhanced_commercial_data", transaction_token], + model: Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/transactions/events.rb b/lib/lithic/resources/transactions/events.rb new file mode 100644 index 00000000..babe0ba6 --- /dev/null +++ b/lib/lithic/resources/transactions/events.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + class Events + # @return [Lithic::Resources::Transactions::Events::EnhancedCommercialData] + attr_reader :enhanced_commercial_data + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @enhanced_commercial_data = + Lithic::Resources::Transactions::Events::EnhancedCommercialData.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/transactions/events/enhanced_commercial_data.rb b/lib/lithic/resources/transactions/events/enhanced_commercial_data.rb new file mode 100644 index 00000000..4507c4d6 --- /dev/null +++ b/lib/lithic/resources/transactions/events/enhanced_commercial_data.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + class Events + class EnhancedCommercialData + # Get L2/L3 enhanced commercial data associated with a transaction event. Not + # available in sandbox. + # + # @param event_token [String] The token of the transaction event that the enhanced data is associated with. + # + # @param params [Lithic::Models::Transactions::Events::EnhancedCommercialDataRetrieveParams, Hash{Symbol=>Object}] . + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Transactions::Events::EnhancedData] + def retrieve(event_token, params = {}) + @client.request( + method: :get, + path: ["v1/transactions/events/%0s/enhanced_commercial_data", event_token], + model: Lithic::Models::Transactions::Events::EnhancedData, + options: params[:request_options] + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/transfers.rb b/lib/lithic/resources/transfers.rb new file mode 100644 index 00000000..d16fd8a9 --- /dev/null +++ b/lib/lithic/resources/transfers.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transfers + # Transfer funds between two financial accounts or between a financial account and + # card + # + # @param params [Lithic::Models::TransferCreateParams, Hash{Symbol=>Object}] . + # + # @option params [Integer] :amount Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + # + # @option params [String] :from Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @option params [String] :to Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + # + # @option params [String] :token Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @option params [String] :memo Optional descriptor for the transfer. + # + # @option params [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] :request_options + # + # @return [Lithic::Models::Transfer] + def create(params) + parsed, options = Lithic::Models::TransferCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/transfer", + body: parsed, + model: Lithic::Models::Transfer, + options: options + ) + end + + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/single_page.rb b/lib/lithic/single_page.rb new file mode 100644 index 00000000..15844127 --- /dev/null +++ b/lib/lithic/single_page.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Lithic + # @example + # if single_page.has_next? + # single_page = single_page.next_page + # end + # + # @example + # single_page.auto_paging_each do |account_holder| + # puts(account_holder) + # end + # + # @example + # account_holders = + # single_page + # .to_enum + # .lazy + # .select { _1.object_id.even? } + # .map(&:itself) + # .take(2) + # .to_a + # + # account_holders => Array + class SinglePage + include Lithic::BasePage + + # @return [Array, nil] + attr_accessor :data + + # @return [Boolean] + attr_accessor :has_more + + # @api private + # + # @param client [Lithic::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param page_data [Array] + def initialize(client:, req:, headers:, page_data:) + super + model = req.fetch(:model) + + case page_data + in {data: Array | nil => data} + @data = data&.map { Lithic::Converter.coerce(model, _1) } + else + end + + case page_data + in {has_more: true | false => has_more} + @has_more = has_more + else + end + end + + # @return [Boolean] + def next_page? + has_more + end + + # @raise [Lithic::HTTP::Error] + # @return [Lithic::SinglePage] + def next_page + RuntimeError.new("No more pages available.") + end + + # @param blk [Proc] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + page = self + loop do + page.data&.each { blk.call(_1) } + break unless page.next_page? + page = page.next_page + end + end + + # @return [String] + def inspect + "#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} has_more=#{has_more.inspect}>" + end + end +end diff --git a/lib/lithic/util.rb b/lib/lithic/util.rb new file mode 100644 index 00000000..dff0c53c --- /dev/null +++ b/lib/lithic/util.rb @@ -0,0 +1,728 @@ +# frozen_string_literal: true + +module Lithic + # rubocop:disable Metrics/ModuleLength + + # @api private + module Util + # @api private + # + # @return [Float] + def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC) + + class << self + # @api private + # + # @return [String] + def arch + case (arch = RbConfig::CONFIG["arch"])&.downcase + in nil + "unknown" + in /aarch64|arm64/ + "arm64" + in /x86_64/ + "x64" + in /arm/ + "arm" + else + "other:#{arch}" + end + end + + # @api private + # + # @return [String] + def os + case (host = RbConfig::CONFIG["host_os"])&.downcase + in nil + "Unknown" + in /linux/ + "Linux" + in /darwin/ + "MacOS" + in /freebsd/ + "FreeBSD" + in /openbsd/ + "OpenBSD" + in /mswin|mingw|cygwin|ucrt/ + "Windows" + else + "Other:#{host}" + end + end + end + + class << self + # @api private + # + # @param input [Object] + # + # @return [Boolean] + def primitive?(input) + case input + in true | false | Integer | Float | Symbol | String + true + else + false + end + end + + # @api private + # + # @param input [Object] + # + # @return [Boolean, Object] + def coerce_boolean(input) + case input.is_a?(String) ? input.downcase : input + in Numeric + !input.zero? + in "true" + true + in "false" + false + else + input + end + end + + # @api private + # + # @param input [Object] + # + # @raise [ArgumentError] + # @return [Boolean, nil] + def coerce_boolean!(input) + case coerce_boolean(input) + in true | false | nil => coerced + coerced + else + raise ArgumentError.new("Unable to coerce #{input.inspect} into boolean value") + end + end + + # @api private + # + # @param input [Object] + # + # @return [Integer, Object] + def coerce_integer(input) + case input + in true + 1 + in false + 0 + else + Integer(input, exception: false) || input + end + end + + # @api private + # + # @param input [Object] + # + # @return [Float, Object] + def coerce_float(input) + case input + in true + 1.0 + in false + 0.0 + else + Float(input, exception: false) || input + end + end + + # @api private + # + # @param input [Object] + # + # @return [Hash{Object=>Object}, Object] + def coerce_hash(input) + case input + in NilClass | Array | Set | Enumerator + input + else + input.respond_to?(:to_h) ? input.to_h : input + end + end + end + + # Use this to indicate that a value should be explicitly removed from a data + # structure when using `Lithic::Util.deep_merge`. + # + # e.g. merging `{a: 1}` and `{a: OMIT}` should produce `{}`, where merging + # `{a: 1}` and `{}` would produce `{a: 1}`. + OMIT = Object.new.freeze + + class << self + # @api private + # + # @param lhs [Object] + # @param rhs [Object] + # @param concat [Boolean] + # + # @return [Object] + private def deep_merge_lr(lhs, rhs, concat: false) + case [lhs, rhs, concat] + in [Hash, Hash, _] + # rubocop:disable Style/YodaCondition + rhs_cleaned = rhs.reject { |_, val| OMIT == val } + lhs + .reject { |key, _| OMIT == rhs[key] } + .merge(rhs_cleaned) do |_, old_val, new_val| + deep_merge_lr(old_val, new_val, concat: concat) + end + # rubocop:enable Style/YodaCondition + in [Array, Array, true] + lhs.concat(rhs) + else + rhs + end + end + + # @api private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + # + # @param values [Array] + # + # @param sentinel [Object, nil] the value to return if no values are provided. + # + # @param concat [Boolean] whether to merge sequences by concatenation. + # + # @return [Object] + def deep_merge(*values, sentinel: nil, concat: false) + case values + in [value, *values] + values.reduce(value) do |acc, val| + deep_merge_lr(acc, val, concat: concat) + end + else + sentinel + end + end + + # @api private + # + # @param data [Hash{Symbol=>Object}, Array, Object] + # @param pick [Symbol, Integer, Array, nil] + # @param sentinel [Object, nil] + # @param blk [Proc, nil] + # + # @return [Object, nil] + def dig(data, pick, sentinel = nil, &blk) + case [data, pick, blk] + in [_, nil, nil] + data + in [Hash, Symbol, _] | [Array, Integer, _] + blk.nil? ? data.fetch(pick, sentinel) : data.fetch(pick, &blk) + in [Hash | Array, Array, _] + pick.reduce(data) do |acc, key| + case acc + in Hash if acc.key?(key) + acc.fetch(key) + in Array if key.is_a?(Integer) && key < acc.length + acc[key] + else + return blk.nil? ? sentinel : blk.call + end + end + in _ + blk.nil? ? sentinel : blk.call + end + end + end + + class << self + # @api private + # + # @param uri [URI::Generic] + # + # @return [String] + def uri_origin(uri) + "#{uri.scheme}://#{uri.host}#{uri.port == uri.default_port ? '' : ":#{uri.port}"}" + end + + # @api private + # + # @param path [String, Array] + # + # @return [String] + def interpolate_path(path) + case path + in String + path + in [] + "" + in [String, *interpolations] + encoded = interpolations.map { ERB::Util.url_encode(_1) } + path.first % encoded + end + end + end + + class << self + # @api private + # + # @param query [String, nil] + # + # @return [Hash{String=>Array}] + def decode_query(query) + CGI.parse(query.to_s) + end + + # @api private + # + # @param query [Hash{String=>Array, String, nil}, nil] + # + # @return [String, nil] + def encode_query(query) + query.to_h.empty? ? nil : URI.encode_www_form(query) + end + end + + class << self + # @api private + # + # @param url [URI::Generic, String] + # + # @return [Hash{Symbol=>String, Integer, nil}] + def parse_uri(url) + parsed = URI::Generic.component.zip(URI.split(url)).to_h + {**parsed, query: decode_query(parsed.fetch(:query))} + end + + # @api private + # + # @param parsed [Hash{Symbol=>String, Integer, nil}] . + # + # @option parsed [String, nil] :scheme + # + # @option parsed [String, nil] :host + # + # @option parsed [Integer, nil] :port + # + # @option parsed [String, nil] :path + # + # @option parsed [Hash{String=>Array}] :query + # + # @return [URI::Generic] + def unparse_uri(parsed) + URI::Generic.build(**parsed, query: encode_query(parsed.fetch(:query))) + end + + # @api private + # + # @param lhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option lhs [String, nil] :scheme + # + # @option lhs [String, nil] :host + # + # @option lhs [Integer, nil] :port + # + # @option lhs [String, nil] :path + # + # @option lhs [Hash{String=>Array}] :query + # + # @param rhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option rhs [String, nil] :scheme + # + # @option rhs [String, nil] :host + # + # @option rhs [Integer, nil] :port + # + # @option rhs [String, nil] :path + # + # @option rhs [Hash{String=>Array}] :query + # + # @return [URI::Generic] + def join_parsed_uri(lhs, rhs) + base_path, base_query = lhs.fetch_values(:path, :query) + slashed = base_path.end_with?("/") ? base_path : "#{base_path}/" + + parsed_path, parsed_query = parse_uri(rhs.fetch(:path)).fetch_values(:path, :query) + override = URI::Generic.build(**rhs.slice(:scheme, :host, :port), path: parsed_path) + + joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override) + query = deep_merge( + joined.path == base_path ? base_query : {}, + parsed_query, + rhs[:query].to_h, + concat: true + ) + + joined.query = encode_query(query) + joined + end + end + + class << self + # @api private + # + # @param headers [Hash{String=>String, Integer, Array, nil}] + # + # @return [Hash{String=>String}] + def normalized_headers(*headers) + {}.merge(*headers.compact).to_h do |key, val| + value = + case val + in Array + val.map { _1.to_s.strip }.join(", ") + else + val&.to_s&.strip + end + [key.downcase, value] + end + end + end + + # @api private + # + # An adapter that satisfies the IO interface required by `::IO.copy_stream` + class ReadIOAdapter + # @api private + # + # @param max_len [Integer, nil] + # + # @return [String] + private def read_enum(max_len) + case max_len + in nil + @stream.to_a.join + in Integer + @buf << @stream.next while @buf.length < max_len + @buf.slice!(..max_len) + end + rescue StopIteration + @stream = nil + @buf.slice!(0..) + end + + # @api private + # + # @param max_len [Integer, nil] + # @param out_string [String, nil] + # + # @return [String, nil] + def read(max_len = nil, out_string = nil) + case @stream + in nil + nil + in IO | StringIO + @stream.read(max_len, out_string) + in Enumerator + read = read_enum(max_len) + case out_string + in String + out_string.replace(read) + in nil + read + end + end + .tap(&@blk) + end + + # @api private + # + # @param stream [String, IO, StringIO, Enumerable] + # @param blk [Proc] + # + # @yieldparam [String] + def initialize(stream, &blk) + @stream = stream.is_a?(String) ? StringIO.new(stream) : stream + @buf = String.new.b + @blk = blk + end + end + + class << self + # @param blk [Proc] + # + # @yieldparam [Enumerator::Yielder] + # @return [Enumerable] + def string_io(&blk) + Enumerator.new do |y| + y.define_singleton_method(:write) do + self << _1.clone + _1.bytesize + end + + blk.call(y) + end + end + end + + class << self + # rubocop:disable Naming/MethodParameterName + + # @api private + # + # @param y [Enumerator::Yielder] + # @param boundary [String] + # @param key [Symbol, String] + # @param val [Object] + private def encode_multipart_formdata(y, boundary:, key:, val:) + y << "--#{boundary}\r\n" + y << "Content-Disposition: form-data" + unless key.nil? + name = ERB::Util.url_encode(key.to_s) + y << "; name=\"#{name}\"" + end + if val.is_a?(IO) + filename = ERB::Util.url_encode(File.basename(val.to_path)) + y << "; filename=\"#{filename}\"" + end + y << "\r\n" + case val + in IO + y << "Content-Type: application/octet-stream\r\n\r\n" + IO.copy_stream(val, y) + in StringIO + y << "Content-Type: application/octet-stream\r\n\r\n" + y << val.string + in String + y << "Content-Type: application/octet-stream\r\n\r\n" + y << val.to_s + in true | false | Integer | Float | Symbol + y << "Content-Type: text/plain\r\n\r\n" + y << val.to_s + else + y << "Content-Type: application/json\r\n\r\n" + y << JSON.fast_generate(val) + end + y << "\r\n" + end + + # rubocop:enable Naming/MethodParameterName + + # @api private + # + # @param body [Object] + # + # @return [Array(String, Enumerable)] + private def encode_multipart_streaming(body) + boundary = SecureRandom.urlsafe_base64(60) + + strio = string_io do |y| + case body + in Hash + body.each do |key, val| + case val + in Array if val.all? { primitive?(_1) } + val.each do |v| + encode_multipart_formdata(y, boundary: boundary, key: key, val: v) + end + else + encode_multipart_formdata(y, boundary: boundary, key: key, val: val) + end + end + else + encode_multipart_formdata(y, boundary: boundary, key: nil, val: body) + end + y << "--#{boundary}--\r\n" + end + + [boundary, strio] + end + + # @api private + # + # @param headers [Hash{String=>String}] + # @param body [Object] + # + # @return [Object] + def encode_content(headers, body) + content_type = headers["content-type"] + case [content_type, body] + in [%r{^application/(?:vnd\.api\+)?json}, Hash | Array] + [headers, JSON.fast_generate(body)] + in [%r{^application/(?:x-)?jsonl}, Enumerable] + [headers, body.lazy.map { JSON.fast_generate(_1) }] + in [%r{^multipart/form-data}, Hash | IO | StringIO] + boundary, strio = encode_multipart_streaming(body) + headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} + [headers, strio] + in [_, StringIO] + [headers, body.string] + else + [headers, body] + end + end + + # @api private + # + # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param stream [Enumerable] + # @param suppress_error [Boolean] + # + # @raise [JSON::ParserError] + # @return [Object] + def decode_content(headers, stream:, suppress_error: false) + case headers["content-type"] + in %r{^application/(?:vnd\.api\+)?json} + json = stream.to_a.join + begin + JSON.parse(json, symbolize_names: true) + rescue JSON::ParserError => e + raise e unless suppress_error + json + end + in %r{^application/(?:x-)?jsonl} + lines = decode_lines(stream) + chain_fused(lines) do |y| + lines.each { y << JSON.parse(_1, symbolize_names: true) } + end + in %r{^text/event-stream} + lines = decode_lines(stream) + decode_sse(lines) + in %r{^text/} + stream.to_a.join + else + # TODO: parsing other response types + StringIO.new(stream.to_a.join) + end + end + end + + class << self + # @api private + # + # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html + # + # @param enum [Enumerable] + # @param external [Boolean] + # @param close [Proc] + # + # @return [Enumerable] + def fused_enum(enum, external: false, &close) + fused = false + iter = Enumerator.new do |y| + next if fused + + fused = true + if external + loop { y << enum.next } + else + enum.each(&y) + end + ensure + close&.call + close = nil + end + + iter.define_singleton_method(:rewind) do + fused = true + self + end + iter + end + + # @api private + # + # @param enum [Enumerable, nil] + def close_fused!(enum) + return unless enum.is_a?(Enumerator) + + # rubocop:disable Lint/UnreachableLoop + enum.rewind.each { break } + # rubocop:enable Lint/UnreachableLoop + end + + # @api private + # + # @param enum [Enumerable, nil] + # @param blk [Proc] + # + # @yieldparam [Enumerator::Yielder] + # @return [Enumerable] + def chain_fused(enum, &blk) + iter = Enumerator.new { blk.call(_1) } + fused_enum(iter) { close_fused!(enum) } + end + end + + class << self + # @api private + # + # @param enum [Enumerable] + # + # @return [Enumerable] + def decode_lines(enum) + re = /(\r\n|\r|\n)/ + buffer = String.new.b + cr_seen = nil + + chain_fused(enum) do |y| + enum.each do |row| + offset = buffer.bytesize + buffer << row + while (match = re.match(buffer, cr_seen&.to_i || offset)) + case [match.captures.first, cr_seen] + in ["\r", nil] + cr_seen = match.end(1) + next + in ["\r" | "\r\n", Integer] + y << buffer.slice!(..(cr_seen.pred)) + else + y << buffer.slice!(..(match.end(1).pred)) + end + offset = 0 + cr_seen = nil + end + end + + y << buffer.slice!(..(cr_seen.pred)) unless cr_seen.nil? + y << buffer unless buffer.empty? + end + end + + # @api private + # + # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream + # + # @param lines [Enumerable] + # + # @return [Hash{Symbol=>Object}] + def decode_sse(lines) + # rubocop:disable Metrics/BlockLength + chain_fused(lines) do |y| + blank = {event: nil, data: nil, id: nil, retry: nil} + current = {} + + lines.each do |line| + case line.sub(/\R$/, "") + in "" + next if current.empty? + y << {**blank, **current} + current = {} + in /^:/ + next + in /^([^:]+):\s?(.*)$/ + field, value = Regexp.last_match.captures + case field + in "event" + current.merge!(event: value) + in "data" + (current[:data] ||= String.new.b) << (value << "\n") + in "id" unless value.include?("\0") + current.merge!(id: value) + in "retry" if /^\d+$/ =~ value + current.merge!(retry: Integer(value)) + else + end + else + end + end + # rubocop:enable Metrics/BlockLength + + y << {**blank, **current} unless current.empty? + end + end + end + end + + # rubocop:enable Metrics/ModuleLength +end diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb new file mode 100644 index 00000000..376bfc1f --- /dev/null +++ b/lib/lithic/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Lithic + VERSION = "0.1.0-alpha.1" +end diff --git a/lithic.gemspec b/lithic.gemspec new file mode 100644 index 00000000..7fa96ec0 --- /dev/null +++ b/lithic.gemspec @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative "lib/lithic/version" + +Gem::Specification.new do |s| + s.name = "lithic" + s.version = Lithic::VERSION + s.summary = "Ruby library to access the Lithic API" + s.authors = ["Lithic"] + s.email = "sdk-feedback@lithic.com" + s.files = Dir["lib/**/*.rb", "rbi/**/*.rbi", "sig/**/*.rbs", "manifest.yaml"] + s.extra_rdoc_files = ["README.md"] + s.required_ruby_version = ">= 3.0.0" + s.add_dependency "connection_pool" + s.homepage = "https://gemdocs.org/gems/lithic" + s.metadata["homepage_uri"] = s.homepage + s.metadata["source_code_uri"] = "https://github.com/lithic-com/lithic-ruby" + s.metadata["rubygems_mfa_required"] = false.to_s +end diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 00000000..fa9c3e5e --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,14 @@ +dependencies: + - cgi + - date + - erb + - etc + - json + - net/http + - pathname + - rbconfig + - securerandom + - set + - stringio + - time + - uri diff --git a/rbi/lib/lithic/base_client.rbi b/rbi/lib/lithic/base_client.rbi new file mode 100644 index 00000000..14a26d4c --- /dev/null +++ b/rbi/lib/lithic/base_client.rbi @@ -0,0 +1,196 @@ +# typed: strong + +module Lithic + # @api private + class BaseClient + abstract! + + RequestComponentsShape = + T.type_alias do + { + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable( + T::Hash[String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + )] + ), + body: T.nilable(T.anything), + unwrap: T.nilable(Symbol), + page: T.nilable(T::Class[Lithic::BasePage[Lithic::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Lithic::Converter::Input), + options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + } + end + + RequestInputShape = + T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + max_retries: Integer, + timeout: Float + } + end + + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + PLATFORM_HEADERS = T::Hash[String, String] + + class << self + # @api private + sig { params(req: Lithic::BaseClient::RequestComponentsShape).void } + def validate!(req) + end + + # @api private + sig do + params(status: Integer, headers: T.any(T::Hash[String, String], Net::HTTPHeader)).returns(T::Boolean) + end + def should_retry?(status, headers:) + end + + # @api private + sig do + params( + request: Lithic::BaseClient::RequestInputShape, + status: Integer, + response_headers: T.any(T::Hash[String, String], Net::HTTPHeader) + ) + .returns(Lithic::BaseClient::RequestInputShape) + end + def follow_redirect(request, status:, response_headers:) + end + + # @api private + sig do + params( + status: T.any(Integer, Lithic::APIConnectionError), + stream: T.nilable(T::Enumerable[String]) + ).void + end + def reap_connection!(status, stream:) + end + end + + # @api private + sig { returns(T.anything) } + attr_accessor :requester + + # @api private + sig do + params( + base_url: String, + timeout: Float, + max_retries: Integer, + initial_retry_delay: Float, + max_retry_delay: Float, + headers: T::Hash[String, + T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))], + idempotency_header: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + end + + # @api private + sig { overridable.returns(T::Hash[String, String]) } + private def auth_headers + end + + # @api private + sig { returns(String) } + private def generate_idempotency_key + end + + # @api private + sig do + overridable + .params(req: Lithic::BaseClient::RequestComponentsShape, opts: Lithic::Util::AnyHash) + .returns(Lithic::BaseClient::RequestInputShape) + end + private def build_request(req, opts) + end + + # @api private + sig { params(headers: T::Hash[String, String], retry_count: Integer).returns(Float) } + private def retry_delay(headers, retry_count:) + end + + # @api private + sig do + params( + request: Lithic::BaseClient::RequestInputShape, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: T::Boolean + ) + .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + private def send_request(request, redirect_count:, retry_count:, send_retry_header:) + end + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + sig do + params( + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable( + T::Hash[String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + )] + ), + body: T.nilable(T.anything), + unwrap: T.nilable(Symbol), + page: T.nilable(T::Class[Lithic::BasePage[Lithic::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Lithic::Converter::Input), + options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(T.anything) + end + def request( + method, + path, + query: {}, + headers: {}, + body: nil, + unwrap: nil, + page: nil, + stream: nil, + model: Lithic::Unknown, + options: {} + ) + end + + sig { returns(String) } + def inspect + end + end +end diff --git a/rbi/lib/lithic/base_model.rbi b/rbi/lib/lithic/base_model.rbi new file mode 100644 index 00000000..30b6fe62 --- /dev/null +++ b/rbi/lib/lithic/base_model.rbi @@ -0,0 +1,640 @@ +# typed: strong + +module Lithic + # @api private + module Converter + Input = T.type_alias { T.any(Lithic::Converter, T::Class[T.anything]) } + + # @api private + sig { overridable.params(value: T.anything).returns(T.anything) } + def coerce(value) + end + + # @api private + sig { overridable.params(value: T.anything).returns(T.anything) } + def dump(value) + end + + # @api private + sig do + overridable + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + + class << self + # @api private + sig do + params( + spec: T.any( + { + const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), + enum: T.nilable(T.proc.returns(Lithic::Converter::Input)), + union: T.nilable(T.proc.returns(Lithic::Converter::Input)) + }, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ) + ) + .returns(T.proc.returns(T.anything).void) + end + def self.type_info(spec) + end + + # @api private + # + # Based on `target`, transform `value` into `target`, to the extent possible: + # + # 1. if the given `value` conforms to `target` already, return the given `value` + # 2. if it's possible and safe to convert the given `value` to `target`, then the + # converted value + # 3. otherwise, the given `value` unaltered + sig { params(target: Lithic::Converter::Input, value: T.anything).returns(T.anything) } + def self.coerce(target, value) + end + + # @api private + sig { params(target: Lithic::Converter::Input, value: T.anything).returns(T.anything) } + def self.dump(target, value) + end + + # @api private + # + # The underlying algorithm for computing maximal compatibility is subject to + # future improvements. + # + # Similar to `#.coerce`, used to determine the best union variant to decode into. + # + # 1. determine if strict-ish coercion is possible + # 2. return either result of successful coercion or if loose coercion is possible + # 3. return a score for recursively tallied count for fields that can be coerced + sig { params(target: Lithic::Converter::Input, value: T.anything).returns(T.anything) } + def self.try_strict_coerce(target, value) + end + end + end + + # @api private + # + # When we don't know what to expect for the value. + class Unknown + extend Lithic::Converter + + abstract! + final! + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + class << self + # @api private + sig(:final) { override.params(value: T.anything).returns(T.anything) } + def coerce(value) + end + + # @api private + sig(:final) { override.params(value: T.anything).returns(T.anything) } + def dump(value) + end + + # @api private + sig(:final) do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + end + end + + # @api private + # + # Ruby has no Boolean class; this is something for models to refer to. + class BooleanModel + extend Lithic::Converter + + abstract! + final! + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + class << self + # @api private + sig(:final) do + override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) + end + def coerce(value) + end + + # @api private + sig(:final) do + override.params(value: T.any(T::Boolean, T.anything)).returns(T.any(T::Boolean, T.anything)) + end + def dump(value) + end + + # @api private + sig(:final) do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + end + end + + # @api private + # + # A value from among a specified list of options. OpenAPI enum values map to Ruby + # values in the SDK as follows: + # + # 1. boolean => true | false + # 2. integer => Integer + # 3. float => Float + # 4. string => Symbol + # + # We can therefore convert string values to Symbols, but can't convert other + # values safely. + module Enum + include Lithic::Converter + + # All of the valid Symbol values for this enum. + sig { overridable.returns(T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)]) } + def values + end + + # @api private + # + # Guard against thread safety issues by instantiating `@values`. + sig { void } + private def finalize! + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + sig { override.params(value: T.any(String, Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } + def coerce(value) + end + + # @api private + sig { override.params(value: T.any(Symbol, T.anything)).returns(T.any(Symbol, T.anything)) } + def dump(value) + end + + # @api private + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + end + + # @api private + module Union + include Lithic::Converter + + # @api private + # + # All of the specified variant info for this union. + sig { returns(T::Array[[T.nilable(Symbol), T.proc.returns(Lithic::Converter::Input)]]) } + private def known_variants + end + + # @api private + sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) } + protected def derefed_variants + end + + # All of the specified variants for this union. + sig { overridable.returns(T::Array[T.anything]) } + def variants + end + + # @api private + sig { params(property: Symbol).void } + private def discriminator(property) + end + + # @api private + sig do + params( + key: T.any(Symbol, Lithic::Util::AnyHash, T.proc.returns(T.anything), T.anything), + spec: T.any(Lithic::Util::AnyHash, T.proc.returns(T.anything), T.anything) + ) + .void + end + private def variant(key, spec = nil) + end + + # @api private + sig { params(value: T.anything).returns(T.nilable(T.anything)) } + private def resolve_variant(value) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + sig { override.params(value: T.anything).returns(T.anything) } + def coerce(value) + end + + # @api private + sig { override.params(value: T.anything).returns(T.anything) } + def dump(value) + end + + # @api private + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + end + + # @api private + # + # Array of items of a given type. + class ArrayOf + include Lithic::Converter + + abstract! + final! + + sig(:final) do + params( + type_info: T.any( + Lithic::Util::AnyHash, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ), + spec: Lithic::Util::AnyHash + ) + .returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + sig(:final) do + override + .params(value: T.any(T::Enumerable[T.anything], T.anything)) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def coerce(value) + end + + # @api private + sig(:final) do + override + .params(value: T.any(T::Enumerable[T.anything], T.anything)) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def dump(value) + end + + # @api private + sig(:final) do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + + # @api private + sig(:final) { returns(T.anything) } + protected def item_type + end + + # @api private + sig(:final) do + params( + type_info: T.any( + Lithic::Util::AnyHash, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ), + spec: Lithic::Util::AnyHash + ) + .void + end + def initialize(type_info, spec = {}) + end + end + + # @api private + # + # Hash of items of a given type. + class HashOf + include Lithic::Converter + + abstract! + final! + + sig(:final) do + params( + type_info: T.any( + Lithic::Util::AnyHash, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ), + spec: Lithic::Util::AnyHash + ) + .returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig(:final) { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + # @api private + sig(:final) do + override + .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) + .returns(T.any(Lithic::Util::AnyHash, T.anything)) + end + def coerce(value) + end + + # @api private + sig(:final) do + override + .params(value: T.any(T::Hash[T.anything, T.anything], T.anything)) + .returns(T.any(Lithic::Util::AnyHash, T.anything)) + end + def dump(value) + end + + # @api private + sig(:final) do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + + # @api private + sig(:final) { returns(T.anything) } + protected def item_type + end + + # @api private + sig(:final) do + params( + type_info: T.any( + Lithic::Util::AnyHash, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ), + spec: Lithic::Util::AnyHash + ) + .void + end + def initialize(type_info, spec = {}) + end + end + + class BaseModel + extend Lithic::Converter + + abstract! + + KnownFieldShape = T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean} } + + class << self + # @api private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + sig do + returns( + T::Hash[Symbol, + T.all( + Lithic::BaseModel::KnownFieldShape, + {type_fn: T.proc.returns(Lithic::Converter::Input)} + )] + ) + end + def known_fields + end + + # @api private + sig { returns(T::Hash[Symbol, Symbol]) } + def reverse_map + end + + # @api private + sig do + returns(T::Hash[Symbol, T.all(Lithic::BaseModel::KnownFieldShape, {type: Lithic::Converter::Input})]) + end + def fields + end + + # @api private + sig { returns(T::Hash[Symbol, T.proc.returns(T::Class[T.anything])]) } + def defaults + end + + # @api private + sig do + params( + name_sym: Symbol, + required: T::Boolean, + type_info: T.any( + { + const: T.nilable(T.any(NilClass, T::Boolean, Integer, Float, Symbol)), + enum: T.nilable(T.proc.returns(Lithic::Converter::Input)), + union: T.nilable(T.proc.returns(Lithic::Converter::Input)), + api_name: Symbol, + nil?: T::Boolean + }, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ), + spec: Lithic::Util::AnyHash + ) + .void + end + private def add_field(name_sym, required:, type_info:, spec:) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: T.any( + Lithic::Util::AnyHash, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ), + spec: Lithic::Util::AnyHash + ) + .void + end + def required(name_sym, type_info, spec = {}) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: T.any( + Lithic::Util::AnyHash, + T.proc.returns(Lithic::Converter::Input), + Lithic::Converter::Input + ), + spec: Lithic::Util::AnyHash + ) + .void + end + def optional(name_sym, type_info, spec = {}) + end + + # @api private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + sig { params(blk: T.proc.void).void } + private def request_only(&blk) + end + + # @api private + # + # `response_only` attributes are omitted from `.#dump` when making requests + sig { params(blk: T.proc.void).void } + private def response_only(&blk) + end + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + class << self + # @api private + sig do + override + .params(value: T.any(Lithic::BaseModel, T::Hash[T.anything, T.anything], T.anything)) + .returns(T.any(T.attached_class, T.anything)) + end + def coerce(value) + end + + # @api private + sig do + override + .params(value: T.any(T.attached_class, T.anything)) + .returns(T.any(T::Hash[T.anything, T.anything], T.anything)) + end + def dump(value) + end + + # @api private + sig do + override + .params(value: T.anything) + .returns(T.any([T::Boolean, T.anything, NilClass], [T::Boolean, T::Boolean, Integer])) + end + def try_strict_coerce(value) + end + end + + # Returns the raw value associated with the given key, if found. Otherwise, nil is + # returned. + # + # It is valid to lookup keys that are not in the API spec, for example to access + # undocumented features. This method does not parse response data into + # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. + sig { params(key: Symbol).returns(T.nilable(T.anything)) } + def [](key) + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + sig { overridable.returns(Lithic::Util::AnyHash) } + def to_h + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + sig { overridable.returns(Lithic::Util::AnyHash) } + def to_hash + end + + sig { params(keys: T.nilable(T::Array[Symbol])).returns(Lithic::Util::AnyHash) } + def deconstruct_keys(keys) + end + + # Create a new instance of a model. + sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(T.attached_class) } + def self.new(data = {}) + end + + sig { returns(String) } + def to_s + end + + sig { returns(String) } + def inspect + end + end +end diff --git a/rbi/lib/lithic/base_page.rbi b/rbi/lib/lithic/base_page.rbi new file mode 100644 index 00000000..1221c6df --- /dev/null +++ b/rbi/lib/lithic/base_page.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Lithic + module BasePage + Elem = type_member(:out) + + sig { overridable.returns(T::Boolean) } + def next_page? + end + + sig { overridable.returns(T.self_type) } + def next_page + end + + sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } + def auto_paging_each(&blk) + end + + sig { returns(T::Enumerable[Elem]) } + def to_enum + end + + # @api private + sig do + params( + client: Lithic::BaseClient, + req: Lithic::BaseClient::RequestComponentsShape, + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + page_data: T.anything + ) + .void + end + def initialize(client:, req:, headers:, page_data:) + end + end +end diff --git a/rbi/lib/lithic/client.rbi b/rbi/lib/lithic/client.rbi new file mode 100644 index 00000000..a6adccb1 --- /dev/null +++ b/rbi/lib/lithic/client.rbi @@ -0,0 +1,143 @@ +# typed: strong + +module Lithic + class Client < Lithic::BaseClient + DEFAULT_MAX_RETRIES = 2 + + DEFAULT_TIMEOUT_IN_SECONDS = T.let(60.0, Float) + + DEFAULT_INITIAL_RETRY_DELAY = T.let(0.5, Float) + + DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) + + ENVIRONMENTS = + T.let( + {production: "https://api.lithic.com", sandbox: "https://sandbox.lithic.com"}, + T::Hash[Symbol, String] + ) + + sig { returns(String) } + attr_reader :api_key + + sig { returns(Lithic::Resources::Accounts) } + attr_reader :accounts + + sig { returns(Lithic::Resources::AccountHolders) } + attr_reader :account_holders + + sig { returns(Lithic::Resources::AuthRules) } + attr_reader :auth_rules + + sig { returns(Lithic::Resources::AuthStreamEnrollment) } + attr_reader :auth_stream_enrollment + + sig { returns(Lithic::Resources::TokenizationDecisioning) } + attr_reader :tokenization_decisioning + + sig { returns(Lithic::Resources::Tokenizations) } + attr_reader :tokenizations + + sig { returns(Lithic::Resources::Cards) } + attr_reader :cards + + sig { returns(Lithic::Resources::Balances) } + attr_reader :balances + + sig { returns(Lithic::Resources::AggregateBalances) } + attr_reader :aggregate_balances + + sig { returns(Lithic::Resources::Disputes) } + attr_reader :disputes + + sig { returns(Lithic::Resources::Events) } + attr_reader :events + + sig { returns(Lithic::Resources::Transfers) } + attr_reader :transfers + + sig { returns(Lithic::Resources::FinancialAccounts) } + attr_reader :financial_accounts + + sig { returns(Lithic::Resources::Transactions) } + attr_reader :transactions + + sig { returns(Lithic::Resources::ResponderEndpoints) } + attr_reader :responder_endpoints + + sig { returns(Lithic::Resources::ExternalBankAccounts) } + attr_reader :external_bank_accounts + + sig { returns(Lithic::Resources::Payments) } + attr_reader :payments + + sig { returns(Lithic::Resources::ThreeDS) } + attr_reader :three_ds + + sig { returns(Lithic::Resources::Reports) } + attr_reader :reports + + sig { returns(Lithic::Resources::CardPrograms) } + attr_reader :card_programs + + sig { returns(Lithic::Resources::DigitalCardArt) } + attr_reader :digital_card_art + + sig { returns(Lithic::Resources::BookTransfers) } + attr_reader :book_transfers + + sig { returns(Lithic::Resources::CreditProducts) } + attr_reader :credit_products + + sig { returns(Lithic::Resources::ExternalPayments) } + attr_reader :external_payments + + sig { returns(Lithic::Resources::ManagementOperations) } + attr_reader :management_operations + + # Status of api + sig do + params(request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))) + .returns(Lithic::Models::APIStatus) + end + def api_status(request_options: {}) + end + + # @api private + sig { override.returns(T::Hash[String, String]) } + private def auth_headers + end + + # Creates and returns a new client for interacting with the API. + sig do + params( + environment: NilClass, + base_url: T.nilable(String), + api_key: T.nilable(String), + max_retries: Integer, + timeout: Float, + initial_retry_delay: Float, + max_retry_delay: Float + ) + .returns(T.attached_class) + end + def self.new( + # Specifies the environment to use for the API. + # + # Each environment maps to a different base URL: + # + # - `production` corresponds to `https://api.lithic.com` + # - `sandbox` corresponds to `https://sandbox.lithic.com` + environment: nil, + # Override the default base URL for the API, e.g., `"https://api.example.com/v2/"` + base_url: nil, + # Defaults to `ENV["LITHIC_API_KEY"]` + api_key: ENV["LITHIC_API_KEY"], + # Max number of retries to attempt after a failed retryable request. + max_retries: DEFAULT_MAX_RETRIES, + timeout: DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: DEFAULT_MAX_RETRY_DELAY + ) + end + end +end diff --git a/rbi/lib/lithic/cursor_page.rbi b/rbi/lib/lithic/cursor_page.rbi new file mode 100644 index 00000000..0768c1f4 --- /dev/null +++ b/rbi/lib/lithic/cursor_page.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Lithic + class CursorPage + include Lithic::BasePage + + Elem = type_member + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig { returns(String) } + def inspect + end + end +end diff --git a/rbi/lib/lithic/errors.rbi b/rbi/lib/lithic/errors.rbi new file mode 100644 index 00000000..1ed11dd5 --- /dev/null +++ b/rbi/lib/lithic/errors.rbi @@ -0,0 +1,144 @@ +# typed: strong + +module Lithic + class Error < StandardError + sig { returns(T.nilable(StandardError)) } + attr_accessor :cause + end + + class ConversionError < Lithic::Error + end + + class APIError < Lithic::Error + sig { returns(URI::Generic) } + attr_accessor :url + + sig { returns(T.nilable(Integer)) } + attr_accessor :status + + sig { returns(T.nilable(T.anything)) } + attr_accessor :body + + # @api private + sig do + params( + url: URI::Generic, + status: T.nilable(Integer), + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + end + end + + class APIConnectionError < Lithic::APIError + sig { void } + attr_accessor :status + + sig { void } + attr_accessor :body + + # @api private + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Connection error.") + end + end + + class APITimeoutError < Lithic::APIConnectionError + # @api private + sig do + params( + url: URI::Generic, + status: NilClass, + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: "Request timed out.") + end + end + + class APIStatusError < Lithic::APIError + # @api private + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.for(url:, status:, body:, request:, response:, message: nil) + end + + sig { returns(Integer) } + attr_accessor :status + + # @api private + sig do + params( + url: URI::Generic, + status: Integer, + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(url:, status:, body:, request:, response:, message: nil) + end + end + + class BadRequestError < Lithic::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Lithic::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Lithic::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Lithic::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Lithic::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Lithic::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Lithic::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Lithic::APIStatusError + HTTP_STATUS = T.let((500..), T::Range[Integer]) + end +end diff --git a/rbi/lib/lithic/extern.rbi b/rbi/lib/lithic/extern.rbi new file mode 100644 index 00000000..60d15e41 --- /dev/null +++ b/rbi/lib/lithic/extern.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Lithic + # @api private + module Extern + end +end diff --git a/rbi/lib/lithic/models/account.rbi b/rbi/lib/lithic/models/account.rbi new file mode 100644 index 00000000..c913f474 --- /dev/null +++ b/rbi/lib/lithic/models/account.rbi @@ -0,0 +1,273 @@ +# typed: strong + +module Lithic + module Models + class Account < Lithic::BaseModel + # Globally unique identifier for the account. This is the same as the + # account_token returned by the enroll endpoint. If using this parameter, do not + # include pagination. + sig { returns(String) } + attr_accessor :token + + # Timestamp of when the account was created. For accounts created before + # 2023-05-11, this field will be null. + sig { returns(T.nilable(Time)) } + attr_accessor :created + + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + sig { returns(Lithic::Models::Account::SpendLimit) } + attr_reader :spend_limit + + sig { params(spend_limit: T.any(Lithic::Models::Account::SpendLimit, Lithic::Util::AnyHash)).void } + attr_writer :spend_limit + + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are also unable to be transitioned to `ACTIVE` or `PAUSED` states. + # `CLOSED` accounts result from failing to pass KYB/KYC or Lithic closing for + # risk/compliance reasons. Please contact + # [support@lithic.com](mailto:support@lithic.com) if you believe this was in + # error. + sig { returns(Lithic::Models::Account::State::TaggedSymbol) } + attr_accessor :state + + sig { returns(T.nilable(Lithic::Models::Account::AccountHolder)) } + attr_reader :account_holder + + sig { params(account_holder: T.any(Lithic::Models::Account::AccountHolder, Lithic::Util::AnyHash)).void } + attr_writer :account_holder + + # List of identifiers for the Auth Rule(s) that are applied on the account. This + # field is deprecated and will no longer be populated in the `account_holder` + # object. The key will be removed from the schema in a future release. Use the + # `/auth_rules` endpoints to fetch Auth Rule information instead. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :auth_rule_tokens + + sig { params(auth_rule_tokens: T::Array[String]).void } + attr_writer :auth_rule_tokens + + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_currency + + sig { params(cardholder_currency: String).void } + attr_writer :cardholder_currency + + sig { returns(T.nilable(Lithic::Models::Account::VerificationAddress)) } + attr_reader :verification_address + + sig do + params(verification_address: T.any(Lithic::Models::Account::VerificationAddress, Lithic::Util::AnyHash)) + .void + end + attr_writer :verification_address + + sig do + params( + token: String, + created: T.nilable(Time), + spend_limit: T.any(Lithic::Models::Account::SpendLimit, Lithic::Util::AnyHash), + state: Lithic::Models::Account::State::OrSymbol, + account_holder: T.any(Lithic::Models::Account::AccountHolder, Lithic::Util::AnyHash), + auth_rule_tokens: T::Array[String], + cardholder_currency: String, + verification_address: T.any(Lithic::Models::Account::VerificationAddress, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + token:, + created:, + spend_limit:, + state:, + account_holder: nil, + auth_rule_tokens: nil, + cardholder_currency: nil, + verification_address: nil + ) + end + + sig do + override + .returns( + { + token: String, + created: T.nilable(Time), + spend_limit: Lithic::Models::Account::SpendLimit, + state: Lithic::Models::Account::State::TaggedSymbol, + account_holder: Lithic::Models::Account::AccountHolder, + auth_rule_tokens: T::Array[String], + cardholder_currency: String, + verification_address: Lithic::Models::Account::VerificationAddress + } + ) + end + def to_hash + end + + class SpendLimit < Lithic::BaseModel + # Daily spend limit (in cents). + sig { returns(Integer) } + attr_accessor :daily + + # Total spend limit over account lifetime (in cents). + sig { returns(Integer) } + attr_accessor :lifetime + + # Monthly spend limit (in cents). + sig { returns(Integer) } + attr_accessor :monthly + + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + sig { params(daily: Integer, lifetime: Integer, monthly: Integer).returns(T.attached_class) } + def self.new(daily:, lifetime:, monthly:) + end + + sig { override.returns({daily: Integer, lifetime: Integer, monthly: Integer}) } + def to_hash + end + end + + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are also unable to be transitioned to `ACTIVE` or `PAUSED` states. + # `CLOSED` accounts result from failing to pass KYB/KYC or Lithic closing for + # risk/compliance reasons. Please contact + # [support@lithic.com](mailto:support@lithic.com) if you believe this was in + # error. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Account::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Account::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::Account::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::Account::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::Account::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Account::State::TaggedSymbol]) } + def self.values + end + end + + class AccountHolder < Lithic::BaseModel + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :token + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Account_token of the enrolled business associated with an + # enrolled AUTHORIZED_USER individual. + sig { returns(String) } + attr_accessor :business_account_token + + # Email address. + sig { returns(String) } + attr_accessor :email + + # Phone number of the individual. + sig { returns(String) } + attr_accessor :phone_number + + sig do + params(token: String, business_account_token: String, email: String, phone_number: String) + .returns(T.attached_class) + end + def self.new(token:, business_account_token:, email:, phone_number:) + end + + sig do + override.returns( + { + token: String, + business_account_token: String, + email: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class VerificationAddress < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # City name. + sig { returns(String) } + attr_accessor :city + + # Country name. Only USA is currently supported. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA postal codes (ZIP codes) are currently supported, + # entered as a five-digit postal code or nine-digit postal code (ZIP+4) using the + # format 12345-1234. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_financial_account_type.rbi b/rbi/lib/lithic/models/account_financial_account_type.rbi new file mode 100644 index 00000000..4a3997cf --- /dev/null +++ b/rbi/lib/lithic/models/account_financial_account_type.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Lithic + module Models + # Type of account financial account + module AccountFinancialAccountType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountFinancialAccountType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AccountFinancialAccountType::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::AccountFinancialAccountType::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::AccountFinancialAccountType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountFinancialAccountType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder.rbi b/rbi/lib/lithic/models/account_holder.rbi new file mode 100644 index 00000000..0d629259 --- /dev/null +++ b/rbi/lib/lithic/models/account_holder.rbi @@ -0,0 +1,895 @@ +# typed: strong + +module Lithic + module Models + class AccountHolder < Lithic::BaseModel + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :token + + # Timestamp of when the account holder was created. + sig { returns(Time) } + attr_accessor :created + + # Globally unique identifier for the account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only present when user_type == "BUSINESS". List of all entities with >25% + # ownership in the company. + sig { returns(T.nilable(T::Array[Lithic::Models::AccountHolder::BeneficialOwnerEntity])) } + attr_reader :beneficial_owner_entities + + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::AccountHolder::BeneficialOwnerEntity, Lithic::Util::AnyHash)] + ) + .void + end + attr_writer :beneficial_owner_entities + + # Only present when user_type == "BUSINESS". List of all individuals with >25% + # ownership in the company. + sig { returns(T.nilable(T::Array[Lithic::Models::AccountHolder::BeneficialOwnerIndividual])) } + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::AccountHolder::BeneficialOwnerIndividual, Lithic::Util::AnyHash)] + ) + .void + end + attr_writer :beneficial_owner_individuals + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig { returns(T.nilable(Lithic::Models::AccountHolder::BusinessEntity)) } + attr_reader :business_entity + + sig { params(business_entity: T.any(Lithic::Models::AccountHolder::BusinessEntity, Lithic::Util::AnyHash)).void } + attr_writer :business_entity + + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + sig { returns(T.nilable(Lithic::Models::AccountHolder::ControlPerson)) } + attr_reader :control_person + + sig { params(control_person: T.any(Lithic::Models::AccountHolder::ControlPerson, Lithic::Util::AnyHash)).void } + attr_writer :control_person + + # < Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary email of Account Holder. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of KYC exemption for a KYC-Exempt Account Holder. + sig { returns(T.nilable(Lithic::Models::AccountHolder::ExemptionType::TaggedSymbol)) } + attr_reader :exemption_type + + sig { params(exemption_type: Lithic::Models::AccountHolder::ExemptionType::OrSymbol).void } + attr_writer :exemption_type + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig { returns(T.nilable(Lithic::Models::AccountHolder::Individual)) } + attr_reader :individual + + sig { params(individual: T.any(Lithic::Models::AccountHolder::Individual, Lithic::Util::AnyHash)).void } + attr_writer :individual + + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary phone of Account Holder, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::Models::RequiredDocument])) } + attr_reader :required_documents + + sig { params(required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)]).void } + attr_writer :required_documents + + # + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + sig { returns(T.nilable(Lithic::Models::AccountHolder::Status::TaggedSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::AccountHolder::Status::OrSymbol).void } + attr_writer :status + + # Reason for the + # evaluation status. + sig { returns(T.nilable(T::Array[Lithic::Models::AccountHolder::StatusReason::TaggedSymbol])) } + attr_reader :status_reasons + + sig { params(status_reasons: T::Array[Lithic::Models::AccountHolder::StatusReason::OrSymbol]).void } + attr_writer :status_reasons + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "beneficial_owner_entities", + # "nature_of_business", and "website_url" attributes will be present. + sig { returns(T.nilable(Lithic::Models::AccountHolder::UserType::TaggedSymbol)) } + attr_reader :user_type + + sig { params(user_type: Lithic::Models::AccountHolder::UserType::OrSymbol).void } + attr_writer :user_type + + # Information about the most recent identity verification attempt + sig { returns(T.nilable(Lithic::Models::AccountHolder::VerificationApplication)) } + attr_reader :verification_application + + sig do + params( + verification_application: T.any(Lithic::Models::AccountHolder::VerificationApplication, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :verification_application + + # Only present when user_type == "BUSINESS". Business's primary website. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + token: String, + created: Time, + account_token: String, + beneficial_owner_entities: T::Array[T.any(Lithic::Models::AccountHolder::BeneficialOwnerEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::AccountHolder::BeneficialOwnerIndividual, Lithic::Util::AnyHash)], + business_account_token: String, + business_entity: T.any(Lithic::Models::AccountHolder::BusinessEntity, Lithic::Util::AnyHash), + control_person: T.any(Lithic::Models::AccountHolder::ControlPerson, Lithic::Util::AnyHash), + email: String, + exemption_type: Lithic::Models::AccountHolder::ExemptionType::OrSymbol, + external_id: String, + individual: T.any(Lithic::Models::AccountHolder::Individual, Lithic::Util::AnyHash), + nature_of_business: String, + phone_number: String, + required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)], + status: Lithic::Models::AccountHolder::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolder::StatusReason::OrSymbol], + user_type: Lithic::Models::AccountHolder::UserType::OrSymbol, + verification_application: T.any(Lithic::Models::AccountHolder::VerificationApplication, Lithic::Util::AnyHash), + website_url: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + created:, + account_token: nil, + beneficial_owner_entities: nil, + beneficial_owner_individuals: nil, + business_account_token: nil, + business_entity: nil, + control_person: nil, + email: nil, + exemption_type: nil, + external_id: nil, + individual: nil, + nature_of_business: nil, + phone_number: nil, + required_documents: nil, + status: nil, + status_reasons: nil, + user_type: nil, + verification_application: nil, + website_url: nil + ) + end + + sig do + override + .returns( + { + token: String, + created: Time, + account_token: String, + beneficial_owner_entities: T::Array[Lithic::Models::AccountHolder::BeneficialOwnerEntity], + beneficial_owner_individuals: T::Array[Lithic::Models::AccountHolder::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::Models::AccountHolder::BusinessEntity, + control_person: Lithic::Models::AccountHolder::ControlPerson, + email: String, + exemption_type: Lithic::Models::AccountHolder::ExemptionType::TaggedSymbol, + external_id: String, + individual: Lithic::Models::AccountHolder::Individual, + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::Models::RequiredDocument], + status: Lithic::Models::AccountHolder::Status::TaggedSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolder::StatusReason::TaggedSymbol], + user_type: Lithic::Models::AccountHolder::UserType::TaggedSymbol, + verification_application: Lithic::Models::AccountHolder::VerificationApplication, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerEntity < Lithic::BaseModel + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(String) } + attr_accessor :dba_business_name + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + parent_company: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + dba_business_name:, + entity_token:, + government_id:, + legal_business_name:, + phone_numbers:, + parent_company: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + parent_company: String + } + ) + end + def to_hash + end + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # Individual's current address + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. + sig { returns(String) } + attr_accessor :email + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Information about an individual associated with an account holder. A subset of + # the information provided via KYC. For example, we do not return the government + # id. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class BusinessEntity < Lithic::BaseModel + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(String) } + attr_accessor :dba_business_name + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + parent_company: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + dba_business_name:, + entity_token:, + government_id:, + legal_business_name:, + phone_numbers:, + parent_company: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + parent_company: String + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::BaseModel + # Individual's current address + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. + sig { returns(String) } + attr_accessor :email + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. + module ExemptionType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountHolder::ExemptionType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AccountHolder::ExemptionType::TaggedSymbol) } + + AUTHORIZED_USER = T.let(:AUTHORIZED_USER, Lithic::Models::AccountHolder::ExemptionType::TaggedSymbol) + PREPAID_CARD_USER = T.let(:PREPAID_CARD_USER, Lithic::Models::AccountHolder::ExemptionType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolder::ExemptionType::TaggedSymbol]) } + def self.values + end + end + + class Individual < Lithic::BaseModel + # Individual's current address + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. + sig { returns(String) } + attr_accessor :email + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountHolder::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AccountHolder::Status::TaggedSymbol) } + + ACCEPTED = T.let(:ACCEPTED, Lithic::Models::AccountHolder::Status::TaggedSymbol) + PENDING_REVIEW = T.let(:PENDING_REVIEW, Lithic::Models::AccountHolder::Status::TaggedSymbol) + PENDING_DOCUMENT = T.let(:PENDING_DOCUMENT, Lithic::Models::AccountHolder::Status::TaggedSymbol) + PENDING_RESUBMIT = T.let(:PENDING_RESUBMIT, Lithic::Models::AccountHolder::Status::TaggedSymbol) + REJECTED = T.let(:REJECTED, Lithic::Models::AccountHolder::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolder::Status::TaggedSymbol]) } + def self.values + end + end + + module StatusReason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountHolder::StatusReason) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) } + + ADDRESS_VERIFICATION_FAILURE = + T.let(:ADDRESS_VERIFICATION_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + AGE_THRESHOLD_FAILURE = + T.let(:AGE_THRESHOLD_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + COMPLETE_VERIFICATION_FAILURE = + T.let(:COMPLETE_VERIFICATION_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + DOB_VERIFICATION_FAILURE = + T.let(:DOB_VERIFICATION_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + ID_VERIFICATION_FAILURE = + T.let(:ID_VERIFICATION_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + MAX_DOCUMENT_ATTEMPTS = + T.let(:MAX_DOCUMENT_ATTEMPTS, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + MAX_RESUBMISSION_ATTEMPTS = + T.let(:MAX_RESUBMISSION_ATTEMPTS, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + NAME_VERIFICATION_FAILURE = + T.let(:NAME_VERIFICATION_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + OTHER_VERIFICATION_FAILURE = + T.let(:OTHER_VERIFICATION_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + RISK_THRESHOLD_FAILURE = + T.let(:RISK_THRESHOLD_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + WATCHLIST_ALERT_FAILURE = + T.let(:WATCHLIST_ALERT_FAILURE, Lithic::Models::AccountHolder::StatusReason::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolder::StatusReason::TaggedSymbol]) } + def self.values + end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "beneficial_owner_entities", + # "nature_of_business", and "website_url" attributes will be present. + module UserType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountHolder::UserType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AccountHolder::UserType::TaggedSymbol) } + + BUSINESS = T.let(:BUSINESS, Lithic::Models::AccountHolder::UserType::TaggedSymbol) + INDIVIDUAL = T.let(:INDIVIDUAL, Lithic::Models::AccountHolder::UserType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolder::UserType::TaggedSymbol]) } + def self.values + end + end + + class VerificationApplication < Lithic::BaseModel + # Timestamp of when the application was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + sig { returns(T.nilable(Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::AccountHolder::VerificationApplication::Status::OrSymbol).void } + attr_writer :status + + # Reason for the evaluation status. + sig do + returns( + T.nilable(T::Array[Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol]) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: T::Array[Lithic::Models::AccountHolder::VerificationApplication::StatusReason::OrSymbol] + ) + .void + end + attr_writer :status_reasons + + # Timestamp of when the application was last updated. + sig { returns(T.nilable(Time)) } + attr_reader :updated + + sig { params(updated: Time).void } + attr_writer :updated + + # Information about the most recent identity verification attempt + sig do + params( + created: Time, + status: Lithic::Models::AccountHolder::VerificationApplication::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolder::VerificationApplication::StatusReason::OrSymbol], + updated: Time + ) + .returns(T.attached_class) + end + def self.new(created: nil, status: nil, status_reasons: nil, updated: nil) + end + + sig do + override + .returns( + { + created: Time, + status: Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol], + updated: Time + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolder::VerificationApplication::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol) } + + ACCEPTED = T.let(:ACCEPTED, Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol) + PENDING_REVIEW = + T.let(:PENDING_REVIEW, Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol) + PENDING_DOCUMENT = + T.let(:PENDING_DOCUMENT, Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol) + PENDING_RESUBMIT = + T.let(:PENDING_RESUBMIT, Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol) + REJECTED = T.let(:REJECTED, Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolder::VerificationApplication::Status::TaggedSymbol]) } + def self.values + end + end + + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolder::VerificationApplication::StatusReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol]) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_create_params.rbi b/rbi/lib/lithic/models/account_holder_create_params.rbi new file mode 100644 index 00000000..c9b3b438 --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_create_params.rbi @@ -0,0 +1,656 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background. If no business owner is an entity, pass in an + # empty list. However, either this parameter or `beneficial_owner_individuals` + # must be populated. on entities that should be included. + sig { returns(T::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity]) } + attr_accessor :beneficial_owner_entities + + # List of all direct and indirect individuals with >25% ownership in the company. + # If no entity or individual owns >25% of the company, and the largest shareholder + # is an individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. If no + # individual is an entity, pass in an empty list. However, either this parameter + # or `beneficial_owner_entities` must be populated. + sig { returns(T::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual]) } + attr_accessor :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(Lithic::Models::AccountHolderCreateParams::BusinessEntity) } + attr_reader :business_entity + + sig do + params( + business_entity: T.any(Lithic::Models::AccountHolderCreateParams::BusinessEntity, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig { returns(Lithic::Models::AccountHolderCreateParams::ControlPerson) } + attr_reader :control_person + + sig do + params( + control_person: T.any(Lithic::Models::AccountHolderCreateParams::ControlPerson, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :control_person + + # Short description of the company's line of business (i.e., what does the company + # do?). + sig { returns(String) } + attr_accessor :nature_of_business + + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + sig { returns(String) } + attr_accessor :tos_timestamp + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + sig { returns(Lithic::Models::AccountHolderCreateParams::Workflow::OrSymbol) } + attr_accessor :workflow + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + sig { returns(T.nilable(String)) } + attr_reader :kyb_passed_timestamp + + sig { params(kyb_passed_timestamp: String).void } + attr_writer :kyb_passed_timestamp + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # Information on individual for whom the account is being opened and KYC is being + # run. + sig { returns(Lithic::Models::AccountHolderCreateParams::Individual) } + attr_reader :individual + + sig do + params(individual: T.any(Lithic::Models::AccountHolderCreateParams::Individual, Lithic::Util::AnyHash)) + .void + end + attr_writer :individual + + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + sig { returns(T.nilable(String)) } + attr_reader :kyc_passed_timestamp + + sig { params(kyc_passed_timestamp: String).void } + attr_writer :kyc_passed_timestamp + + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # The KYC Exempt user's email + sig { returns(String) } + attr_accessor :email + + # The KYC Exempt user's first name + sig { returns(String) } + attr_accessor :first_name + + # Specifies the type of KYC Exempt user + sig { returns(Lithic::Models::AccountHolderCreateParams::KYCExemptionType::OrSymbol) } + attr_accessor :kyc_exemption_type + + # The KYC Exempt user's last name + sig { returns(String) } + attr_accessor :last_name + + # The KYC Exempt user's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual, Lithic::Util::AnyHash)], + business_entity: T.any(Lithic::Models::AccountHolderCreateParams::BusinessEntity, Lithic::Util::AnyHash), + control_person: T.any(Lithic::Models::AccountHolderCreateParams::ControlPerson, Lithic::Util::AnyHash), + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::AccountHolderCreateParams::Workflow::OrSymbol, + individual: T.any(Lithic::Models::AccountHolderCreateParams::Individual, Lithic::Util::AnyHash), + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::AccountHolderCreateParams::KYCExemptionType::OrSymbol, + last_name: String, + phone_number: String, + external_id: String, + kyb_passed_timestamp: String, + website_url: String, + kyc_passed_timestamp: String, + business_account_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + beneficial_owner_entities:, + beneficial_owner_individuals:, + business_entity:, + control_person:, + nature_of_business:, + tos_timestamp:, + workflow:, + individual:, + address:, + email:, + first_name:, + kyc_exemption_type:, + last_name:, + phone_number:, + external_id: nil, + kyb_passed_timestamp: nil, + website_url: nil, + kyc_passed_timestamp: nil, + business_account_token: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + beneficial_owner_entities: T::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity], + beneficial_owner_individuals: T::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual], + business_entity: Lithic::Models::AccountHolderCreateParams::BusinessEntity, + control_person: Lithic::Models::AccountHolderCreateParams::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::AccountHolderCreateParams::Workflow::OrSymbol, + external_id: String, + kyb_passed_timestamp: String, + website_url: String, + individual: Lithic::Models::AccountHolderCreateParams::Individual, + kyc_passed_timestamp: String, + address: Lithic::Models::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::AccountHolderCreateParams::KYCExemptionType::OrSymbol, + last_name: String, + phone_number: String, + business_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + class BeneficialOwnerEntity < Lithic::BaseModel + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + government_id:, + legal_business_name:, + phone_numbers:, + dba_business_name: nil, + parent_company: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + } + ) + end + def to_hash + end + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Individuals associated with a KYB application. Phone number is optional. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class BusinessEntity < Lithic::BaseModel + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # Information for business for which the account is being opened and KYB is being + # run. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + government_id:, + legal_business_name:, + phone_numbers:, + dba_business_name: nil, + parent_company: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + module Workflow + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderCreateParams::Workflow) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderCreateParams::Workflow::TaggedSymbol) } + + KYC_EXEMPT = T.let(:KYC_EXEMPT, Lithic::Models::AccountHolderCreateParams::Workflow::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolderCreateParams::Workflow::TaggedSymbol]) } + def self.values + end + end + + class Individual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Information on individual for whom the account is being opened and KYC is being + # run. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number:) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Specifies the type of KYC Exempt user + module KYCExemptionType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderCreateParams::KYCExemptionType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderCreateParams::KYCExemptionType::TaggedSymbol) } + + AUTHORIZED_USER = + T.let(:AUTHORIZED_USER, Lithic::Models::AccountHolderCreateParams::KYCExemptionType::TaggedSymbol) + PREPAID_CARD_USER = + T.let(:PREPAID_CARD_USER, Lithic::Models::AccountHolderCreateParams::KYCExemptionType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolderCreateParams::KYCExemptionType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_create_response.rbi b/rbi/lib/lithic/models/account_holder_create_response.rbi new file mode 100644 index 00000000..e91e036b --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_create_response.rbi @@ -0,0 +1,218 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderCreateResponse < Lithic::BaseModel + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account. + sig { returns(String) } + attr_accessor :account_token + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + sig { returns(Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol) } + attr_accessor :status + + # Reason for the evaluation status. + sig { returns(T::Array[Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol]) } + attr_accessor :status_reasons + + # Timestamp of when the account holder was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::Models::RequiredDocument])) } + attr_reader :required_documents + + sig { params(required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)]).void } + attr_writer :required_documents + + sig do + params( + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderCreateResponse::StatusReason::OrSymbol], + created: Time, + external_id: String, + required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)] + ) + .returns(T.attached_class) + end + def self.new(token:, account_token:, status:, status_reasons:, created: nil, external_id: nil, required_documents: nil) + end + + sig do + override + .returns( + { + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol], + created: Time, + external_id: String, + required_documents: T::Array[Lithic::Models::RequiredDocument] + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderCreateResponse::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol) } + + ACCEPTED = T.let(:ACCEPTED, Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol) + PENDING_REVIEW = + T.let(:PENDING_REVIEW, Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol) + PENDING_DOCUMENT = + T.let(:PENDING_DOCUMENT, Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol) + PENDING_RESUBMIT = + T.let(:PENDING_RESUBMIT, Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol) + REJECTED = T.let(:REJECTED, Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol]) } + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderCreateResponse::StatusReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let(:AGE_THRESHOLD_FAILURE, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let(:DOB_VERIFICATION_FAILURE, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + ID_VERIFICATION_FAILURE = + T.let(:ID_VERIFICATION_FAILURE, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + MAX_DOCUMENT_ATTEMPTS = + T.let(:MAX_DOCUMENT_ATTEMPTS, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + MAX_RESUBMISSION_ATTEMPTS = + T.let(:MAX_RESUBMISSION_ATTEMPTS, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + NAME_VERIFICATION_FAILURE = + T.let(:NAME_VERIFICATION_FAILURE, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let(:RISK_THRESHOLD_FAILURE, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + WATCHLIST_ALERT_FAILURE = + T.let(:WATCHLIST_ALERT_FAILURE, Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + + sig { override.returns(T::Array[Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_list_documents_params.rbi b/rbi/lib/lithic/models/account_holder_list_documents_params.rbi new file mode 100644 index 00000000..9f4b9853 --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_list_documents_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderListDocumentsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_list_documents_response.rbi b/rbi/lib/lithic/models/account_holder_list_documents_response.rbi new file mode 100644 index 00000000..b1924cdf --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_list_documents_response.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderListDocumentsResponse < Lithic::BaseModel + sig { returns(T.nilable(T::Array[Lithic::Models::Document])) } + attr_reader :data + + sig { params(data: T::Array[T.any(Lithic::Models::Document, Lithic::Util::AnyHash)]).void } + attr_writer :data + + sig { params(data: T::Array[T.any(Lithic::Models::Document, Lithic::Util::AnyHash)]).returns(T.attached_class) } + def self.new(data: nil) + end + + sig { override.returns({data: T::Array[Lithic::Models::Document]}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_list_params.rbi b/rbi/lib/lithic/models/account_holder_list_params.rbi new file mode 100644 index 00000000..03e7cefe --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_list_params.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Email address of the account holder. The query must be an exact match, case + # insensitive. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # If applicable, represents the external_id associated with the account_holder. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # The number of account_holders to limit the response to. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Phone number of the account holder. The query must be an exact match. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + email: nil, + end_: nil, + ending_before: nil, + external_id: nil, + first_name: nil, + last_name: nil, + legal_business_name: nil, + limit: nil, + phone_number: nil, + starting_after: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_retrieve_document_params.rbi b/rbi/lib/lithic/models/account_holder_retrieve_document_params.rbi new file mode 100644 index 00000000..2d96e9c2 --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_retrieve_document_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderRetrieveDocumentParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(String) } + attr_accessor :account_holder_token + + sig do + params( + account_holder_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(account_holder_token:, request_options: {}) + end + + sig { override.returns({account_holder_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_retrieve_params.rbi b/rbi/lib/lithic/models/account_holder_retrieve_params.rbi new file mode 100644 index 00000000..42388b79 --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rbi b/rbi/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rbi new file mode 100644 index 00000000..336b10e7 --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rbi @@ -0,0 +1,197 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderSimulateEnrollmentDocumentReviewParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The account holder document upload which to perform the simulation upon. + sig { returns(String) } + attr_accessor :document_upload_token + + # An account holder document's upload status for use within the simulation. + sig { returns(Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol) } + attr_accessor :status + + # A list of status reasons associated with a KYB account holder in PENDING_REVIEW + sig { returns(T.nilable(T::Array[String])) } + attr_reader :accepted_entity_status_reasons + + sig { params(accepted_entity_status_reasons: T::Array[String]).void } + attr_writer :accepted_entity_status_reasons + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + sig do + returns( + T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol) + ) + end + attr_reader :status_reason + + sig do + params( + status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol + ) + .void + end + attr_writer :status_reason + + sig do + params( + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol, + accepted_entity_status_reasons: T::Array[String], + status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + document_upload_token:, + status:, + accepted_entity_status_reasons: nil, + status_reason: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol, + accepted_entity_status_reasons: T::Array[String], + status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # An account holder document's upload status for use within the simulation. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol) } + + UPLOADED = + T.let( + :UPLOADED, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + PARTIAL_APPROVAL = + T.let( + :PARTIAL_APPROVAL, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + end + + DOCUMENT_MISSING_REQUIRED_DATA = + T.let( + :DOCUMENT_MISSING_REQUIRED_DATA, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_UPLOAD_TOO_BLURRY = + T.let( + :DOCUMENT_UPLOAD_TOO_BLURRY, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + FILE_SIZE_TOO_LARGE = + T.let( + :FILE_SIZE_TOO_LARGE, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + INVALID_DOCUMENT_TYPE = + T.let( + :INVALID_DOCUMENT_TYPE, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + INVALID_DOCUMENT_UPLOAD = + T.let( + :INVALID_DOCUMENT_UPLOAD, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + INVALID_ENTITY = + T.let( + :INVALID_ENTITY, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_EXPIRED = + T.let( + :DOCUMENT_EXPIRED, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = + T.let( + :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_TYPE_NOT_SUPPORTED = + T.let( + :DOCUMENT_TYPE_NOT_SUPPORTED, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + UNKNOWN_FAILURE_REASON = + T.let( + :UNKNOWN_FAILURE_REASON, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + UNKNOWN_ERROR = + T.let( + :UNKNOWN_ERROR, + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_simulate_enrollment_review_params.rbi b/rbi/lib/lithic/models/account_holder_simulate_enrollment_review_params.rbi new file mode 100644 index 00000000..6aa216fa --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_simulate_enrollment_review_params.rbi @@ -0,0 +1,191 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderSimulateEnrollmentReviewParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The account holder which to perform the simulation upon. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_token + + sig { params(account_holder_token: String).void } + attr_writer :account_holder_token + + # An account holder's status for use within the simulation. + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol).void } + attr_writer :status + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + sig do + returns( + T.nilable(T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol]) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol] + ) + .void + end + attr_writer :status_reasons + + sig do + params( + account_holder_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(account_holder_token: nil, status: nil, status_reasons: nil, request_options: {}) + end + + sig do + override + .returns( + { + account_holder_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # An account holder's status for use within the simulation. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol) } + + ACCEPTED = + T.let(:ACCEPTED, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol) + REJECTED = + T.let(:REJECTED, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol]) + end + def self.values + end + end + + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol) } + + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_simulate_enrollment_review_response.rbi b/rbi/lib/lithic/models/account_holder_simulate_enrollment_review_response.rbi new file mode 100644 index 00000000..f925a4ca --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_simulate_enrollment_review_response.rbi @@ -0,0 +1,1305 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderSimulateEnrollmentReviewResponse < Lithic::BaseModel + # Globally unique identifier for the account holder. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Globally unique identifier for the account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only present when user_type == "BUSINESS". List of all entities with >25% + # ownership in the company. + sig { returns(T.nilable(T::Array[Lithic::Models::KYBBusinessEntity])) } + attr_reader :beneficial_owner_entities + + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash)] + ) + .void + end + attr_writer :beneficial_owner_entities + + # Only present when user_type == "BUSINESS". List of all individuals with >25% + # ownership in the company. + sig do + returns( + T.nilable( + T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: T::Array[ + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual, + Lithic::Util::AnyHash + ) + ] + ) + .void + end + attr_writer :beneficial_owner_individuals + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig { returns(T.nilable(Lithic::Models::KYBBusinessEntity)) } + attr_reader :business_entity + + sig { params(business_entity: T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash)).void } + attr_writer :business_entity + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson)) } + attr_reader :control_person + + sig do + params( + control_person: T.any(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :control_person + + # Timestamp of when the account holder was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # < Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary email of Account Holder. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + sig do + returns( + T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol) + ) + end + attr_reader :exemption_type + + sig do + params( + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol + ) + .void + end + attr_writer :exemption_type + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual)) } + attr_reader :individual + + sig do + params( + individual: T.any(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :individual + + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary phone of Account Holder, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::Models::RequiredDocument])) } + attr_reader :required_documents + + sig { params(required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)]).void } + attr_writer :required_documents + + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::OrSymbol).void } + attr_writer :status + + # Reason for the + # evaluation status. + sig do + returns( + T.nilable( + T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol] + ) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::OrSymbol] + ) + .void + end + attr_writer :status_reasons + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol)) } + attr_reader :user_type + + sig { params(user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::OrSymbol).void } + attr_writer :user_type + + # Information about the most recent identity verification attempt + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication)) } + attr_reader :verification_application + + sig do + params( + verification_application: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :verification_application + + # Only present when user_type == "BUSINESS". Business's primary website. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + token: String, + account_token: String, + beneficial_owner_entities: T::Array[T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[ + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual, + Lithic::Util::AnyHash + ) + ], + business_account_token: String, + business_entity: T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash), + control_person: T.any(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, Lithic::Util::AnyHash), + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol, + external_id: String, + individual: T.any(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, Lithic::Util::AnyHash), + nature_of_business: String, + phone_number: String, + required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)], + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::OrSymbol], + user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::OrSymbol, + verification_application: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + Lithic::Util::AnyHash + ), + website_url: String + ) + .returns(T.attached_class) + end + def self.new( + token: nil, + account_token: nil, + beneficial_owner_entities: nil, + beneficial_owner_individuals: nil, + business_account_token: nil, + business_entity: nil, + control_person: nil, + created: nil, + email: nil, + exemption_type: nil, + external_id: nil, + individual: nil, + nature_of_business: nil, + phone_number: nil, + required_documents: nil, + status: nil, + status_reasons: nil, + user_type: nil, + verification_application: nil, + website_url: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_token: String, + beneficial_owner_entities: T::Array[Lithic::Models::KYBBusinessEntity], + beneficial_owner_individuals: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::Models::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol, + external_id: String, + individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::Models::RequiredDocument], + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol], + user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol, + verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + Lithic::Util::AnyHash + ), + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address)) } + attr_reader :address + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig do + params( + address: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + Lithic::Util::AnyHash + ), + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + module ExemptionType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol) } + + AUTHORIZED_USER = + T.let( + :AUTHORIZED_USER, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol + ) + PREPAID_CARD_USER = + T.let( + :PREPAID_CARD_USER, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol] + ) + end + def self.values + end + end + + class Individual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address)) } + attr_reader :address + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + params( + address: T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + Lithic::Util::AnyHash + ), + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol) } + + ACCEPTED = + T.let(:ACCEPTED, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ) + REJECTED = + T.let(:REJECTED, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol]) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol] + ) + end + def self.values + end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + module UserType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol) } + + BUSINESS = + T.let(:BUSINESS, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol) + INDIVIDUAL = + T.let(:INDIVIDUAL, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol]) + end + def self.values + end + end + + class VerificationApplication < Lithic::BaseModel + # Timestamp of when the application was created. + sig { returns(Time) } + attr_accessor :created + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig do + returns( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the evaluation status. + sig do + returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + attr_accessor :status_reasons + + # Timestamp of when the application was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Information about the most recent identity verification attempt + sig do + params( + created: Time, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::OrSymbol, + status_reasons: T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::OrSymbol + ], + updated: Time + ) + .returns(T.attached_class) + end + def self.new(created:, status:, status_reasons:, updated:) + end + + sig do + override + .returns( + { + created: Time, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol, + status_reasons: T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ], + updated: Time + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + end + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + end + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_update_params.rbi b/rbi/lib/lithic/models/account_holder_update_params.rbi new file mode 100644 index 00000000..466d7e2a --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_update_params.rbi @@ -0,0 +1,741 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background. If no business owner is an entity, pass in an empty + # list. However, either this parameter or `beneficial_owner_individuals` must be + # populated. on entities that should be included. + sig { returns(T.nilable(T::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity])) } + attr_reader :beneficial_owner_entities + + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity, Lithic::Util::AnyHash)] + ) + .void + end + attr_writer :beneficial_owner_entities + + # List of all individuals with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an + # individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background on individuals that should be included. If no individual + # is an entity, pass in an empty list. However, either this parameter or + # `beneficial_owner_entities` must be populated. + sig { returns(T.nilable(T::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual])) } + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual, Lithic::Util::AnyHash)] + ) + .void + end + attr_writer :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateParams::BusinessEntity)) } + attr_reader :business_entity + + sig do + params( + business_entity: T.any(Lithic::Models::AccountHolderUpdateParams::BusinessEntity, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateParams::ControlPerson)) } + attr_reader :control_person + + sig do + params( + control_person: T.any(Lithic::Models::AccountHolderUpdateParams::ControlPerson, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :control_person + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Short description of the company's line of business (i.e., what does the company + # do?). + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateParams::Individual)) } + attr_reader :individual + + sig do + params(individual: T.any(Lithic::Models::AccountHolderUpdateParams::Individual, Lithic::Util::AnyHash)) + .void + end + attr_writer :individual + + # Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + sig { returns(T.nilable(Lithic::Models::AddressUpdate)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # account holder is associated. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Allowed for all Account Holders. Account holder's email address. The primary + # purpose of this field is for cardholder identification and verification during + # the digital wallet tokenization process. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Allowed for BYO-KYB. Legal business name of the account holder. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # Allowed for all Account Holders. Account holder's phone number, entered in E.164 + # format. The primary purpose of this field is for cardholder identification and + # verification during the digital wallet tokenization process. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual, Lithic::Util::AnyHash)], + business_entity: T.any(Lithic::Models::AccountHolderUpdateParams::BusinessEntity, Lithic::Util::AnyHash), + control_person: T.any(Lithic::Models::AccountHolderUpdateParams::ControlPerson, Lithic::Util::AnyHash), + external_id: String, + nature_of_business: String, + website_url: String, + individual: T.any(Lithic::Models::AccountHolderUpdateParams::Individual, Lithic::Util::AnyHash), + address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash), + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + beneficial_owner_entities: nil, + beneficial_owner_individuals: nil, + business_entity: nil, + control_person: nil, + external_id: nil, + nature_of_business: nil, + website_url: nil, + individual: nil, + address: nil, + business_account_token: nil, + email: nil, + first_name: nil, + last_name: nil, + legal_business_name: nil, + phone_number: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + beneficial_owner_entities: T::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity], + beneficial_owner_individuals: T::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual], + business_entity: Lithic::Models::AccountHolderUpdateParams::BusinessEntity, + control_person: Lithic::Models::AccountHolderUpdateParams::ControlPerson, + external_id: String, + nature_of_business: String, + website_url: String, + individual: Lithic::Models::AccountHolderUpdateParams::Individual, + address: Lithic::Models::AddressUpdate, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + class BeneficialOwnerEntity < Lithic::BaseModel + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(T.nilable(Lithic::Models::AddressUpdate)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Legal (formal) business name. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :phone_numbers + + sig { params(phone_numbers: T::Array[String]).void } + attr_writer :phone_numbers + + sig do + params( + entity_token: String, + address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash), + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + entity_token:, + address: nil, + dba_business_name: nil, + government_id: nil, + legal_business_name: nil, + parent_company: nil, + phone_numbers: nil + ) + end + + sig do + override + .returns( + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: T::Array[String] + } + ) + end + def to_hash + end + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Models::AddressUpdate)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Individuals associated with a KYB application. Phone number is optional. + sig do + params( + entity_token: String, + address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new( + entity_token:, + address: nil, + dob: nil, + email: nil, + first_name: nil, + government_id: nil, + last_name: nil, + phone_number: nil + ) + end + + sig do + override + .returns( + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class BusinessEntity < Lithic::BaseModel + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(T.nilable(Lithic::Models::AddressUpdate)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Legal (formal) business name. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :phone_numbers + + sig { params(phone_numbers: T::Array[String]).void } + attr_writer :phone_numbers + + # Information for business for which the account is being opened and KYB is being + # run. + sig do + params( + entity_token: String, + address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash), + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + entity_token:, + address: nil, + dba_business_name: nil, + government_id: nil, + legal_business_name: nil, + parent_company: nil, + phone_numbers: nil + ) + end + + sig do + override + .returns( + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: T::Array[String] + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::BaseModel + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Models::AddressUpdate)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + entity_token: String, + address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new( + entity_token:, + address: nil, + dob: nil, + email: nil, + first_name: nil, + government_id: nil, + last_name: nil, + phone_number: nil + ) + end + + sig do + override + .returns( + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class Individual < Lithic::BaseModel + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Models::AddressUpdate)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + params( + entity_token: String, + address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new( + entity_token:, + address: nil, + dob: nil, + email: nil, + first_name: nil, + government_id: nil, + last_name: nil, + phone_number: nil + ) + end + + sig do + override + .returns( + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_update_response.rbi b/rbi/lib/lithic/models/account_holder_update_response.rbi new file mode 100644 index 00000000..84ad9efd --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_update_response.rbi @@ -0,0 +1,1523 @@ +# typed: strong + +module Lithic + module Models + module AccountHolderUpdateResponse + extend Lithic::Union + + class KYBKYCPatchResponse < Lithic::BaseModel + # Globally unique identifier for the account holder. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Globally unique identifier for the account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only present when user_type == "BUSINESS". List of all entities with >25% + # ownership in the company. + sig { returns(T.nilable(T::Array[Lithic::Models::KYBBusinessEntity])) } + attr_reader :beneficial_owner_entities + + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash)] + ) + .void + end + attr_writer :beneficial_owner_entities + + # Only present when user_type == "BUSINESS". List of all individuals with >25% + # ownership in the company. + sig do + returns( + T.nilable( + T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: T::Array[ + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual, + Lithic::Util::AnyHash + ) + ] + ) + .void + end + attr_writer :beneficial_owner_individuals + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig { returns(T.nilable(Lithic::Models::KYBBusinessEntity)) } + attr_reader :business_entity + + sig { params(business_entity: T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash)).void } + attr_writer :business_entity + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson)) } + attr_reader :control_person + + sig do + params( + control_person: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :control_person + + # Timestamp of when the account holder was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # < Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary email of Account Holder. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + sig do + returns( + T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol) + ) + end + attr_reader :exemption_type + + sig do + params( + exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::OrSymbol + ) + .void + end + attr_writer :exemption_type + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual)) } + attr_reader :individual + + sig do + params( + individual: T.any(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :individual + + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL". + # + # > Primary phone of Account Holder, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::Models::RequiredDocument])) } + attr_reader :required_documents + + sig { params(required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)]).void } + attr_writer :required_documents + + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::OrSymbol).void } + attr_writer :status + + # Reason for the + # evaluation status. + sig do + returns( + T.nilable( + T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol] + ) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::OrSymbol] + ) + .void + end + attr_writer :status_reasons + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + sig do + returns( + T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol) + ) + end + attr_reader :user_type + + sig do + params(user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::OrSymbol) + .void + end + attr_writer :user_type + + # Information about the most recent identity verification attempt + sig do + returns( + T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication) + ) + end + attr_reader :verification_application + + sig do + params( + verification_application: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :verification_application + + # Only present when user_type == "BUSINESS". Business's primary website. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + token: String, + account_token: String, + beneficial_owner_entities: T::Array[T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[ + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual, + Lithic::Util::AnyHash + ) + ], + business_account_token: String, + business_entity: T.any(Lithic::Models::KYBBusinessEntity, Lithic::Util::AnyHash), + control_person: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + Lithic::Util::AnyHash + ), + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::OrSymbol, + external_id: String, + individual: T.any(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, Lithic::Util::AnyHash), + nature_of_business: String, + phone_number: String, + required_documents: T::Array[T.any(Lithic::Models::RequiredDocument, Lithic::Util::AnyHash)], + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::OrSymbol], + user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::OrSymbol, + verification_application: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + Lithic::Util::AnyHash + ), + website_url: String + ) + .returns(T.attached_class) + end + def self.new( + token: nil, + account_token: nil, + beneficial_owner_entities: nil, + beneficial_owner_individuals: nil, + business_account_token: nil, + business_entity: nil, + control_person: nil, + created: nil, + email: nil, + exemption_type: nil, + external_id: nil, + individual: nil, + nature_of_business: nil, + phone_number: nil, + required_documents: nil, + status: nil, + status_reasons: nil, + user_type: nil, + verification_application: nil, + website_url: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_token: String, + beneficial_owner_entities: T::Array[Lithic::Models::KYBBusinessEntity], + beneficial_owner_individuals: T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::Models::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol, + external_id: String, + individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::Models::RequiredDocument], + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol], + user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol, + verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + Lithic::Util::AnyHash + ), + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address) + ) + end + attr_reader :address + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig do + params( + address: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + Lithic::Util::AnyHash + ), + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account + # holder is not KYC-Exempt. + module ExemptionType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol + ) + end + + AUTHORIZED_USER = + T.let( + :AUTHORIZED_USER, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol + ) + PREPAID_CARD_USER = + T.let( + :PREPAID_CARD_USER, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol] + ) + end + def self.values + end + end + + class Individual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address)) } + attr_reader :address + + sig do + params( + address: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + params( + address: T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + Lithic::Util::AnyHash + ), + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # + # + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol) } + + ACCEPTED = + T.let(:ACCEPTED, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ) + REJECTED = + T.let(:REJECTED, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol]) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + end + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol] + ) + end + def self.values + end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "beneficial_owner_entities", + # + # "nature_of_business", and "website_url" attributes will be present. + module UserType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol) } + + BUSINESS = + T.let(:BUSINESS, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol] + ) + end + def self.values + end + end + + class VerificationApplication < Lithic::BaseModel + # Timestamp of when the application was created. + sig { returns(Time) } + attr_accessor :created + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig do + returns( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the evaluation status. + sig do + returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + attr_accessor :status_reasons + + # Timestamp of when the application was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Information about the most recent identity verification attempt + sig do + params( + created: Time, + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::OrSymbol, + status_reasons: T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::OrSymbol + ], + updated: Time + ) + .returns(T.attached_class) + end + def self.new(created:, status:, status_reasons:, updated:) + end + + sig do + override + .returns( + { + created: Time, + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol, + status_reasons: T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ], + updated: Time + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + end + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + end + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class PatchResponse < Lithic::BaseModel + # The token for the account holder that was updated + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The address for the account holder + sig { returns(T.nilable(Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address)) } + attr_reader :address + + sig do + params( + address: T.any(Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :address + + # The token for the business account that the account holder is associated with + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # The email for the account holder + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The first name for the account holder + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # The last name for the account holder + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # The legal business name for the account holder + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # The phone_number for the account holder + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + token: String, + address: T.any(Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, Lithic::Util::AnyHash), + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new( + token: nil, + address: nil, + business_account_token: nil, + email: nil, + first_name: nil, + last_name: nil, + legal_business_name: nil, + phone_number: nil + ) + end + + sig do + override + .returns( + { + token: String, + address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # The address for the account holder + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + sig do + override + .returns( + [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, Lithic::Models::AccountHolderUpdateResponse::PatchResponse] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/lib/lithic/models/account_holder_upload_document_params.rbi b/rbi/lib/lithic/models/account_holder_upload_document_params.rbi new file mode 100644 index 00000000..ced776eb --- /dev/null +++ b/rbi/lib/lithic/models/account_holder_upload_document_params.rbi @@ -0,0 +1,115 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderUploadDocumentParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The type of document to upload + sig { returns(Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::OrSymbol) } + attr_accessor :document_type + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + sig do + params( + document_type: Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::OrSymbol, + entity_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(document_type:, entity_token:, request_options: {}) + end + + sig do + override + .returns( + { + document_type: Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::OrSymbol, + entity_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of document to upload + module DocumentType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) } + + EIN_LETTER = + T.let(:EIN_LETTER, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + TAX_RETURN = + T.let(:TAX_RETURN, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + OPERATING_AGREEMENT = + T.let(:OPERATING_AGREEMENT, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + CERTIFICATE_OF_FORMATION = + T.let( + :CERTIFICATE_OF_FORMATION, + Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + DRIVERS_LICENSE = + T.let(:DRIVERS_LICENSE, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + PASSPORT = + T.let(:PASSPORT, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + PASSPORT_CARD = + T.let(:PASSPORT_CARD, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + CERTIFICATE_OF_GOOD_STANDING = + T.let( + :CERTIFICATE_OF_GOOD_STANDING, + Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + ARTICLES_OF_INCORPORATION = + T.let( + :ARTICLES_OF_INCORPORATION, + Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + ARTICLES_OF_ORGANIZATION = + T.let( + :ARTICLES_OF_ORGANIZATION, + Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + BYLAWS = T.let(:BYLAWS, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + GOVERNMENT_BUSINESS_LICENSE = + T.let( + :GOVERNMENT_BUSINESS_LICENSE, + Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + PARTNERSHIP_AGREEMENT = + T.let( + :PARTNERSHIP_AGREEMENT, + Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + SS4_FORM = + T.let(:SS4_FORM, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + BANK_STATEMENT = + T.let(:BANK_STATEMENT, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + UTILITY_BILL_STATEMENT = + T.let( + :UTILITY_BILL_STATEMENT, + Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + SSN_CARD = + T.let(:SSN_CARD, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + ITIN_LETTER = + T.let(:ITIN_LETTER, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + FINCEN_BOI_REPORT = + T.let(:FINCEN_BOI_REPORT, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_list_params.rbi b/rbi/lib/lithic/models/account_list_params.rbi new file mode 100644 index 00000000..9636b971 --- /dev/null +++ b/rbi/lib/lithic/models/account_list_params.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module Lithic + module Models + class AccountListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_retrieve_params.rbi b/rbi/lib/lithic/models/account_retrieve_params.rbi new file mode 100644 index 00000000..0d6e4806 --- /dev/null +++ b/rbi/lib/lithic/models/account_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class AccountRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_retrieve_spend_limits_params.rbi b/rbi/lib/lithic/models/account_retrieve_spend_limits_params.rbi new file mode 100644 index 00000000..46f6189c --- /dev/null +++ b/rbi/lib/lithic/models/account_retrieve_spend_limits_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class AccountRetrieveSpendLimitsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/account_spend_limits.rbi b/rbi/lib/lithic/models/account_spend_limits.rbi new file mode 100644 index 00000000..e3d79e19 --- /dev/null +++ b/rbi/lib/lithic/models/account_spend_limits.rbi @@ -0,0 +1,156 @@ +# typed: strong + +module Lithic + module Models + class AccountSpendLimits < Lithic::BaseModel + sig { returns(Lithic::Models::AccountSpendLimits::AvailableSpendLimit) } + attr_reader :available_spend_limit + + sig do + params( + available_spend_limit: T.any(Lithic::Models::AccountSpendLimits::AvailableSpendLimit, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :available_spend_limit + + sig { returns(T.nilable(Lithic::Models::AccountSpendLimits::SpendLimit)) } + attr_reader :spend_limit + + sig { params(spend_limit: T.any(Lithic::Models::AccountSpendLimits::SpendLimit, Lithic::Util::AnyHash)).void } + attr_writer :spend_limit + + sig { returns(T.nilable(Lithic::Models::AccountSpendLimits::SpendVelocity)) } + attr_reader :spend_velocity + + sig do + params(spend_velocity: T.any(Lithic::Models::AccountSpendLimits::SpendVelocity, Lithic::Util::AnyHash)) + .void + end + attr_writer :spend_velocity + + sig do + params( + available_spend_limit: T.any(Lithic::Models::AccountSpendLimits::AvailableSpendLimit, Lithic::Util::AnyHash), + spend_limit: T.any(Lithic::Models::AccountSpendLimits::SpendLimit, Lithic::Util::AnyHash), + spend_velocity: T.any(Lithic::Models::AccountSpendLimits::SpendVelocity, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(available_spend_limit:, spend_limit: nil, spend_velocity: nil) + end + + sig do + override + .returns( + { + available_spend_limit: Lithic::Models::AccountSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::Models::AccountSpendLimits::SpendLimit, + spend_velocity: Lithic::Models::AccountSpendLimits::SpendVelocity + } + ) + end + def to_hash + end + + class AvailableSpendLimit < Lithic::BaseModel + # The available spend limit (in cents) relative to the daily limit configured on + # the Account (e.g. 100000 would be a $1,000 limit). + sig { returns(T.nilable(Integer)) } + attr_reader :daily + + sig { params(daily: Integer).void } + attr_writer :daily + + # The available spend limit (in cents) relative to the lifetime limit configured + # on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime + + sig { params(lifetime: Integer).void } + attr_writer :lifetime + + # The available spend limit (in cents) relative to the monthly limit configured on + # the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig { params(daily: Integer, lifetime: Integer, monthly: Integer).returns(T.attached_class) } + def self.new(daily: nil, lifetime: nil, monthly: nil) + end + + sig { override.returns({daily: Integer, lifetime: Integer, monthly: Integer}) } + def to_hash + end + end + + class SpendLimit < Lithic::BaseModel + # The configured daily spend limit (in cents) on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :daily + + sig { params(daily: Integer).void } + attr_writer :daily + + # The configured lifetime spend limit (in cents) on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime + + sig { params(lifetime: Integer).void } + attr_writer :lifetime + + # The configured monthly spend limit (in cents) on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig { params(daily: Integer, lifetime: Integer, monthly: Integer).returns(T.attached_class) } + def self.new(daily: nil, lifetime: nil, monthly: nil) + end + + sig { override.returns({daily: Integer, lifetime: Integer, monthly: Integer}) } + def to_hash + end + end + + class SpendVelocity < Lithic::BaseModel + # Current daily spend velocity (in cents) on the Account. Present if daily spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :daily + + sig { params(daily: Integer).void } + attr_writer :daily + + # Current lifetime spend velocity (in cents) on the Account. Present if lifetime + # spend limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime + + sig { params(lifetime: Integer).void } + attr_writer :lifetime + + # Current monthly spend velocity (in cents) on the Account. Present if monthly + # spend limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig { params(daily: Integer, lifetime: Integer, monthly: Integer).returns(T.attached_class) } + def self.new(daily: nil, lifetime: nil, monthly: nil) + end + + sig { override.returns({daily: Integer, lifetime: Integer, monthly: Integer}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/account_update_params.rbi b/rbi/lib/lithic/models/account_update_params.rbi new file mode 100644 index 00000000..807b9d6b --- /dev/null +++ b/rbi/lib/lithic/models/account_update_params.rbi @@ -0,0 +1,185 @@ +# typed: strong + +module Lithic + module Models + class AccountUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + sig { returns(T.nilable(Integer)) } + attr_reader :daily_spend_limit + + sig { params(daily_spend_limit: Integer).void } + attr_writer :daily_spend_limit + + # Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime_spend_limit + + sig { params(lifetime_spend_limit: Integer).void } + attr_writer :lifetime_spend_limit + + # Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly_spend_limit + + sig { params(monthly_spend_limit: Integer).void } + attr_writer :monthly_spend_limit + + # Account states. + sig { returns(T.nilable(Lithic::Models::AccountUpdateParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::Models::AccountUpdateParams::State::OrSymbol).void } + attr_writer :state + + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Authorization Rules. The field will be removed from + # the schema in a future release. + sig { returns(T.nilable(Lithic::Models::AccountUpdateParams::VerificationAddress)) } + attr_reader :verification_address + + sig do + params( + verification_address: T.any(Lithic::Models::AccountUpdateParams::VerificationAddress, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :verification_address + + sig do + params( + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::Models::AccountUpdateParams::State::OrSymbol, + verification_address: T.any(Lithic::Models::AccountUpdateParams::VerificationAddress, Lithic::Util::AnyHash), + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + daily_spend_limit: nil, + lifetime_spend_limit: nil, + monthly_spend_limit: nil, + state: nil, + verification_address: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::Models::AccountUpdateParams::State::OrSymbol, + verification_address: Lithic::Models::AccountUpdateParams::VerificationAddress, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Account states. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AccountUpdateParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AccountUpdateParams::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AccountUpdateParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::AccountUpdateParams::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AccountUpdateParams::State::TaggedSymbol]) } + def self.values + end + end + + class VerificationAddress < Lithic::BaseModel + sig { returns(T.nilable(String)) } + attr_reader :address1 + + sig { params(address1: String).void } + attr_writer :address1 + + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Authorization Rules. The field will be removed from + # the schema in a future release. + sig do + params( + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + ) + .returns(T.attached_class) + end + def self.new(address1: nil, address2: nil, city: nil, country: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/address.rbi b/rbi/lib/lithic/models/address.rbi new file mode 100644 index 00000000..4dddee86 --- /dev/null +++ b/rbi/lib/lithic/models/address.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Lithic + module Models + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character + # format. Only USA is currently supported for all workflows. KYC_EXEMPT supports + # CAN additionally. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. USA postal codes (ZIP codes) are supported, entered as a + # five-digit postal code or nine-digit postal code (ZIP+4) using the format + # 12345-1234. KYC_EXEMPT supports Canadian postal codes. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. USA state codes are supported, entered in uppercase ISO 3166-2 + # two-character format. KYC_EXEMPT supports Canadian province codes. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/address_update.rbi b/rbi/lib/lithic/models/address_update.rbi new file mode 100644 index 00000000..148f71a3 --- /dev/null +++ b/rbi/lib/lithic/models/address_update.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Lithic + module Models + class AddressUpdate < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(T.nilable(String)) } + attr_reader :address1 + + sig { params(address1: String).void } + attr_writer :address1 + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Name of city. + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + params( + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + ) + .returns(T.attached_class) + end + def self.new(address1: nil, address2: nil, city: nil, country: nil, postal_code: nil, state: nil) + end + + sig do + override + .returns( + { + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/aggregate_balance.rbi b/rbi/lib/lithic/models/aggregate_balance.rbi new file mode 100644 index 00000000..7424a2f2 --- /dev/null +++ b/rbi/lib/lithic/models/aggregate_balance.rbi @@ -0,0 +1,118 @@ +# typed: strong + +module Lithic + module Models + class AggregateBalance < Lithic::BaseModel + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :available_amount + + # Date and time for when the balance was first created. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + sig { returns(String) } + attr_accessor :currency + + # Type of financial account + sig { returns(Lithic::Models::AggregateBalance::FinancialAccountType::TaggedSymbol) } + attr_accessor :financial_account_type + + # Globally unique identifier for the financial account that had its balance + # updated most recently + sig { returns(String) } + attr_accessor :last_financial_account_token + + # Globally unique identifier for the last transaction event that impacted this + # balance + sig { returns(String) } + attr_accessor :last_transaction_event_token + + # Globally unique identifier for the last transaction that impacted this balance + sig { returns(String) } + attr_accessor :last_transaction_token + + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :pending_amount + + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD) + sig { returns(Integer) } + attr_accessor :total_amount + + # Date and time for when the balance was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Aggregate Balance across all end-user accounts + sig do + params( + available_amount: Integer, + created: Time, + currency: String, + financial_account_type: Lithic::Models::AggregateBalance::FinancialAccountType::OrSymbol, + last_financial_account_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + available_amount:, + created:, + currency:, + financial_account_type:, + last_financial_account_token:, + last_transaction_event_token:, + last_transaction_token:, + pending_amount:, + total_amount:, + updated: + ) + end + + sig do + override + .returns( + { + available_amount: Integer, + created: Time, + currency: String, + financial_account_type: Lithic::Models::AggregateBalance::FinancialAccountType::TaggedSymbol, + last_financial_account_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + ) + end + def to_hash + end + + # Type of financial account + module FinancialAccountType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AggregateBalance::FinancialAccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AggregateBalance::FinancialAccountType::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::AggregateBalance::FinancialAccountType::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::AggregateBalance::FinancialAccountType::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::AggregateBalance::FinancialAccountType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AggregateBalance::FinancialAccountType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/aggregate_balance_list_params.rbi b/rbi/lib/lithic/models/aggregate_balance_list_params.rbi new file mode 100644 index 00000000..0bbdbad5 --- /dev/null +++ b/rbi/lib/lithic/models/aggregate_balance_list_params.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + class AggregateBalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Get the aggregate balance for a given Financial Account type. + sig { returns(T.nilable(Lithic::Models::AggregateBalanceListParams::FinancialAccountType::OrSymbol)) } + attr_reader :financial_account_type + + sig do + params(financial_account_type: Lithic::Models::AggregateBalanceListParams::FinancialAccountType::OrSymbol) + .void + end + attr_writer :financial_account_type + + sig do + params( + financial_account_type: Lithic::Models::AggregateBalanceListParams::FinancialAccountType::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(financial_account_type: nil, request_options: {}) + end + + sig do + override + .returns( + { + financial_account_type: Lithic::Models::AggregateBalanceListParams::FinancialAccountType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Get the aggregate balance for a given Financial Account type. + module FinancialAccountType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol) + OPERATING = + T.let(:OPERATING, Lithic::Models::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AggregateBalanceListParams::FinancialAccountType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/api_status.rbi b/rbi/lib/lithic/models/api_status.rbi new file mode 100644 index 00000000..6767286e --- /dev/null +++ b/rbi/lib/lithic/models/api_status.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Lithic + module Models + class APIStatus < Lithic::BaseModel + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + sig { params(message: String).returns(T.attached_class) } + def self.new(message: nil) + end + + sig { override.returns({message: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/auth_rule.rbi b/rbi/lib/lithic/models/auth_rules/auth_rule.rbi new file mode 100644 index 00000000..7347475e --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/auth_rule.rbi @@ -0,0 +1,135 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class AuthRule < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Indicates whether the Auth Rule is ACTIVE or INACTIVE + sig { returns(Lithic::Models::AuthRules::AuthRule::State::OrSymbol) } + attr_accessor :state + + # Array of account_token(s) identifying the accounts that the Auth Rule applies + # to. Note that only this field or `card_tokens` can be provided for a given Auth + # Rule. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :account_tokens + + sig { params(account_tokens: T::Array[String]).void } + attr_writer :account_tokens + + # Countries in which the Auth Rule permits transactions. Note that Lithic + # maintains a list of countries in which all transactions are blocked; "allowing" + # those countries in an Auth Rule does not override the Lithic-wide restrictions. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :allowed_countries + + sig { params(allowed_countries: T::Array[String]).void } + attr_writer :allowed_countries + + # Merchant category codes for which the Auth Rule permits transactions. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :allowed_mcc + + sig { params(allowed_mcc: T::Array[String]).void } + attr_writer :allowed_mcc + + # Countries in which the Auth Rule automatically declines transactions. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :blocked_countries + + sig { params(blocked_countries: T::Array[String]).void } + attr_writer :blocked_countries + + # Merchant category codes for which the Auth Rule automatically declines + # transactions. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :blocked_mcc + + sig { params(blocked_mcc: T::Array[String]).void } + attr_writer :blocked_mcc + + # Array of card_token(s) identifying the cards that the Auth Rule applies to. Note + # that only this field or `account_tokens` can be provided for a given Auth Rule. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :card_tokens + + sig { params(card_tokens: T::Array[String]).void } + attr_writer :card_tokens + + # Boolean indicating whether the Auth Rule is applied at the program level. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :program_level + + sig { params(program_level: T::Boolean).void } + attr_writer :program_level + + sig do + params( + token: String, + state: Lithic::Models::AuthRules::AuthRule::State::OrSymbol, + account_tokens: T::Array[String], + allowed_countries: T::Array[String], + allowed_mcc: T::Array[String], + blocked_countries: T::Array[String], + blocked_mcc: T::Array[String], + card_tokens: T::Array[String], + program_level: T::Boolean + ) + .returns(T.attached_class) + end + def self.new( + token:, + state:, + account_tokens: nil, + allowed_countries: nil, + allowed_mcc: nil, + blocked_countries: nil, + blocked_mcc: nil, + card_tokens: nil, + program_level: nil + ) + end + + sig do + override + .returns( + { + token: String, + state: Lithic::Models::AuthRules::AuthRule::State::OrSymbol, + account_tokens: T::Array[String], + allowed_countries: T::Array[String], + allowed_mcc: T::Array[String], + blocked_countries: T::Array[String], + blocked_mcc: T::Array[String], + card_tokens: T::Array[String], + program_level: T::Boolean + } + ) + end + def to_hash + end + + # Indicates whether the Auth Rule is ACTIVE or INACTIVE + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::AuthRule::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::AuthRule::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::AuthRule::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::AuthRule::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::AuthRule::State::TaggedSymbol]) } + def self.values + end + end + end + end + + AuthRule = AuthRules::AuthRule + end +end diff --git a/rbi/lib/lithic/models/auth_rules/auth_rule_condition.rbi b/rbi/lib/lithic/models/auth_rules/auth_rule_condition.rbi new file mode 100644 index 00000000..675b89b5 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/auth_rule_condition.rbi @@ -0,0 +1,137 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class AuthRuleCondition < Lithic::BaseModel + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + sig { returns(T.nilable(Lithic::Models::AuthRules::ConditionalAttribute::OrSymbol)) } + attr_reader :attribute + + sig { params(attribute: Lithic::Models::AuthRules::ConditionalAttribute::OrSymbol).void } + attr_writer :attribute + + # The operation to apply to the attribute + sig { returns(T.nilable(Lithic::Models::AuthRules::AuthRuleCondition::Operation::OrSymbol)) } + attr_reader :operation + + sig { params(operation: Lithic::Models::AuthRules::AuthRuleCondition::Operation::OrSymbol).void } + attr_writer :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(T.nilable(T.any(String, Integer, T::Array[String]))) } + attr_reader :value + + sig { params(value: T.any(String, Integer, T::Array[String])).void } + attr_writer :value + + sig do + params( + attribute: Lithic::Models::AuthRules::ConditionalAttribute::OrSymbol, + operation: Lithic::Models::AuthRules::AuthRuleCondition::Operation::OrSymbol, + value: T.any(String, Integer, T::Array[String]) + ) + .returns(T.attached_class) + end + def self.new(attribute: nil, operation: nil, value: nil) + end + + sig do + override + .returns( + { + attribute: Lithic::Models::AuthRules::ConditionalAttribute::OrSymbol, + operation: Lithic::Models::AuthRules::AuthRuleCondition::Operation::OrSymbol, + value: T.any(String, Integer, T::Array[String]) + } + ) + end + def to_hash + end + + # The operation to apply to the attribute + module Operation + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::AuthRuleCondition::Operation) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol) } + + IS_ONE_OF = T.let(:IS_ONE_OF, Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol) + IS_NOT_ONE_OF = + T.let(:IS_NOT_ONE_OF, Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol) + MATCHES = T.let(:MATCHES, Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol) + DOES_NOT_MATCH = + T.let(:DOES_NOT_MATCH, Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol) + IS_GREATER_THAN = + T.let(:IS_GREATER_THAN, Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol) + IS_LESS_THAN = + T.let(:IS_LESS_THAN, Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::AuthRuleCondition::Operation::TaggedSymbol]) } + def self.values + end + end + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + module Value + extend Lithic::Union + + StringArray = T.let(Lithic::ArrayOf[String], Lithic::Converter) + + sig { override.returns([String, Integer, T::Array[String]]) } + def self.variants + end + end + end + end + + AuthRuleCondition = AuthRules::AuthRuleCondition + end +end diff --git a/rbi/lib/lithic/models/auth_rules/conditional_attribute.rbi b/rbi/lib/lithic/models/auth_rules/conditional_attribute.rbi new file mode 100644 index 00000000..1a22ebc8 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/conditional_attribute.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + module ConditionalAttribute + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::ConditionalAttribute) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) } + + MCC = T.let(:MCC, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + COUNTRY = T.let(:COUNTRY, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + CURRENCY = T.let(:CURRENCY, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + MERCHANT_ID = T.let(:MERCHANT_ID, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + DESCRIPTOR = T.let(:DESCRIPTOR, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + LIABILITY_SHIFT = T.let(:LIABILITY_SHIFT, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + PAN_ENTRY_MODE = T.let(:PAN_ENTRY_MODE, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + TRANSACTION_AMOUNT = + T.let(:TRANSACTION_AMOUNT, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + RISK_SCORE = T.let(:RISK_SCORE, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + CARD_TRANSACTION_COUNT_15_M = + T.let(:CARD_TRANSACTION_COUNT_15M, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + CARD_TRANSACTION_COUNT_1_H = + T.let(:CARD_TRANSACTION_COUNT_1H, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + CARD_TRANSACTION_COUNT_24_H = + T.let(:CARD_TRANSACTION_COUNT_24H, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + CARD_STATE = T.let(:CARD_STATE, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + PIN_ENTERED = T.let(:PIN_ENTERED, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + PIN_STATUS = T.let(:PIN_STATUS, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + WALLET_TYPE = T.let(:WALLET_TYPE, Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::ConditionalAttribute::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/conditional_block_parameters.rbi b/rbi/lib/lithic/models/auth_rules/conditional_block_parameters.rbi new file mode 100644 index 00000000..2b9312b1 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/conditional_block_parameters.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ConditionalBlockParameters < Lithic::BaseModel + sig { returns(T::Array[Lithic::Models::AuthRules::AuthRuleCondition]) } + attr_accessor :conditions + + sig do + params(conditions: T::Array[T.any(Lithic::Models::AuthRules::AuthRuleCondition, Lithic::Util::AnyHash)]) + .returns(T.attached_class) + end + def self.new(conditions:) + end + + sig { override.returns({conditions: T::Array[Lithic::Models::AuthRules::AuthRuleCondition]}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2/backtest_create_params.rbi b/rbi/lib/lithic/models/auth_rules/v2/backtest_create_params.rbi new file mode 100644 index 00000000..9ee74149 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2/backtest_create_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The end time of the backtest. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # The start time of the backtest. + sig { returns(T.nilable(Time)) } + attr_reader :start + + sig { params(start: Time).void } + attr_writer :start + + sig do + params( + end_: Time, + start: Time, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(end_: nil, start: nil, request_options: {}) + end + + sig { override.returns({end_: Time, start: Time, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2/backtest_create_response.rbi b/rbi/lib/lithic/models/auth_rules/v2/backtest_create_response.rbi new file mode 100644 index 00000000..0b693788 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2/backtest_create_response.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestCreateResponse < Lithic::BaseModel + # Auth Rule Backtest Token + sig { returns(T.nilable(String)) } + attr_reader :backtest_token + + sig { params(backtest_token: String).void } + attr_writer :backtest_token + + sig { params(backtest_token: String).returns(T.attached_class) } + def self.new(backtest_token: nil) + end + + sig { override.returns({backtest_token: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2/backtest_results.rbi b/rbi/lib/lithic/models/auth_rules/v2/backtest_results.rbi new file mode 100644 index 00000000..98a707a4 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2/backtest_results.rbi @@ -0,0 +1,367 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestResults < Lithic::BaseModel + # Auth Rule Backtest Token + sig { returns(String) } + attr_accessor :backtest_token + + sig { returns(Lithic::Models::AuthRules::V2::BacktestResults::Results) } + attr_reader :results + + sig { params(results: T.any(Lithic::Models::AuthRules::V2::BacktestResults::Results, Lithic::Util::AnyHash)).void } + attr_writer :results + + sig { returns(Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters) } + attr_reader :simulation_parameters + + sig do + params( + simulation_parameters: T.any(Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :simulation_parameters + + sig do + params( + backtest_token: String, + results: T.any(Lithic::Models::AuthRules::V2::BacktestResults::Results, Lithic::Util::AnyHash), + simulation_parameters: T.any(Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(backtest_token:, results:, simulation_parameters:) + end + + sig do + override + .returns( + { + backtest_token: String, + results: Lithic::Models::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters + } + ) + end + def to_hash + end + + class Results < Lithic::BaseModel + sig { returns(T.nilable(Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable( + T.any(Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion, Lithic::Util::AnyHash) + ) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable( + T.any(Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion, Lithic::Util::AnyHash) + ) + ) + .void + end + attr_writer :draft_version + + sig do + params( + current_version: T.nilable( + T.any(Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion, Lithic::Util::AnyHash) + ), + draft_version: T.nilable( + T.any(Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion, Lithic::Util::AnyHash) + ) + ) + .returns(T.attached_class) + end + def self.new(current_version: nil, draft_version: nil) + end + + sig do + override + .returns( + { + current_version: T.nilable(Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion) + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # The total number of historical transactions approved by this rule during the + # backtest period, or the number of transactions that would have been approved if + # the rule was evaluated in shadow mode. + sig { returns(T.nilable(Integer)) } + attr_reader :approved + + sig { params(approved: Integer).void } + attr_writer :approved + + # The total number of historical transactions declined by this rule during the + # backtest period, or the number of transactions that would have been declined if + # the rule was evaluated in shadow mode. + sig { returns(T.nilable(Integer)) } + attr_reader :declined + + sig { params(declined: Integer).void } + attr_writer :declined + + # Example authorization request events that would have been approved or declined. + sig do + returns( + T.nilable(T::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example]) + ) + end + attr_reader :examples + + sig do + params( + examples: T::Array[ + T.any( + Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example, + Lithic::Util::AnyHash + ) + ] + ) + .void + end + attr_writer :examples + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(T.nilable(Integer)) } + attr_reader :version + + sig { params(version: Integer).void } + attr_writer :version + + sig do + params( + approved: Integer, + declined: Integer, + examples: T::Array[ + T.any( + Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example, + Lithic::Util::AnyHash + ) + ], + version: Integer + ) + .returns(T.attached_class) + end + def self.new(approved: nil, declined: nil, examples: nil, version: nil) + end + + sig do + override + .returns( + { + approved: Integer, + declined: Integer, + examples: T::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example], + version: Integer + } + ) + end + def to_hash + end + + class Example < Lithic::BaseModel + # Whether the rule would have approved the authorization request. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :approved + + sig { params(approved: T::Boolean).void } + attr_writer :approved + + # The authorization request event token. + sig { returns(T.nilable(String)) } + attr_reader :event_token + + sig { params(event_token: String).void } + attr_writer :event_token + + # The timestamp of the authorization request event. + sig { returns(T.nilable(Time)) } + attr_reader :timestamp + + sig { params(timestamp: Time).void } + attr_writer :timestamp + + sig do + params(approved: T::Boolean, event_token: String, timestamp: Time).returns(T.attached_class) + end + def self.new(approved: nil, event_token: nil, timestamp: nil) + end + + sig { override.returns({approved: T::Boolean, event_token: String, timestamp: Time}) } + def to_hash + end + end + end + + class DraftVersion < Lithic::BaseModel + # The total number of historical transactions approved by this rule during the + # backtest period, or the number of transactions that would have been approved if + # the rule was evaluated in shadow mode. + sig { returns(T.nilable(Integer)) } + attr_reader :approved + + sig { params(approved: Integer).void } + attr_writer :approved + + # The total number of historical transactions declined by this rule during the + # backtest period, or the number of transactions that would have been declined if + # the rule was evaluated in shadow mode. + sig { returns(T.nilable(Integer)) } + attr_reader :declined + + sig { params(declined: Integer).void } + attr_writer :declined + + # Example authorization request events that would have been approved or declined. + sig do + returns( + T.nilable(T::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example]) + ) + end + attr_reader :examples + + sig do + params( + examples: T::Array[ + T.any( + Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example, + Lithic::Util::AnyHash + ) + ] + ) + .void + end + attr_writer :examples + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(T.nilable(Integer)) } + attr_reader :version + + sig { params(version: Integer).void } + attr_writer :version + + sig do + params( + approved: Integer, + declined: Integer, + examples: T::Array[ + T.any( + Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example, + Lithic::Util::AnyHash + ) + ], + version: Integer + ) + .returns(T.attached_class) + end + def self.new(approved: nil, declined: nil, examples: nil, version: nil) + end + + sig do + override + .returns( + { + approved: Integer, + declined: Integer, + examples: T::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example], + version: Integer + } + ) + end + def to_hash + end + + class Example < Lithic::BaseModel + # Whether the rule would have approved the authorization request. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :approved + + sig { params(approved: T::Boolean).void } + attr_writer :approved + + # The authorization request event token. + sig { returns(T.nilable(String)) } + attr_reader :event_token + + sig { params(event_token: String).void } + attr_writer :event_token + + # The timestamp of the authorization request event. + sig { returns(T.nilable(Time)) } + attr_reader :timestamp + + sig { params(timestamp: Time).void } + attr_writer :timestamp + + sig do + params(approved: T::Boolean, event_token: String, timestamp: Time).returns(T.attached_class) + end + def self.new(approved: nil, event_token: nil, timestamp: nil) + end + + sig { override.returns({approved: T::Boolean, event_token: String, timestamp: Time}) } + def to_hash + end + end + end + end + + class SimulationParameters < Lithic::BaseModel + # Auth Rule Token + sig { returns(T.nilable(String)) } + attr_reader :auth_rule_token + + sig { params(auth_rule_token: String).void } + attr_writer :auth_rule_token + + # The end time of the simulation. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # The start time of the simulation. + sig { returns(T.nilable(Time)) } + attr_reader :start + + sig { params(start: Time).void } + attr_writer :start + + sig { params(auth_rule_token: String, end_: Time, start: Time).returns(T.attached_class) } + def self.new(auth_rule_token: nil, end_: nil, start: nil) + end + + sig { override.returns({auth_rule_token: String, end_: Time, start: Time}) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rbi b/rbi/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rbi new file mode 100644 index 00000000..0f931691 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig do + params( + auth_rule_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(auth_rule_token:, request_options: {}) + end + + sig { override.returns({auth_rule_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_apply_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_apply_params.rbi new file mode 100644 index 00000000..313ca3e0 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_apply_params.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ApplyParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + account_tokens: T::Array[String], + card_tokens: T::Array[String], + program_level: T::Boolean, + excluded_card_tokens: T::Array[String], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(account_tokens:, card_tokens:, program_level:, excluded_card_tokens: nil, request_options: {}) + end + + sig do + override + .returns( + { + account_tokens: T::Array[String], + card_tokens: T::Array[String], + program_level: T::Boolean, + excluded_card_tokens: T::Array[String], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_apply_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_apply_response.rbi new file mode 100644 index 00000000..ce343f12 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_apply_response.rbi @@ -0,0 +1,269 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ApplyResponse < Lithic::BaseModel + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :draft_version + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::Models::AuthRules::V2ApplyResponse::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule + sig { returns(Lithic::Models::AuthRules::V2ApplyResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion, Lithic::Util::AnyHash)), + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion, Lithic::Util::AnyHash)), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2ApplyResponse::State::OrSymbol, + type: Lithic::Models::AuthRules::V2ApplyResponse::Type::OrSymbol, + excluded_card_tokens: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_tokens:, + card_tokens:, + current_version:, + draft_version:, + name:, + program_level:, + state:, + type:, + excluded_card_tokens: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2ApplyResponse::State::TaggedSymbol, + type: Lithic::Models::AuthRules::V2ApplyResponse::Type::TaggedSymbol, + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2ApplyResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2ApplyResponse::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::V2ApplyResponse::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2ApplyResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2ApplyResponse::State::TaggedSymbol]) } + def self.values + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2ApplyResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2ApplyResponse::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2ApplyResponse::Type::TaggedSymbol) + VELOCITY_LIMIT = T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2ApplyResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2ApplyResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_create_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_create_params.rbi new file mode 100644 index 00000000..05fc279b --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_create_params.rbi @@ -0,0 +1,147 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2CreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Parameters for the Auth Rule + sig do + returns( + T.nilable( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + ) + end + attr_reader :parameters + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + .void + end + attr_writer :parameters + + # The type of Auth Rule + sig { returns(T.nilable(Lithic::Models::AuthRules::V2CreateParams::Type::OrSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::AuthRules::V2CreateParams::Type::OrSymbol).void } + attr_writer :type + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + account_tokens: T::Array[String], + card_tokens: T::Array[String], + program_level: T::Boolean, + name: T.nilable(String), + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + type: Lithic::Models::AuthRules::V2CreateParams::Type::OrSymbol, + excluded_card_tokens: T::Array[String], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_tokens:, + card_tokens:, + program_level:, + name: nil, + parameters: nil, + type: nil, + excluded_card_tokens: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_tokens: T::Array[String], + name: T.nilable(String), + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + type: Lithic::Models::AuthRules::V2CreateParams::Type::OrSymbol, + card_tokens: T::Array[String], + program_level: T::Boolean, + excluded_card_tokens: T::Array[String], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2CreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2CreateParams::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2CreateParams::Type::TaggedSymbol) + VELOCITY_LIMIT = T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2CreateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2CreateParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_create_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_create_response.rbi new file mode 100644 index 00000000..60bf0648 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_create_response.rbi @@ -0,0 +1,270 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2CreateResponse < Lithic::BaseModel + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2CreateResponse::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2CreateResponse::DraftVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :draft_version + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::Models::AuthRules::V2CreateResponse::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule + sig { returns(Lithic::Models::AuthRules::V2CreateResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion, Lithic::Util::AnyHash)), + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2CreateResponse::DraftVersion, Lithic::Util::AnyHash)), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2CreateResponse::State::OrSymbol, + type: Lithic::Models::AuthRules::V2CreateResponse::Type::OrSymbol, + excluded_card_tokens: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_tokens:, + card_tokens:, + current_version:, + draft_version:, + name:, + program_level:, + state:, + type:, + excluded_card_tokens: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2CreateResponse::DraftVersion), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2CreateResponse::State::TaggedSymbol, + type: Lithic::Models::AuthRules::V2CreateResponse::Type::TaggedSymbol, + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2CreateResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2CreateResponse::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::V2CreateResponse::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2CreateResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2CreateResponse::State::TaggedSymbol]) } + def self.values + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2CreateResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2CreateResponse::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2CreateResponse::Type::TaggedSymbol) + VELOCITY_LIMIT = T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2CreateResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2CreateResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_delete_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_delete_params.rbi new file mode 100644 index 00000000..6f121999 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_delete_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2DeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_draft_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_draft_params.rbi new file mode 100644 index 00000000..d855ae3d --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_draft_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2DraftParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Parameters for the Auth Rule + sig do + returns( + T.nilable( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + ) + end + attr_accessor :parameters + + sig do + params( + parameters: T.nilable( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ), + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(parameters: nil, request_options: {}) + end + + sig do + override + .returns( + { + parameters: T.nilable( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_draft_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_draft_response.rbi new file mode 100644 index 00000000..232fe0a5 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_draft_response.rbi @@ -0,0 +1,269 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2DraftResponse < Lithic::BaseModel + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2DraftResponse::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2DraftResponse::DraftVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :draft_version + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::Models::AuthRules::V2DraftResponse::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule + sig { returns(Lithic::Models::AuthRules::V2DraftResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion, Lithic::Util::AnyHash)), + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2DraftResponse::DraftVersion, Lithic::Util::AnyHash)), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2DraftResponse::State::OrSymbol, + type: Lithic::Models::AuthRules::V2DraftResponse::Type::OrSymbol, + excluded_card_tokens: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_tokens:, + card_tokens:, + current_version:, + draft_version:, + name:, + program_level:, + state:, + type:, + excluded_card_tokens: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2DraftResponse::DraftVersion), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2DraftResponse::State::TaggedSymbol, + type: Lithic::Models::AuthRules::V2DraftResponse::Type::TaggedSymbol, + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2DraftResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2DraftResponse::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::V2DraftResponse::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2DraftResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2DraftResponse::State::TaggedSymbol]) } + def self.values + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2DraftResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2DraftResponse::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2DraftResponse::Type::TaggedSymbol) + VELOCITY_LIMIT = T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2DraftResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2DraftResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_list_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_list_params.rbi new file mode 100644 index 00000000..47f21a4b --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_list_params.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Only return Authorization Rules that are bound to the provided account token. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only return Authorization Rules that are bound to the provided card token. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + account_token: String, + card_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + card_token: nil, + ending_before: nil, + page_size: nil, + starting_after: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + card_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_list_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_list_response.rbi new file mode 100644 index 00000000..0fb45478 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_list_response.rbi @@ -0,0 +1,268 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ListResponse < Lithic::BaseModel + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2ListResponse::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ListResponse::CurrentVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2ListResponse::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ListResponse::DraftVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :draft_version + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::Models::AuthRules::V2ListResponse::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule + sig { returns(Lithic::Models::AuthRules::V2ListResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ListResponse::CurrentVersion, Lithic::Util::AnyHash)), + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2ListResponse::DraftVersion, Lithic::Util::AnyHash)), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2ListResponse::State::OrSymbol, + type: Lithic::Models::AuthRules::V2ListResponse::Type::OrSymbol, + excluded_card_tokens: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_tokens:, + card_tokens:, + current_version:, + draft_version:, + name:, + program_level:, + state:, + type:, + excluded_card_tokens: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(Lithic::Models::AuthRules::V2ListResponse::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2ListResponse::DraftVersion), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2ListResponse::State::TaggedSymbol, + type: Lithic::Models::AuthRules::V2ListResponse::Type::TaggedSymbol, + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2ListResponse::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2ListResponse::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::V2ListResponse::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2ListResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2ListResponse::State::TaggedSymbol]) } + def self.values + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2ListResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2ListResponse::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2ListResponse::Type::TaggedSymbol) + VELOCITY_LIMIT = T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2ListResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2ListResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_promote_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_promote_params.rbi new file mode 100644 index 00000000..f0cdf821 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_promote_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2PromoteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_promote_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_promote_response.rbi new file mode 100644 index 00000000..61092ceb --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_promote_response.rbi @@ -0,0 +1,270 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2PromoteResponse < Lithic::BaseModel + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :draft_version + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::Models::AuthRules::V2PromoteResponse::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule + sig { returns(Lithic::Models::AuthRules::V2PromoteResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion, Lithic::Util::AnyHash)), + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion, Lithic::Util::AnyHash)), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2PromoteResponse::State::OrSymbol, + type: Lithic::Models::AuthRules::V2PromoteResponse::Type::OrSymbol, + excluded_card_tokens: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_tokens:, + card_tokens:, + current_version:, + draft_version:, + name:, + program_level:, + state:, + type:, + excluded_card_tokens: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2PromoteResponse::State::TaggedSymbol, + type: Lithic::Models::AuthRules::V2PromoteResponse::Type::TaggedSymbol, + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2PromoteResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2PromoteResponse::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::V2PromoteResponse::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2PromoteResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2PromoteResponse::State::TaggedSymbol]) } + def self.values + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2PromoteResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2PromoteResponse::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2PromoteResponse::Type::TaggedSymbol) + VELOCITY_LIMIT = T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2PromoteResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2PromoteResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_report_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_report_params.rbi new file mode 100644 index 00000000..b21a9c8a --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_report_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ReportParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_report_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_report_response.rbi new file mode 100644 index 00000000..5a01dccc --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_report_response.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ReportResponse < Lithic::BaseModel + sig { returns(T.nilable(String)) } + attr_reader :report_token + + sig { params(report_token: String).void } + attr_writer :report_token + + sig { params(report_token: String).returns(T.attached_class) } + def self.new(report_token: nil) + end + + sig { override.returns({report_token: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_retrieve_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_retrieve_params.rbi new file mode 100644 index 00000000..705b232d --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2RetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_retrieve_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_retrieve_response.rbi new file mode 100644 index 00000000..a88beb23 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_retrieve_response.rbi @@ -0,0 +1,271 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2RetrieveResponse < Lithic::BaseModel + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :draft_version + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::Models::AuthRules::V2RetrieveResponse::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule + sig { returns(Lithic::Models::AuthRules::V2RetrieveResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion, Lithic::Util::AnyHash)), + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion, Lithic::Util::AnyHash)), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2RetrieveResponse::State::OrSymbol, + type: Lithic::Models::AuthRules::V2RetrieveResponse::Type::OrSymbol, + excluded_card_tokens: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_tokens:, + card_tokens:, + current_version:, + draft_version:, + name:, + program_level:, + state:, + type:, + excluded_card_tokens: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2RetrieveResponse::State::TaggedSymbol, + type: Lithic::Models::AuthRules::V2RetrieveResponse::Type::TaggedSymbol, + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::V2RetrieveResponse::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2RetrieveResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2RetrieveResponse::State::TaggedSymbol]) } + def self.values + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2RetrieveResponse::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2RetrieveResponse::Type::TaggedSymbol) + VELOCITY_LIMIT = + T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2RetrieveResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2RetrieveResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_update_params.rbi b/rbi/lib/lithic/models/auth_rules/v2_update_params.rbi new file mode 100644 index 00000000..14a8b40d --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_update_params.rbi @@ -0,0 +1,113 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2UpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Account tokens to which the Auth Rule applies. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :account_tokens + + sig { params(account_tokens: T::Array[String]).void } + attr_writer :account_tokens + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + sig { returns(T.nilable(Lithic::Models::AuthRules::V2UpdateParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::Models::AuthRules::V2UpdateParams::State::OrSymbol).void } + attr_writer :state + + # Card tokens to which the Auth Rule applies. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :card_tokens + + sig { params(card_tokens: T::Array[String]).void } + attr_writer :card_tokens + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :program_level + + sig { params(program_level: T::Boolean).void } + attr_writer :program_level + + sig do + params( + account_tokens: T::Array[String], + name: T.nilable(String), + state: Lithic::Models::AuthRules::V2UpdateParams::State::OrSymbol, + card_tokens: T::Array[String], + excluded_card_tokens: T::Array[String], + program_level: T::Boolean, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_tokens: nil, + name: nil, + state: nil, + card_tokens: nil, + excluded_card_tokens: nil, + program_level: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_tokens: T::Array[String], + name: T.nilable(String), + state: Lithic::Models::AuthRules::V2UpdateParams::State::OrSymbol, + card_tokens: T::Array[String], + excluded_card_tokens: T::Array[String], + program_level: T::Boolean, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2UpdateParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2UpdateParams::State::TaggedSymbol) } + + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2UpdateParams::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2UpdateParams::State::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/v2_update_response.rbi b/rbi/lib/lithic/models/auth_rules/v2_update_response.rbi new file mode 100644 index 00000000..a28aa28f --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/v2_update_response.rbi @@ -0,0 +1,270 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2UpdateResponse < Lithic::BaseModel + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :draft_version + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::Models::AuthRules::V2UpdateResponse::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule + sig { returns(Lithic::Models::AuthRules::V2UpdateResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(T.any(Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion, Lithic::Util::AnyHash)), + draft_version: T.nilable(T.any(Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion, Lithic::Util::AnyHash)), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2UpdateResponse::State::OrSymbol, + type: Lithic::Models::AuthRules::V2UpdateResponse::Type::OrSymbol, + excluded_card_tokens: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_tokens:, + card_tokens:, + current_version:, + draft_version:, + name:, + program_level:, + state:, + type:, + excluded_card_tokens: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: T.nilable(Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion), + draft_version: T.nilable(Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion), + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::Models::AuthRules::V2UpdateResponse::State::TaggedSymbol, + type: Lithic::Models::AuthRules::V2UpdateResponse::Type::TaggedSymbol, + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::BaseModel + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + ) + .returns(T.attached_class) + end + def self.new(parameters:, version:) + end + + sig do + override + .returns( + { + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Models::AuthRules::VelocityLimitParams + ), + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Union + + sig do + override + .returns( + [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + ) + end + def self.variants + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2UpdateResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2UpdateResponse::State::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::AuthRules::V2UpdateResponse::State::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::AuthRules::V2UpdateResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2UpdateResponse::State::TaggedSymbol]) } + def self.values + end + end + + # The type of Auth Rule + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::V2UpdateResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::V2UpdateResponse::Type::TaggedSymbol) } + + CONDITIONAL_BLOCK = + T.let(:CONDITIONAL_BLOCK, Lithic::Models::AuthRules::V2UpdateResponse::Type::TaggedSymbol) + VELOCITY_LIMIT = T.let(:VELOCITY_LIMIT, Lithic::Models::AuthRules::V2UpdateResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::V2UpdateResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/velocity_limit_params.rbi b/rbi/lib/lithic/models/auth_rules/velocity_limit_params.rbi new file mode 100644 index 00000000..6be2cb23 --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/velocity_limit_params.rbi @@ -0,0 +1,140 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class VelocityLimitParams < Lithic::BaseModel + sig { returns(Lithic::Models::AuthRules::VelocityLimitParams::Filters) } + attr_reader :filters + + sig { params(filters: T.any(Lithic::Models::AuthRules::VelocityLimitParams::Filters, Lithic::Util::AnyHash)).void } + attr_writer :filters + + # The size of the trailing window to calculate Spend Velocity over in seconds. The + # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + sig { returns(T.any(Integer, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::OrSymbol)) } + attr_accessor :period + + sig { returns(Lithic::Models::AuthRules::VelocityLimitParams::Scope::OrSymbol) } + attr_accessor :scope + + # The maximum amount of spend velocity allowed in the period in minor units (the + # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this + # limit will be declined. + sig { returns(T.nilable(Integer)) } + attr_accessor :limit_amount + + # The number of spend velocity impacting transactions may not exceed this limit in + # the period. Transactions exceeding this limit will be declined. A spend velocity + # impacting transaction is a transaction that has been authorized, and optionally + # settled, or a force post (a transaction that settled without prior + # authorization). + sig { returns(T.nilable(Integer)) } + attr_accessor :limit_count + + sig do + params( + filters: T.any(Lithic::Models::AuthRules::VelocityLimitParams::Filters, Lithic::Util::AnyHash), + period: T.any(Integer, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::OrSymbol), + scope: Lithic::Models::AuthRules::VelocityLimitParams::Scope::OrSymbol, + limit_amount: T.nilable(Integer), + limit_count: T.nilable(Integer) + ) + .returns(T.attached_class) + end + def self.new(filters:, period:, scope:, limit_amount: nil, limit_count: nil) + end + + sig do + override + .returns( + { + filters: Lithic::Models::AuthRules::VelocityLimitParams::Filters, + period: T.any(Integer, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::OrSymbol), + scope: Lithic::Models::AuthRules::VelocityLimitParams::Scope::OrSymbol, + limit_amount: T.nilable(Integer), + limit_count: T.nilable(Integer) + } + ) + end + def to_hash + end + + class Filters < Lithic::BaseModel + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_countries + + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_mccs + + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_countries + + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_mccs + + sig do + params( + exclude_countries: T.nilable(T::Array[String]), + exclude_mccs: T.nilable(T::Array[String]), + include_countries: T.nilable(T::Array[String]), + include_mccs: T.nilable(T::Array[String]) + ) + .returns(T.attached_class) + end + def self.new(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil) + end + + sig do + override + .returns( + { + exclude_countries: T.nilable(T::Array[String]), + exclude_mccs: T.nilable(T::Array[String]), + include_countries: T.nilable(T::Array[String]), + include_mccs: T.nilable(T::Array[String]) + } + ) + end + def to_hash + end + end + + # The size of the trailing window to calculate Spend Velocity over in seconds. The + # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + module Period + extend Lithic::Union + + sig { override.returns([Integer, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::OrSymbol]) } + def self.variants + end + end + + module Scope + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope::TaggedSymbol) } + + CARD = T.let(:CARD, Lithic::Models::AuthRules::VelocityLimitParams::Scope::TaggedSymbol) + ACCOUNT = T.let(:ACCOUNT, Lithic::Models::AuthRules::VelocityLimitParams::Scope::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::VelocityLimitParams::Scope::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_rules/velocity_limit_params_period_window.rbi b/rbi/lib/lithic/models/auth_rules/velocity_limit_params_period_window.rbi new file mode 100644 index 00000000..6ae8a8ef --- /dev/null +++ b/rbi/lib/lithic/models/auth_rules/velocity_limit_params_period_window.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # The window of time to calculate Spend Velocity over. + # + # - `DAY`: Velocity over the current day since midnight Eastern Time. + # - `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in + # Eastern Time. + # - `MONTH`: Velocity over the current month since 00:00 / 12 AM on the first of + # the month in Eastern Time. + module VelocityLimitParamsPeriodWindow + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TaggedSymbol) } + + DAY = T.let(:DAY, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TaggedSymbol) + WEEK = T.let(:WEEK, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TaggedSymbol) + MONTH = T.let(:MONTH, Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::AuthRules::VelocityLimitParamsPeriodWindow::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbi b/rbi/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbi new file mode 100644 index 00000000..d8080189 --- /dev/null +++ b/rbi/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class AuthStreamEnrollmentRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rbi b/rbi/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rbi new file mode 100644 index 00000000..f49b3474 --- /dev/null +++ b/rbi/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class AuthStreamEnrollmentRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/auth_stream_secret.rbi b/rbi/lib/lithic/models/auth_stream_secret.rbi new file mode 100644 index 00000000..d874887a --- /dev/null +++ b/rbi/lib/lithic/models/auth_stream_secret.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class AuthStreamSecret < Lithic::BaseModel + # The shared HMAC ASA secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new(secret: nil) + end + + sig { override.returns({secret: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/balance.rbi b/rbi/lib/lithic/models/balance.rbi new file mode 100644 index 00000000..632df797 --- /dev/null +++ b/rbi/lib/lithic/models/balance.rbi @@ -0,0 +1,117 @@ +# typed: strong + +module Lithic + module Models + class Balance < Lithic::BaseModel + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :available_amount + + # Date and time for when the balance was first created. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + sig { returns(String) } + attr_accessor :currency + + # Globally unique identifier for the financial account that holds this balance. + sig { returns(String) } + attr_accessor :financial_account_token + + # Type of financial account. + sig { returns(Lithic::Models::Balance::FinancialAccountType::TaggedSymbol) } + attr_accessor :financial_account_type + + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + sig { returns(String) } + attr_accessor :last_transaction_event_token + + # Globally unique identifier for the last financial transaction that impacted this + # balance. + sig { returns(String) } + attr_accessor :last_transaction_token + + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + sig { returns(Integer) } + attr_accessor :pending_amount + + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + sig { returns(Integer) } + attr_accessor :total_amount + + # Date and time for when the balance was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Balance + sig do + params( + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::FinancialAccountType::OrSymbol, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + available_amount:, + created:, + currency:, + financial_account_token:, + financial_account_type:, + last_transaction_event_token:, + last_transaction_token:, + pending_amount:, + total_amount:, + updated: + ) + end + + sig do + override + .returns( + { + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::FinancialAccountType::TaggedSymbol, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + ) + end + def to_hash + end + + # Type of financial account. + module FinancialAccountType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Balance::FinancialAccountType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Balance::FinancialAccountType::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::Balance::FinancialAccountType::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::Balance::FinancialAccountType::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::Balance::FinancialAccountType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Balance::FinancialAccountType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/balance_list_params.rbi b/rbi/lib/lithic/models/balance_list_params.rbi new file mode 100644 index 00000000..93fdbd9f --- /dev/null +++ b/rbi/lib/lithic/models/balance_list_params.rbi @@ -0,0 +1,90 @@ +# typed: strong + +module Lithic + module Models + class BalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # List balances for all financial accounts of a given account_token. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # UTC date and time of the balances to retrieve. Defaults to latest available + # balances + sig { returns(T.nilable(Time)) } + attr_reader :balance_date + + sig { params(balance_date: Time).void } + attr_writer :balance_date + + # List balances for all financial accounts of a given business_account_token. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # List balances for a given Financial Account type. + sig { returns(T.nilable(Lithic::Models::BalanceListParams::FinancialAccountType::OrSymbol)) } + attr_reader :financial_account_type + + sig { params(financial_account_type: Lithic::Models::BalanceListParams::FinancialAccountType::OrSymbol).void } + attr_writer :financial_account_type + + sig do + params( + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: Lithic::Models::BalanceListParams::FinancialAccountType::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + balance_date: nil, + business_account_token: nil, + financial_account_type: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: Lithic::Models::BalanceListParams::FinancialAccountType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # List balances for a given Financial Account type. + module FinancialAccountType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BalanceListParams::FinancialAccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::BalanceListParams::FinancialAccountType::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::BalanceListParams::FinancialAccountType::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::BalanceListParams::FinancialAccountType::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::BalanceListParams::FinancialAccountType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BalanceListParams::FinancialAccountType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/book_transfer_create_params.rbi b/rbi/lib/lithic/models/book_transfer_create_params.rbi new file mode 100644 index 00000000..3a54a211 --- /dev/null +++ b/rbi/lib/lithic/models/book_transfer_create_params.rbi @@ -0,0 +1,173 @@ +# typed: strong + +module Lithic + module Models + class BookTransferCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + sig { returns(Integer) } + attr_accessor :amount + + # Category of the book transfer + sig { returns(Lithic::Models::BookTransferCreateParams::Category::OrSymbol) } + attr_accessor :category + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :from_financial_account_token + + # The program specific subtype code for the specified category/type. + sig { returns(String) } + attr_accessor :subtype + + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :to_financial_account_token + + # Type of book_transfer + sig { returns(Lithic::Models::BookTransferCreateParams::Type::OrSymbol) } + attr_accessor :type + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Optional descriptor for the transfer. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::Category::OrSymbol, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::Type::OrSymbol, + token: String, + memo: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + amount:, + category:, + from_financial_account_token:, + subtype:, + to_financial_account_token:, + type:, + token: nil, + memo: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::Category::OrSymbol, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::Type::OrSymbol, + token: String, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Category of the book transfer + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferCreateParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) } + + ADJUSTMENT = T.let(:ADJUSTMENT, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) + BALANCE_OR_FUNDING = + T.let(:BALANCE_OR_FUNDING, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) + DERECOGNITION = T.let(:DERECOGNITION, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) + DISPUTE = T.let(:DISPUTE, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) + FEE = T.let(:FEE, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) + REWARD = T.let(:REWARD, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferCreateParams::Category::TaggedSymbol]) } + def self.values + end + end + + # Type of book_transfer + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) } + + ATM_WITHDRAWAL = T.let(:ATM_WITHDRAWAL, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + ATM_DECLINE = T.let(:ATM_DECLINE, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + INTERNATIONAL_ATM_WITHDRAWAL = + T.let(:INTERNATIONAL_ATM_WITHDRAWAL, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + INACTIVITY = T.let(:INACTIVITY, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + STATEMENT = T.let(:STATEMENT, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + MONTHLY = T.let(:MONTHLY, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + QUARTERLY = T.let(:QUARTERLY, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + ANNUAL = T.let(:ANNUAL, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + CUSTOMER_SERVICE = T.let(:CUSTOMER_SERVICE, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + ACCOUNT_MAINTENANCE = + T.let(:ACCOUNT_MAINTENANCE, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + ACCOUNT_ACTIVATION = + T.let(:ACCOUNT_ACTIVATION, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + ACCOUNT_CLOSURE = T.let(:ACCOUNT_CLOSURE, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + CARD_REPLACEMENT = T.let(:CARD_REPLACEMENT, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + CARD_DELIVERY = T.let(:CARD_DELIVERY, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + CARD_CREATE = T.let(:CARD_CREATE, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + CURRENCY_CONVERSION = + T.let(:CURRENCY_CONVERSION, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + INTEREST = T.let(:INTEREST, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + LATE_PAYMENT = T.let(:LATE_PAYMENT, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + BILL_PAYMENT = T.let(:BILL_PAYMENT, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + CASH_BACK = T.let(:CASH_BACK, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + ACCOUNT_TO_ACCOUNT = + T.let(:ACCOUNT_TO_ACCOUNT, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + CARD_TO_CARD = T.let(:CARD_TO_CARD, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + DISBURSE = T.let(:DISBURSE, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + BILLING_ERROR = T.let(:BILLING_ERROR, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + LOSS_WRITE_OFF = T.let(:LOSS_WRITE_OFF, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + EXPIRED_CARD = T.let(:EXPIRED_CARD, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + EARLY_DERECOGNITION = + T.let(:EARLY_DERECOGNITION, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + ESCHEATMENT = T.let(:ESCHEATMENT, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + INACTIVITY_FEE_DOWN = + T.let(:INACTIVITY_FEE_DOWN, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + PROVISIONAL_CREDIT = + T.let(:PROVISIONAL_CREDIT, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + DISPUTE_WON = T.let(:DISPUTE_WON, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferCreateParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/book_transfer_list_params.rbi b/rbi/lib/lithic/models/book_transfer_list_params.rbi new file mode 100644 index 00000000..a11ef8fe --- /dev/null +++ b/rbi/lib/lithic/models/book_transfer_list_params.rbi @@ -0,0 +1,196 @@ +# typed: strong + +module Lithic + module Models + class BookTransferListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Book Transfer category to be returned. + sig { returns(T.nilable(Lithic::Models::BookTransferListParams::Category::OrSymbol)) } + attr_reader :category + + sig { params(category: Lithic::Models::BookTransferListParams::Category::OrSymbol).void } + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Book transfer result to be returned. + sig { returns(T.nilable(Lithic::Models::BookTransferListParams::Result::OrSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::BookTransferListParams::Result::OrSymbol).void } + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Book transfer status to be returned. + sig { returns(T.nilable(Lithic::Models::BookTransferListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::BookTransferListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::BookTransferListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::BookTransferListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::BookTransferListParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + begin_: nil, + business_account_token: nil, + category: nil, + end_: nil, + ending_before: nil, + financial_account_token: nil, + page_size: nil, + result: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::BookTransferListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::BookTransferListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::BookTransferListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Book Transfer category to be returned. + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferListParams::Category) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) } + + BALANCE_OR_FUNDING = + T.let(:BALANCE_OR_FUNDING, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) + FEE = T.let(:FEE, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) + REWARD = T.let(:REWARD, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) + ADJUSTMENT = T.let(:ADJUSTMENT, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) + DERECOGNITION = T.let(:DERECOGNITION, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) + DISPUTE = T.let(:DISPUTE, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) + INTERNAL = T.let(:INTERNAL, Lithic::Models::BookTransferListParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferListParams::Category::TaggedSymbol]) } + def self.values + end + end + + # Book transfer result to be returned. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferListParams::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::BookTransferListParams::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::BookTransferListParams::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::BookTransferListParams::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferListParams::Result::TaggedSymbol]) } + def self.values + end + end + + # Book transfer status to be returned. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::BookTransferListParams::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::BookTransferListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::BookTransferListParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferListParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/book_transfer_response.rbi b/rbi/lib/lithic/models/book_transfer_response.rbi new file mode 100644 index 00000000..1080ff73 --- /dev/null +++ b/rbi/lib/lithic/models/book_transfer_response.rbi @@ -0,0 +1,277 @@ +# typed: strong + +module Lithic + module Models + class BookTransferResponse < Lithic::BaseModel + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(String) } + attr_accessor :token + + # Category of the book transfer + sig { returns(Lithic::Models::BookTransferResponse::Category::TaggedSymbol) } + attr_accessor :category + + # Date and time when the transfer occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + sig { returns(String) } + attr_accessor :currency + + # A list of all financial events that have modified this transfer. + sig { returns(T::Array[Lithic::Models::BookTransferResponse::Event]) } + attr_accessor :events + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :from_financial_account_token + + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + sig { returns(Integer) } + attr_accessor :pending_amount + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + sig { returns(Lithic::Models::BookTransferResponse::Result::TaggedSymbol) } + attr_accessor :result + + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents). + sig { returns(Integer) } + attr_accessor :settled_amount + + # Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The + # transfer was reversed \* `SETTLED` - The transfer is completed. + sig { returns(Lithic::Models::BookTransferResponse::Status::TaggedSymbol) } + attr_accessor :status + + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + sig { returns(T.anything) } + attr_accessor :to_financial_account_token + + # Date and time when the financial transaction was last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig do + params( + token: String, + category: Lithic::Models::BookTransferResponse::Category::OrSymbol, + created: Time, + currency: String, + events: T::Array[T.any(Lithic::Models::BookTransferResponse::Event, Lithic::Util::AnyHash)], + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::Status::OrSymbol, + to_financial_account_token: T.anything, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + token:, + category:, + created:, + currency:, + events:, + from_financial_account_token:, + pending_amount:, + result:, + settled_amount:, + status:, + to_financial_account_token:, + updated: + ) + end + + sig do + override + .returns( + { + token: String, + category: Lithic::Models::BookTransferResponse::Category::TaggedSymbol, + created: Time, + currency: String, + events: T::Array[Lithic::Models::BookTransferResponse::Event], + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::Status::TaggedSymbol, + to_financial_account_token: T.anything, + updated: Time + } + ) + end + def to_hash + end + + # Category of the book transfer + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferResponse::Category) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) } + + ADJUSTMENT = T.let(:ADJUSTMENT, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) + BALANCE_OR_FUNDING = + T.let(:BALANCE_OR_FUNDING, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) + DERECOGNITION = T.let(:DERECOGNITION, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) + DISPUTE = T.let(:DISPUTE, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) + FEE = T.let(:FEE, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) + REWARD = T.let(:REWARD, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Lithic::Models::BookTransferResponse::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferResponse::Category::TaggedSymbol]) } + def self.values + end + end + + class Event < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + sig { returns(Integer) } + attr_accessor :amount + + # Date and time when the financial event occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # Detailed Results + sig { returns(T::Array[Lithic::Models::BookTransferResponse::Event::DetailedResult::TaggedSymbol]) } + attr_accessor :detailed_results + + # Memo for the transfer. + sig { returns(String) } + attr_accessor :memo + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + sig { returns(Lithic::Models::BookTransferResponse::Event::Result::TaggedSymbol) } + attr_accessor :result + + # The program specific subtype code for the specified category/type. + sig { returns(String) } + attr_accessor :subtype + + # Type of the book transfer + sig { returns(String) } + attr_accessor :type + + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: T::Array[Lithic::Models::BookTransferResponse::Event::DetailedResult::OrSymbol], + memo: String, + result: Lithic::Models::BookTransferResponse::Event::Result::OrSymbol, + subtype: String, + type: String + ) + .returns(T.attached_class) + end + def self.new(token:, amount:, created:, detailed_results:, memo:, result:, subtype:, type:) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: T::Array[Lithic::Models::BookTransferResponse::Event::DetailedResult::TaggedSymbol], + memo: String, + result: Lithic::Models::BookTransferResponse::Event::Result::TaggedSymbol, + subtype: String, + type: String + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::BookTransferResponse::Event::DetailedResult) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::BookTransferResponse::Event::DetailedResult::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::BookTransferResponse::Event::DetailedResult::TaggedSymbol) + FUNDS_INSUFFICIENT = + T.let(:FUNDS_INSUFFICIENT, Lithic::Models::BookTransferResponse::Event::DetailedResult::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferResponse::Event::DetailedResult::TaggedSymbol]) } + def self.values + end + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferResponse::Event::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::BookTransferResponse::Event::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::BookTransferResponse::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::BookTransferResponse::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferResponse::Event::Result::TaggedSymbol]) } + def self.values + end + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferResponse::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::BookTransferResponse::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::BookTransferResponse::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::BookTransferResponse::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferResponse::Result::TaggedSymbol]) } + def self.values + end + end + + # Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The + # transfer was reversed \* `SETTLED` - The transfer is completed. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::BookTransferResponse::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::BookTransferResponse::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::BookTransferResponse::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Models::BookTransferResponse::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::BookTransferResponse::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::BookTransferResponse::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/book_transfer_retrieve_params.rbi b/rbi/lib/lithic/models/book_transfer_retrieve_params.rbi new file mode 100644 index 00000000..a58a9551 --- /dev/null +++ b/rbi/lib/lithic/models/book_transfer_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class BookTransferRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/book_transfer_reverse_params.rbi b/rbi/lib/lithic/models/book_transfer_reverse_params.rbi new file mode 100644 index 00000000..f1e13d18 --- /dev/null +++ b/rbi/lib/lithic/models/book_transfer_reverse_params.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Models + class BookTransferReverseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Optional descriptor for the reversal. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params(memo: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(memo: nil, request_options: {}) + end + + sig { override.returns({memo: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card.rbi b/rbi/lib/lithic/models/card.rbi new file mode 100644 index 00000000..3c1e21dc --- /dev/null +++ b/rbi/lib/lithic/models/card.rbi @@ -0,0 +1,497 @@ +# typed: strong + +module Lithic + module Models + class Card < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account to which the card belongs. + sig { returns(String) } + attr_accessor :account_token + + # Globally unique identifier for the card program on which the card exists. + sig { returns(String) } + attr_accessor :card_program_token + + # An RFC 3339 timestamp for when the card was created. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # Deprecated: Funding account for the card. + sig { returns(Lithic::Models::Card::Funding) } + attr_reader :funding + + sig { params(funding: T.any(Lithic::Models::Card::Funding, Lithic::Util::AnyHash)).void } + attr_writer :funding + + # Last four digits of the card number. + sig { returns(String) } + attr_accessor :last_four + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + sig { returns(Lithic::Models::Card::PinStatus::TaggedSymbol) } + attr_accessor :pin_status + + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. + sig { returns(Integer) } + attr_accessor :spend_limit + + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + sig { returns(Lithic::Models::SpendLimitDuration::TaggedSymbol) } + attr_accessor :spend_limit_duration + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The + # card is provisioned pending manufacturing and fulfillment. Cards in this state + # can accept authorizations for e-commerce purchases, but not for "Card Present" + # purchases where the physical card itself is present. + # - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state + # `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to + # state `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this + # state can be used for e-commerce transactions or can be added to mobile + # wallets. API clients should update the card's state to `OPEN` only after the + # cardholder confirms receipt of the card. + # + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + sig { returns(Lithic::Models::Card::State::TaggedSymbol) } + attr_accessor :state + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + sig { returns(Lithic::Models::Card::Type::TaggedSymbol) } + attr_accessor :type + + # List of identifiers for the Auth Rule(s) that are applied on the card. This + # field is deprecated and will no longer be populated in the `Card` object. The + # key will be removed from the schema in a future release. Use the `/auth_rules` + # endpoints to fetch Auth Rule information instead. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :auth_rule_tokens + + sig { params(auth_rule_tokens: T::Array[String]).void } + attr_writer :auth_rule_tokens + + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_currency + + sig { params(cardholder_currency: String).void } + attr_writer :cardholder_currency + + # Three digit cvv printed on the back of the card. + sig { returns(T.nilable(String)) } + attr_reader :cvv + + sig { params(cvv: String).void } + attr_writer :cvv + + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + # Two digit (MM) expiry month. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # Four digit (yyyy) expiry year. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # Hostname of card’s locked merchant (will be empty if not applicable). + sig { returns(T.nilable(String)) } + attr_reader :hostname + + sig { params(hostname: String).void } + attr_writer :hostname + + # Friendly name to identify the card. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Primary Account Number (PAN) (i.e. the card number). Customers must be PCI + # compliant to have PAN returned as a field in production. Please contact + # [support@lithic.com](mailto:support@lithic.com) for questions. + sig { returns(T.nilable(String)) } + attr_reader :pan + + sig { params(pan: String).void } + attr_writer :pan + + # Indicates if there are offline PIN changes pending card interaction with an + # offline PIN terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable + # only to cards issued in markets supporting offline PINs. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :pending_commands + + sig { params(pending_commands: T::Array[String]).void } + attr_writer :pending_commands + + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # If the card is a replacement for another card, the globally unique identifier + # for the card that was replaced. + sig { returns(T.nilable(String)) } + attr_accessor :replacement_for + + sig do + params( + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: T.any(Lithic::Models::Card::Funding, Lithic::Util::AnyHash), + last_four: String, + pin_status: Lithic::Models::Card::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol, + state: Lithic::Models::Card::State::OrSymbol, + type: Lithic::Models::Card::Type::OrSymbol, + auth_rule_tokens: T::Array[String], + cardholder_currency: String, + cvv: String, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + hostname: String, + memo: String, + pan: String, + pending_commands: T::Array[String], + product_id: String, + replacement_for: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_token:, + card_program_token:, + created:, + funding:, + last_four:, + pin_status:, + spend_limit:, + spend_limit_duration:, + state:, + type:, + auth_rule_tokens: nil, + cardholder_currency: nil, + cvv: nil, + digital_card_art_token: nil, + exp_month: nil, + exp_year: nil, + hostname: nil, + memo: nil, + pan: nil, + pending_commands: nil, + product_id: nil, + replacement_for: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus::TaggedSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::TaggedSymbol, + state: Lithic::Models::Card::State::TaggedSymbol, + type: Lithic::Models::Card::Type::TaggedSymbol, + auth_rule_tokens: T::Array[String], + cardholder_currency: String, + cvv: String, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + hostname: String, + memo: String, + pan: String, + pending_commands: T::Array[String], + product_id: String, + replacement_for: T.nilable(String) + } + ) + end + def to_hash + end + + class Funding < Lithic::BaseModel + # A globally unique identifier for this FundingAccount. + sig { returns(String) } + attr_accessor :token + + # An RFC 3339 string representing when this funding source was added to the Lithic + # account. This may be `null`. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # The last 4 digits of the account (e.g. bank account, debit card) associated with + # this FundingAccount. This may be null. + sig { returns(String) } + attr_accessor :last_four + + # State of funding source. + # + # Funding source states: + # + # - `ENABLED` - The funding account is available to use for card creation and + # transactions. + # - `PENDING` - The funding account is still being verified e.g. bank + # micro-deposits verification. + # - `DELETED` - The founding account has been deleted. + sig { returns(Lithic::Models::Card::Funding::State::TaggedSymbol) } + attr_accessor :state + + # Types of funding source: + # + # - `DEPOSITORY_CHECKING` - Bank checking account. + # - `DEPOSITORY_SAVINGS` - Bank savings account. + sig { returns(Lithic::Models::Card::Funding::Type::TaggedSymbol) } + attr_accessor :type + + # Account name identifying the funding source. This may be `null`. + sig { returns(T.nilable(String)) } + attr_reader :account_name + + sig { params(account_name: String).void } + attr_writer :account_name + + # The nickname given to the `FundingAccount` or `null` if it has no nickname. + sig { returns(T.nilable(String)) } + attr_reader :nickname + + sig { params(nickname: String).void } + attr_writer :nickname + + # Deprecated: Funding account for the card. + sig do + params( + token: String, + created: Time, + last_four: String, + state: Lithic::Models::Card::Funding::State::OrSymbol, + type: Lithic::Models::Card::Funding::Type::OrSymbol, + account_name: String, + nickname: String + ) + .returns(T.attached_class) + end + def self.new(token:, created:, last_four:, state:, type:, account_name: nil, nickname: nil) + end + + sig do + override + .returns( + { + token: String, + created: Time, + last_four: String, + state: Lithic::Models::Card::Funding::State::TaggedSymbol, + type: Lithic::Models::Card::Funding::Type::TaggedSymbol, + account_name: String, + nickname: String + } + ) + end + def to_hash + end + + # State of funding source. + # + # Funding source states: + # + # - `ENABLED` - The funding account is available to use for card creation and + # transactions. + # - `PENDING` - The funding account is still being verified e.g. bank + # micro-deposits verification. + # - `DELETED` - The founding account has been deleted. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Card::Funding::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Card::Funding::State::TaggedSymbol) } + + DELETED = T.let(:DELETED, Lithic::Models::Card::Funding::State::TaggedSymbol) + ENABLED = T.let(:ENABLED, Lithic::Models::Card::Funding::State::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::Card::Funding::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Card::Funding::State::TaggedSymbol]) } + def self.values + end + end + + # Types of funding source: + # + # - `DEPOSITORY_CHECKING` - Bank checking account. + # - `DEPOSITORY_SAVINGS` - Bank savings account. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Card::Funding::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Card::Funding::Type::TaggedSymbol) } + + DEPOSITORY_CHECKING = T.let(:DEPOSITORY_CHECKING, Lithic::Models::Card::Funding::Type::TaggedSymbol) + DEPOSITORY_SAVINGS = T.let(:DEPOSITORY_SAVINGS, Lithic::Models::Card::Funding::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Card::Funding::Type::TaggedSymbol]) } + def self.values + end + end + end + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + module PinStatus + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Card::PinStatus) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Card::PinStatus::TaggedSymbol) } + + OK = T.let(:OK, Lithic::Models::Card::PinStatus::TaggedSymbol) + BLOCKED = T.let(:BLOCKED, Lithic::Models::Card::PinStatus::TaggedSymbol) + NOT_SET = T.let(:NOT_SET, Lithic::Models::Card::PinStatus::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Card::PinStatus::TaggedSymbol]) } + def self.values + end + end + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The + # card is provisioned pending manufacturing and fulfillment. Cards in this state + # can accept authorizations for e-commerce purchases, but not for "Card Present" + # purchases where the physical card itself is present. + # - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state + # `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to + # state `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this + # state can be used for e-commerce transactions or can be added to mobile + # wallets. API clients should update the card's state to `OPEN` only after the + # cardholder confirms receipt of the card. + # + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Card::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Card::State::TaggedSymbol) } + + CLOSED = T.let(:CLOSED, Lithic::Models::Card::State::TaggedSymbol) + OPEN = T.let(:OPEN, Lithic::Models::Card::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::Card::State::TaggedSymbol) + PENDING_ACTIVATION = T.let(:PENDING_ACTIVATION, Lithic::Models::Card::State::TaggedSymbol) + PENDING_FULFILLMENT = T.let(:PENDING_FULFILLMENT, Lithic::Models::Card::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Card::State::TaggedSymbol]) } + def self.values + end + end + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Card::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Card::Type::TaggedSymbol) } + + MERCHANT_LOCKED = T.let(:MERCHANT_LOCKED, Lithic::Models::Card::Type::TaggedSymbol) + PHYSICAL = T.let(:PHYSICAL, Lithic::Models::Card::Type::TaggedSymbol) + SINGLE_USE = T.let(:SINGLE_USE, Lithic::Models::Card::Type::TaggedSymbol) + VIRTUAL = T.let(:VIRTUAL, Lithic::Models::Card::Type::TaggedSymbol) + UNLOCKED = T.let(:UNLOCKED, Lithic::Models::Card::Type::TaggedSymbol) + DIGITAL_WALLET = T.let(:DIGITAL_WALLET, Lithic::Models::Card::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Card::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_convert_physical_params.rbi b/rbi/lib/lithic/models/card_convert_physical_params.rbi new file mode 100644 index 00000000..a669d97d --- /dev/null +++ b/rbi/lib/lithic/models/card_convert_physical_params.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Models + class CardConvertPhysicalParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The shipping address this card will be sent to. + sig { returns(Lithic::Models::ShippingAddress) } + attr_reader :shipping_address + + sig { params(shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash)).void } + attr_writer :shipping_address + + # If omitted, the previous carrier will be used. + sig { returns(T.nilable(Lithic::Models::Carrier)) } + attr_reader :carrier + + sig { params(carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash)).void } + attr_writer :carrier + + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + sig { returns(T.nilable(Lithic::Models::CardConvertPhysicalParams::ShippingMethod::OrSymbol)) } + attr_reader :shipping_method + + sig { params(shipping_method: Lithic::Models::CardConvertPhysicalParams::ShippingMethod::OrSymbol).void } + attr_writer :shipping_method + + sig do + params( + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + product_id: String, + shipping_method: Lithic::Models::CardConvertPhysicalParams::ShippingMethod::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(shipping_address:, carrier: nil, product_id: nil, shipping_method: nil, request_options: {}) + end + + sig do + override + .returns( + { + shipping_address: Lithic::Models::ShippingAddress, + carrier: Lithic::Models::Carrier, + product_id: String, + shipping_method: Lithic::Models::CardConvertPhysicalParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol) } + + NUMBER_2_DAY = T.let(:"2-DAY", Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol) + EXPEDITED = T.let(:EXPEDITED, Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol) + EXPRESS = T.let(:EXPRESS, Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol) + PRIORITY = T.let(:PRIORITY, Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol) + STANDARD = T.let(:STANDARD, Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol) + STANDARD_WITH_TRACKING = + T.let(:STANDARD_WITH_TRACKING, Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_create_params.rbi b/rbi/lib/lithic/models/card_create_params.rbi new file mode 100644 index 00000000..12cc9ef7 --- /dev/null +++ b/rbi/lib/lithic/models/card_create_params.rbi @@ -0,0 +1,351 @@ +# typed: strong + +module Lithic + module Models + class CardCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + sig { returns(Lithic::Models::CardCreateParams::Type::OrSymbol) } + attr_accessor :type + + # Globally unique identifier for the account that the card will be associated + # with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # For card programs with more than one BIN range. This must be configured with + # Lithic before use. Identifies the card program/BIN range under which to create + # the card. If omitted, will utilize the program's default `card_program_token`. + # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + sig { returns(T.nilable(String)) } + attr_reader :card_program_token + + sig { params(card_program_token: String).void } + attr_writer :card_program_token + + sig { returns(T.nilable(Lithic::Models::Carrier)) } + attr_reader :carrier + + sig { params(carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash)).void } + attr_writer :carrier + + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date will be generated. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date will be generated. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # Friendly name to identify the card. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and + # `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + sig { returns(T.nilable(String)) } + attr_reader :pin + + sig { params(pin: String).void } + attr_writer :pin + + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # Restricted field limited to select use cases. Lithic will reach out directly if + # this field should be used. Globally unique identifier for the replacement card's + # account. If this field is specified, `replacement_for` must also be specified. + # If `replacement_for` is specified and this field is omitted, the replacement + # card's account will be inferred from the card being replaced. + sig { returns(T.nilable(String)) } + attr_reader :replacement_account_token + + sig { params(replacement_account_token: String).void } + attr_writer :replacement_account_token + + # Globally unique identifier for the card that this card will replace. If the card + # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is + # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + sig { returns(T.nilable(String)) } + attr_reader :replacement_for + + sig { params(replacement_for: String).void } + attr_writer :replacement_for + + sig { returns(T.nilable(Lithic::Models::ShippingAddress)) } + attr_reader :shipping_address + + sig { params(shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash)).void } + attr_writer :shipping_address + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + sig { returns(T.nilable(Lithic::Models::CardCreateParams::ShippingMethod::OrSymbol)) } + attr_reader :shipping_method + + sig { params(shipping_method: Lithic::Models::CardCreateParams::ShippingMethod::OrSymbol).void } + attr_writer :shipping_method + + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + sig { returns(T.nilable(Integer)) } + attr_reader :spend_limit + + sig { params(spend_limit: Integer).void } + attr_writer :spend_limit + + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + sig { returns(T.nilable(Lithic::Models::SpendLimitDuration::OrSymbol)) } + attr_reader :spend_limit_duration + + sig { params(spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol).void } + attr_writer :spend_limit_duration + + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + sig { returns(T.nilable(Lithic::Models::CardCreateParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::Models::CardCreateParams::State::OrSymbol).void } + attr_writer :state + + sig do + params( + type: Lithic::Models::CardCreateParams::Type::OrSymbol, + account_token: String, + card_program_token: String, + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_for: String, + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + shipping_method: Lithic::Models::CardCreateParams::ShippingMethod::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol, + state: Lithic::Models::CardCreateParams::State::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + type:, + account_token: nil, + card_program_token: nil, + carrier: nil, + digital_card_art_token: nil, + exp_month: nil, + exp_year: nil, + memo: nil, + pin: nil, + product_id: nil, + replacement_account_token: nil, + replacement_for: nil, + shipping_address: nil, + shipping_method: nil, + spend_limit: nil, + spend_limit_duration: nil, + state: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + type: Lithic::Models::CardCreateParams::Type::OrSymbol, + account_token: String, + card_program_token: String, + carrier: Lithic::Models::Carrier, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_for: String, + shipping_address: Lithic::Models::ShippingAddress, + shipping_method: Lithic::Models::CardCreateParams::ShippingMethod::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol, + state: Lithic::Models::CardCreateParams::State::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::CardCreateParams::Type::TaggedSymbol) } + + MERCHANT_LOCKED = T.let(:MERCHANT_LOCKED, Lithic::Models::CardCreateParams::Type::TaggedSymbol) + PHYSICAL = T.let(:PHYSICAL, Lithic::Models::CardCreateParams::Type::TaggedSymbol) + SINGLE_USE = T.let(:SINGLE_USE, Lithic::Models::CardCreateParams::Type::TaggedSymbol) + VIRTUAL = T.let(:VIRTUAL, Lithic::Models::CardCreateParams::Type::TaggedSymbol) + UNLOCKED = T.let(:UNLOCKED, Lithic::Models::CardCreateParams::Type::TaggedSymbol) + DIGITAL_WALLET = T.let(:DIGITAL_WALLET, Lithic::Models::CardCreateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardCreateParams::Type::TaggedSymbol]) } + def self.values + end + end + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardCreateParams::ShippingMethod) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol) } + + NUMBER_2_DAY = T.let(:"2_DAY", Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol) + EXPEDITED = T.let(:EXPEDITED, Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol) + EXPRESS = T.let(:EXPRESS, Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol) + PRIORITY = T.let(:PRIORITY, Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol) + STANDARD = T.let(:STANDARD, Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol) + STANDARD_WITH_TRACKING = + T.let(:STANDARD_WITH_TRACKING, Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardCreateParams::ShippingMethod::TaggedSymbol]) } + def self.values + end + end + + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardCreateParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::CardCreateParams::State::TaggedSymbol) } + + OPEN = T.let(:OPEN, Lithic::Models::CardCreateParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::CardCreateParams::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardCreateParams::State::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_embed_params.rbi b/rbi/lib/lithic/models/card_embed_params.rbi new file mode 100644 index 00000000..c51a3d7d --- /dev/null +++ b/rbi/lib/lithic/models/card_embed_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + class CardEmbedParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # A base64 encoded JSON string of an EmbedRequest to specify which card to load. + sig { returns(String) } + attr_accessor :embed_request + + # SHA256 HMAC of the embed_request JSON string with base64 digest. + sig { returns(String) } + attr_accessor :hmac + + sig do + params( + embed_request: String, + hmac: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(embed_request:, hmac:, request_options: {}) + end + + sig { override.returns({embed_request: String, hmac: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_list_params.rbi b/rbi/lib/lithic/models/card_list_params.rbi new file mode 100644 index 00000000..256e9c6d --- /dev/null +++ b/rbi/lib/lithic/models/card_list_params.rbi @@ -0,0 +1,124 @@ +# typed: strong + +module Lithic + module Models + class CardListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Returns cards associated with the specified account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Returns cards with the specified state. + sig { returns(T.nilable(Lithic::Models::CardListParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::Models::CardListParams::State::OrSymbol).void } + attr_writer :state + + sig do + params( + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + state: Lithic::Models::CardListParams::State::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + begin_: nil, + end_: nil, + ending_before: nil, + page_size: nil, + starting_after: nil, + state: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + state: Lithic::Models::CardListParams::State::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Returns cards with the specified state. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardListParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::CardListParams::State::TaggedSymbol) } + + CLOSED = T.let(:CLOSED, Lithic::Models::CardListParams::State::TaggedSymbol) + OPEN = T.let(:OPEN, Lithic::Models::CardListParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::CardListParams::State::TaggedSymbol) + PENDING_ACTIVATION = T.let(:PENDING_ACTIVATION, Lithic::Models::CardListParams::State::TaggedSymbol) + PENDING_FULFILLMENT = T.let(:PENDING_FULFILLMENT, Lithic::Models::CardListParams::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardListParams::State::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_program.rbi b/rbi/lib/lithic/models/card_program.rbi new file mode 100644 index 00000000..b0dcf4e0 --- /dev/null +++ b/rbi/lib/lithic/models/card_program.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Lithic + module Models + class CardProgram < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Timestamp of when the card program was created. + sig { returns(Time) } + attr_accessor :created + + # The name of the card program. + sig { returns(String) } + attr_accessor :name + + # The first digits of the card number that this card program ends with. + sig { returns(String) } + attr_accessor :pan_range_end + + # The first digits of the card number that this card program starts with. + sig { returns(String) } + attr_accessor :pan_range_start + + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_currency + + sig { params(cardholder_currency: String).void } + attr_writer :cardholder_currency + + # List of 3-character alphabetic ISO 4217 codes for the currencies that the card + # program supports for settlement. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :settlement_currencies + + sig { params(settlement_currencies: T::Array[String]).void } + attr_writer :settlement_currencies + + sig do + params( + token: String, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String, + settlement_currencies: T::Array[String] + ) + .returns(T.attached_class) + end + def self.new( + token:, + created:, + name:, + pan_range_end:, + pan_range_start:, + cardholder_currency: nil, + settlement_currencies: nil + ) + end + + sig do + override + .returns( + { + token: String, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String, + settlement_currencies: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_program_list_params.rbi b/rbi/lib/lithic/models/card_program_list_params.rbi new file mode 100644 index 00000000..90e666ae --- /dev/null +++ b/rbi/lib/lithic/models/card_program_list_params.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + class CardProgramListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_program_retrieve_params.rbi b/rbi/lib/lithic/models/card_program_retrieve_params.rbi new file mode 100644 index 00000000..a769d748 --- /dev/null +++ b/rbi/lib/lithic/models/card_program_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class CardProgramRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_provision_params.rbi b/rbi/lib/lithic/models/card_provision_params.rbi new file mode 100644 index 00000000..067bb3fd --- /dev/null +++ b/rbi/lib/lithic/models/card_provision_params.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module Lithic + module Models + class CardProvisionParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + sig { returns(T.nilable(String)) } + attr_reader :certificate + + sig { params(certificate: String).void } + attr_writer :certificate + + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + sig { returns(T.nilable(String)) } + attr_reader :client_device_id + + sig { params(client_device_id: String).void } + attr_writer :client_device_id + + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + sig { returns(T.nilable(String)) } + attr_reader :client_wallet_account_id + + sig { params(client_wallet_account_id: String).void } + attr_writer :client_wallet_account_id + + # Name of digital wallet provider. + sig { returns(T.nilable(Lithic::Models::CardProvisionParams::DigitalWallet::OrSymbol)) } + attr_reader :digital_wallet + + sig { params(digital_wallet: Lithic::Models::CardProvisionParams::DigitalWallet::OrSymbol).void } + attr_writer :digital_wallet + + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + sig { returns(T.nilable(String)) } + attr_reader :nonce + + sig { params(nonce: String).void } + attr_writer :nonce + + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + sig { returns(T.nilable(String)) } + attr_reader :nonce_signature + + sig { params(nonce_signature: String).void } + attr_writer :nonce_signature + + sig do + params( + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardProvisionParams::DigitalWallet::OrSymbol, + nonce: String, + nonce_signature: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + certificate: nil, + client_device_id: nil, + client_wallet_account_id: nil, + digital_wallet: nil, + nonce: nil, + nonce_signature: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardProvisionParams::DigitalWallet::OrSymbol, + nonce: String, + nonce_signature: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Name of digital wallet provider. + module DigitalWallet + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardProvisionParams::DigitalWallet) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::CardProvisionParams::DigitalWallet::TaggedSymbol) } + + APPLE_PAY = T.let(:APPLE_PAY, Lithic::Models::CardProvisionParams::DigitalWallet::TaggedSymbol) + GOOGLE_PAY = T.let(:GOOGLE_PAY, Lithic::Models::CardProvisionParams::DigitalWallet::TaggedSymbol) + SAMSUNG_PAY = T.let(:SAMSUNG_PAY, Lithic::Models::CardProvisionParams::DigitalWallet::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardProvisionParams::DigitalWallet::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_provision_response.rbi b/rbi/lib/lithic/models/card_provision_response.rbi new file mode 100644 index 00000000..9c9299bf --- /dev/null +++ b/rbi/lib/lithic/models/card_provision_response.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Lithic + module Models + class CardProvisionResponse < Lithic::BaseModel + sig { returns(T.nilable(String)) } + attr_reader :provisioning_payload + + sig { params(provisioning_payload: String).void } + attr_writer :provisioning_payload + + sig { params(provisioning_payload: String).returns(T.attached_class) } + def self.new(provisioning_payload: nil) + end + + sig { override.returns({provisioning_payload: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_reissue_params.rbi b/rbi/lib/lithic/models/card_reissue_params.rbi new file mode 100644 index 00000000..566246e1 --- /dev/null +++ b/rbi/lib/lithic/models/card_reissue_params.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Models + class CardReissueParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # If omitted, the previous carrier will be used. + sig { returns(T.nilable(Lithic::Models::Carrier)) } + attr_reader :carrier + + sig { params(carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash)).void } + attr_writer :carrier + + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # If omitted, the previous shipping address will be used. + sig { returns(T.nilable(Lithic::Models::ShippingAddress)) } + attr_reader :shipping_address + + sig { params(shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash)).void } + attr_writer :shipping_address + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + sig { returns(T.nilable(Lithic::Models::CardReissueParams::ShippingMethod::OrSymbol)) } + attr_reader :shipping_method + + sig { params(shipping_method: Lithic::Models::CardReissueParams::ShippingMethod::OrSymbol).void } + attr_writer :shipping_method + + sig do + params( + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + product_id: String, + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + shipping_method: Lithic::Models::CardReissueParams::ShippingMethod::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(carrier: nil, product_id: nil, shipping_address: nil, shipping_method: nil, request_options: {}) + end + + sig do + override + .returns( + { + carrier: Lithic::Models::Carrier, + product_id: String, + shipping_address: Lithic::Models::ShippingAddress, + shipping_method: Lithic::Models::CardReissueParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardReissueParams::ShippingMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol) } + + NUMBER_2_DAY = T.let(:"2-DAY", Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol) + EXPEDITED = T.let(:EXPEDITED, Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol) + EXPRESS = T.let(:EXPRESS, Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol) + PRIORITY = T.let(:PRIORITY, Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol) + STANDARD = T.let(:STANDARD, Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol) + STANDARD_WITH_TRACKING = + T.let(:STANDARD_WITH_TRACKING, Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardReissueParams::ShippingMethod::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_renew_params.rbi b/rbi/lib/lithic/models/card_renew_params.rbi new file mode 100644 index 00000000..d07877b5 --- /dev/null +++ b/rbi/lib/lithic/models/card_renew_params.rbi @@ -0,0 +1,138 @@ +# typed: strong + +module Lithic + module Models + class CardRenewParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The shipping address this card will be sent to. + sig { returns(Lithic::Models::ShippingAddress) } + attr_reader :shipping_address + + sig { params(shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash)).void } + attr_writer :shipping_address + + # If omitted, the previous carrier will be used. + sig { returns(T.nilable(Lithic::Models::Carrier)) } + attr_reader :carrier + + sig { params(carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash)).void } + attr_writer :carrier + + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date six years in the future will be generated. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date six years in the future will be generated. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + sig { returns(T.nilable(Lithic::Models::CardRenewParams::ShippingMethod::OrSymbol)) } + attr_reader :shipping_method + + sig { params(shipping_method: Lithic::Models::CardRenewParams::ShippingMethod::OrSymbol).void } + attr_writer :shipping_method + + sig do + params( + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::Models::CardRenewParams::ShippingMethod::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + shipping_address:, + carrier: nil, + exp_month: nil, + exp_year: nil, + product_id: nil, + shipping_method: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + shipping_address: Lithic::Models::ShippingAddress, + carrier: Lithic::Models::Carrier, + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::Models::CardRenewParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + module ShippingMethod + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardRenewParams::ShippingMethod) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol) } + + NUMBER_2_DAY = T.let(:"2-DAY", Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol) + EXPEDITED = T.let(:EXPEDITED, Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol) + EXPRESS = T.let(:EXPRESS, Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol) + PRIORITY = T.let(:PRIORITY, Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol) + STANDARD = T.let(:STANDARD, Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol) + STANDARD_WITH_TRACKING = + T.let(:STANDARD_WITH_TRACKING, Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardRenewParams::ShippingMethod::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_retrieve_params.rbi b/rbi/lib/lithic/models/card_retrieve_params.rbi new file mode 100644 index 00000000..f207dab0 --- /dev/null +++ b/rbi/lib/lithic/models/card_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class CardRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_retrieve_spend_limits_params.rbi b/rbi/lib/lithic/models/card_retrieve_spend_limits_params.rbi new file mode 100644 index 00000000..f6dd5082 --- /dev/null +++ b/rbi/lib/lithic/models/card_retrieve_spend_limits_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class CardRetrieveSpendLimitsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_search_by_pan_params.rbi b/rbi/lib/lithic/models/card_search_by_pan_params.rbi new file mode 100644 index 00000000..89ab1cd9 --- /dev/null +++ b/rbi/lib/lithic/models/card_search_by_pan_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class CardSearchByPanParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The PAN for the card being retrieved. + sig { returns(String) } + attr_accessor :pan + + sig do + params(pan: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(pan:, request_options: {}) + end + + sig { override.returns({pan: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/card_spend_limits.rbi b/rbi/lib/lithic/models/card_spend_limits.rbi new file mode 100644 index 00000000..b40eb5fb --- /dev/null +++ b/rbi/lib/lithic/models/card_spend_limits.rbi @@ -0,0 +1,153 @@ +# typed: strong + +module Lithic + module Models + class CardSpendLimits < Lithic::BaseModel + sig { returns(Lithic::Models::CardSpendLimits::AvailableSpendLimit) } + attr_reader :available_spend_limit + + sig do + params( + available_spend_limit: T.any(Lithic::Models::CardSpendLimits::AvailableSpendLimit, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :available_spend_limit + + sig { returns(T.nilable(Lithic::Models::CardSpendLimits::SpendLimit)) } + attr_reader :spend_limit + + sig { params(spend_limit: T.any(Lithic::Models::CardSpendLimits::SpendLimit, Lithic::Util::AnyHash)).void } + attr_writer :spend_limit + + sig { returns(T.nilable(Lithic::Models::CardSpendLimits::SpendVelocity)) } + attr_reader :spend_velocity + + sig { params(spend_velocity: T.any(Lithic::Models::CardSpendLimits::SpendVelocity, Lithic::Util::AnyHash)).void } + attr_writer :spend_velocity + + sig do + params( + available_spend_limit: T.any(Lithic::Models::CardSpendLimits::AvailableSpendLimit, Lithic::Util::AnyHash), + spend_limit: T.any(Lithic::Models::CardSpendLimits::SpendLimit, Lithic::Util::AnyHash), + spend_velocity: T.any(Lithic::Models::CardSpendLimits::SpendVelocity, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(available_spend_limit:, spend_limit: nil, spend_velocity: nil) + end + + sig do + override + .returns( + { + available_spend_limit: Lithic::Models::CardSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::Models::CardSpendLimits::SpendLimit, + spend_velocity: Lithic::Models::CardSpendLimits::SpendVelocity + } + ) + end + def to_hash + end + + class AvailableSpendLimit < Lithic::BaseModel + # The available spend limit (in cents) relative to the annual limit configured on + # the Card (e.g. 100000 would be a $1,000 limit). + sig { returns(T.nilable(Integer)) } + attr_reader :annually + + sig { params(annually: Integer).void } + attr_writer :annually + + # The available spend limit (in cents) relative to the forever limit configured on + # the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :forever + + sig { params(forever: Integer).void } + attr_writer :forever + + # The available spend limit (in cents) relative to the monthly limit configured on + # the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig { params(annually: Integer, forever: Integer, monthly: Integer).returns(T.attached_class) } + def self.new(annually: nil, forever: nil, monthly: nil) + end + + sig { override.returns({annually: Integer, forever: Integer, monthly: Integer}) } + def to_hash + end + end + + class SpendLimit < Lithic::BaseModel + # The configured annual spend limit (in cents) on the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :annually + + sig { params(annually: Integer).void } + attr_writer :annually + + # The configured forever spend limit (in cents) on the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :forever + + sig { params(forever: Integer).void } + attr_writer :forever + + # The configured monthly spend limit (in cents) on the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig { params(annually: Integer, forever: Integer, monthly: Integer).returns(T.attached_class) } + def self.new(annually: nil, forever: nil, monthly: nil) + end + + sig { override.returns({annually: Integer, forever: Integer, monthly: Integer}) } + def to_hash + end + end + + class SpendVelocity < Lithic::BaseModel + # Current annual spend velocity (in cents) on the Card. Present if annual spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :annually + + sig { params(annually: Integer).void } + attr_writer :annually + + # Current forever spend velocity (in cents) on the Card. Present if forever spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :forever + + sig { params(forever: Integer).void } + attr_writer :forever + + # Current monthly spend velocity (in cents) on the Card. Present if monthly spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig { params(annually: Integer, forever: Integer, monthly: Integer).returns(T.attached_class) } + def self.new(annually: nil, forever: nil, monthly: nil) + end + + sig { override.returns({annually: Integer, forever: Integer, monthly: Integer}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/card_update_params.rbi b/rbi/lib/lithic/models/card_update_params.rbi new file mode 100644 index 00000000..dcff42d3 --- /dev/null +++ b/rbi/lib/lithic/models/card_update_params.rbi @@ -0,0 +1,168 @@ +# typed: strong + +module Lithic + module Models + class CardUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + # Friendly name to identify the card. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + sig { returns(T.nilable(String)) } + attr_reader :pin + + sig { params(pin: String).void } + attr_writer :pin + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + sig { returns(T.nilable(Lithic::Models::CardUpdateParams::PinStatus::OrSymbol)) } + attr_reader :pin_status + + sig { params(pin_status: Lithic::Models::CardUpdateParams::PinStatus::OrSymbol).void } + attr_writer :pin_status + + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + sig { returns(T.nilable(Integer)) } + attr_reader :spend_limit + + sig { params(spend_limit: Integer).void } + attr_writer :spend_limit + + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + sig { returns(T.nilable(Lithic::Models::SpendLimitDuration::OrSymbol)) } + attr_reader :spend_limit_duration + + sig { params(spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol).void } + attr_writer :spend_limit_duration + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + sig { returns(T.nilable(Lithic::Models::CardUpdateParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::Models::CardUpdateParams::State::OrSymbol).void } + attr_writer :state + + sig do + params( + digital_card_art_token: String, + memo: String, + pin: String, + pin_status: Lithic::Models::CardUpdateParams::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol, + state: Lithic::Models::CardUpdateParams::State::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + digital_card_art_token: nil, + memo: nil, + pin: nil, + pin_status: nil, + spend_limit: nil, + spend_limit_duration: nil, + state: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + digital_card_art_token: String, + memo: String, + pin: String, + pin_status: Lithic::Models::CardUpdateParams::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol, + state: Lithic::Models::CardUpdateParams::State::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + module PinStatus + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardUpdateParams::PinStatus) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::CardUpdateParams::PinStatus::TaggedSymbol) } + + OK = T.let(:OK, Lithic::Models::CardUpdateParams::PinStatus::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardUpdateParams::PinStatus::TaggedSymbol]) } + def self.values + end + end + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::CardUpdateParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::CardUpdateParams::State::TaggedSymbol) } + + CLOSED = T.let(:CLOSED, Lithic::Models::CardUpdateParams::State::TaggedSymbol) + OPEN = T.let(:OPEN, Lithic::Models::CardUpdateParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::CardUpdateParams::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::CardUpdateParams::State::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/cards/aggregate_balance_list_params.rbi b/rbi/lib/lithic/models/cards/aggregate_balance_list_params.rbi new file mode 100644 index 00000000..f1c535e7 --- /dev/null +++ b/rbi/lib/lithic/models/cards/aggregate_balance_list_params.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Lithic + module Models + module Cards + class AggregateBalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Cardholder to retrieve aggregate balances for. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Business to retrieve aggregate balances for. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + sig do + params( + account_token: String, + business_account_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(account_token: nil, business_account_token: nil, request_options: {}) + end + + sig do + override + .returns({ + account_token: String, + business_account_token: String, + request_options: Lithic::RequestOptions + }) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/cards/aggregate_balance_list_response.rbi b/rbi/lib/lithic/models/cards/aggregate_balance_list_response.rbi new file mode 100644 index 00000000..9e275b02 --- /dev/null +++ b/rbi/lib/lithic/models/cards/aggregate_balance_list_response.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Lithic + module Models + module Cards + class AggregateBalanceListResponse < Lithic::BaseModel + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :available_amount + + # Date and time for when the balance was first created. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + sig { returns(String) } + attr_accessor :currency + + # Globally unique identifier for the card that had its balance updated most + # recently + sig { returns(String) } + attr_accessor :last_card_token + + # Globally unique identifier for the last transaction event that impacted this + # balance + sig { returns(String) } + attr_accessor :last_transaction_event_token + + # Globally unique identifier for the last transaction that impacted this balance + sig { returns(String) } + attr_accessor :last_transaction_token + + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :pending_amount + + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD) + sig { returns(Integer) } + attr_accessor :total_amount + + # Date and time for when the balance was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Card Aggregate Balance across all end-user accounts + sig do + params( + available_amount: Integer, + created: Time, + currency: String, + last_card_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + available_amount:, + created:, + currency:, + last_card_token:, + last_transaction_event_token:, + last_transaction_token:, + pending_amount:, + total_amount:, + updated: + ) + end + + sig do + override + .returns( + { + available_amount: Integer, + created: Time, + currency: String, + last_card_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/cards/balance_list_params.rbi b/rbi/lib/lithic/models/cards/balance_list_params.rbi new file mode 100644 index 00000000..839f2207 --- /dev/null +++ b/rbi/lib/lithic/models/cards/balance_list_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module Cards + class BalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # UTC date of the balance to retrieve. Defaults to latest available balance + sig { returns(T.nilable(Time)) } + attr_reader :balance_date + + sig { params(balance_date: Time).void } + attr_writer :balance_date + + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + sig { returns(T.nilable(String)) } + attr_reader :last_transaction_event_token + + sig { params(last_transaction_event_token: String).void } + attr_writer :last_transaction_event_token + + sig do + params( + balance_date: Time, + last_transaction_event_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(balance_date: nil, last_transaction_event_token: nil, request_options: {}) + end + + sig do + override + .returns( + { + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/cards/balance_list_response.rbi b/rbi/lib/lithic/models/cards/balance_list_response.rbi new file mode 100644 index 00000000..53f91c9b --- /dev/null +++ b/rbi/lib/lithic/models/cards/balance_list_response.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Lithic + module Models + module Cards + class BalanceListResponse < Lithic::BaseModel + # Globally unique identifier for the financial account that holds this balance. + sig { returns(String) } + attr_accessor :token + + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :available_amount + + # Date and time for when the balance was first created. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + sig { returns(String) } + attr_accessor :currency + + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + sig { returns(String) } + attr_accessor :last_transaction_event_token + + # Globally unique identifier for the last financial transaction that impacted this + # balance. + sig { returns(String) } + attr_accessor :last_transaction_token + + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + sig { returns(Integer) } + attr_accessor :pending_amount + + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + sig { returns(Integer) } + attr_accessor :total_amount + + # Type of financial account. + sig { returns(Lithic::Models::Cards::BalanceListResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Date and time for when the balance was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Balance of a Financial Account + sig do + params( + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::Cards::BalanceListResponse::Type::OrSymbol, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + token:, + available_amount:, + created:, + currency:, + last_transaction_event_token:, + last_transaction_token:, + pending_amount:, + total_amount:, + type:, + updated: + ) + end + + sig do + override + .returns( + { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::Cards::BalanceListResponse::Type::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Type of financial account. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Cards::BalanceListResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Cards::BalanceListResponse::Type::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::Cards::BalanceListResponse::Type::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::Cards::BalanceListResponse::Type::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::Cards::BalanceListResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Cards::BalanceListResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/cards/financial_transaction_list_params.rbi b/rbi/lib/lithic/models/cards/financial_transaction_list_params.rbi new file mode 100644 index 00000000..3d179704 --- /dev/null +++ b/rbi/lib/lithic/models/cards/financial_transaction_list_params.rbi @@ -0,0 +1,164 @@ +# typed: strong + +module Lithic + module Models + module Cards + class FinancialTransactionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Financial Transaction category to be returned. + sig { returns(T.nilable(Lithic::Models::Cards::FinancialTransactionListParams::Category::OrSymbol)) } + attr_reader :category + + sig { params(category: Lithic::Models::Cards::FinancialTransactionListParams::Category::OrSymbol).void } + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Financial Transaction result to be returned. + sig { returns(T.nilable(Lithic::Models::Cards::FinancialTransactionListParams::Result::OrSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::Cards::FinancialTransactionListParams::Result::OrSymbol).void } + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Financial Transaction status to be returned. + sig { returns(T.nilable(Lithic::Models::Cards::FinancialTransactionListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::Cards::FinancialTransactionListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + begin_: Time, + category: Lithic::Models::Cards::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: Lithic::Models::Cards::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::Cards::FinancialTransactionListParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + category: nil, + end_: nil, + ending_before: nil, + result: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + category: Lithic::Models::Cards::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: Lithic::Models::Cards::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::Cards::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Financial Transaction category to be returned. + module Category + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category::TaggedSymbol) } + + CARD = T.let(:CARD, Lithic::Models::Cards::FinancialTransactionListParams::Category::TaggedSymbol) + TRANSFER = + T.let(:TRANSFER, Lithic::Models::Cards::FinancialTransactionListParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Cards::FinancialTransactionListParams::Category::TaggedSymbol]) } + def self.values + end + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::Cards::FinancialTransactionListParams::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Cards::FinancialTransactionListParams::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Cards::FinancialTransactionListParams::Result::TaggedSymbol]) } + def self.values + end + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol) + RETURNED = T.let(:RETURNED, Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Cards::FinancialTransactionListParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/cards/financial_transaction_retrieve_params.rbi b/rbi/lib/lithic/models/cards/financial_transaction_retrieve_params.rbi new file mode 100644 index 00000000..99abd1a1 --- /dev/null +++ b/rbi/lib/lithic/models/cards/financial_transaction_retrieve_params.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Lithic + module Models + module Cards + class FinancialTransactionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(String) } + attr_accessor :card_token + + sig do + params(card_token: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(card_token:, request_options: {}) + end + + sig { override.returns({card_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/carrier.rbi b/rbi/lib/lithic/models/carrier.rbi new file mode 100644 index 00000000..66a9278b --- /dev/null +++ b/rbi/lib/lithic/models/carrier.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class Carrier < Lithic::BaseModel + # QR code url to display on the card carrier + sig { returns(T.nilable(String)) } + attr_reader :qr_code_url + + sig { params(qr_code_url: String).void } + attr_writer :qr_code_url + + sig { params(qr_code_url: String).returns(T.attached_class) } + def self.new(qr_code_url: nil) + end + + sig { override.returns({qr_code_url: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/client_api_status_params.rbi b/rbi/lib/lithic/models/client_api_status_params.rbi new file mode 100644 index 00000000..88ede1ff --- /dev/null +++ b/rbi/lib/lithic/models/client_api_status_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class ClientAPIStatusParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/credit_products/extended_credit.rbi b/rbi/lib/lithic/models/credit_products/extended_credit.rbi new file mode 100644 index 00000000..ed12c796 --- /dev/null +++ b/rbi/lib/lithic/models/credit_products/extended_credit.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class CreditProductsExtendedCredit < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :credit_extended + + sig { params(credit_extended: Integer).returns(T.attached_class) } + def self.new(credit_extended:) + end + + sig { override.returns({credit_extended: Integer}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/credit_products/extended_credit_retrieve_params.rbi b/rbi/lib/lithic/models/credit_products/extended_credit_retrieve_params.rbi new file mode 100644 index 00000000..8b00a0bf --- /dev/null +++ b/rbi/lib/lithic/models/credit_products/extended_credit_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class ExtendedCreditRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/credit_products/prime_rate_create_params.rbi b/rbi/lib/lithic/models/credit_products/prime_rate_create_params.rbi new file mode 100644 index 00000000..5b30ff3a --- /dev/null +++ b/rbi/lib/lithic/models/credit_products/prime_rate_create_params.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class PrimeRateCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date the rate goes into effect + sig { returns(Date) } + attr_accessor :effective_date + + # The rate in decimal format + sig { returns(String) } + attr_accessor :rate + + sig do + params( + effective_date: Date, + rate: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(effective_date:, rate:, request_options: {}) + end + + sig do + override.returns({effective_date: Date, rate: String, request_options: Lithic::RequestOptions}) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/credit_products/prime_rate_retrieve_params.rbi b/rbi/lib/lithic/models/credit_products/prime_rate_retrieve_params.rbi new file mode 100644 index 00000000..5e6420f1 --- /dev/null +++ b/rbi/lib/lithic/models/credit_products/prime_rate_retrieve_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class PrimeRateRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The effective date that the prime rates ends before + sig { returns(T.nilable(Date)) } + attr_reader :ending_before + + sig { params(ending_before: Date).void } + attr_writer :ending_before + + # The effective date that the prime rate starts after + sig { returns(T.nilable(Date)) } + attr_reader :starting_after + + sig { params(starting_after: Date).void } + attr_writer :starting_after + + sig do + params( + ending_before: Date, + starting_after: Date, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(ending_before: nil, starting_after: nil, request_options: {}) + end + + sig do + override.returns( + { + ending_before: Date, + starting_after: Date, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/credit_products/prime_rate_retrieve_response.rbi b/rbi/lib/lithic/models/credit_products/prime_rate_retrieve_response.rbi new file mode 100644 index 00000000..d126cc63 --- /dev/null +++ b/rbi/lib/lithic/models/credit_products/prime_rate_retrieve_response.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class PrimeRateRetrieveResponse < Lithic::BaseModel + # List of prime rates + sig { returns(T::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data]) } + attr_accessor :data + + # Whether there are more prime rates + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: T::Array[T.any(Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data, Lithic::Util::AnyHash)], + has_more: T::Boolean + ) + .returns(T.attached_class) + end + def self.new(data:, has_more:) + end + + sig do + override + .returns( + {data: T::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data], has_more: T::Boolean} + ) + end + def to_hash + end + + class Data < Lithic::BaseModel + # Date the rate goes into effect + sig { returns(Date) } + attr_accessor :effective_date + + # The rate in decimal format + sig { returns(String) } + attr_accessor :rate + + sig { params(effective_date: Date, rate: String).returns(T.attached_class) } + def self.new(effective_date:, rate:) + end + + sig { override.returns({effective_date: Date, rate: String}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/digital_card_art.rbi b/rbi/lib/lithic/models/digital_card_art.rbi new file mode 100644 index 00000000..0d6fec1e --- /dev/null +++ b/rbi/lib/lithic/models/digital_card_art.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Lithic + module Models + class DigitalCardArtAPI < Lithic::BaseModel + # Globally unique identifier for the card art. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the card program. + sig { returns(String) } + attr_accessor :card_program_token + + # Timestamp of when card art was created. + sig { returns(Time) } + attr_accessor :created + + # Description of the card art. + sig { returns(String) } + attr_accessor :description + + # Whether the card art is enabled. + sig { returns(T::Boolean) } + attr_accessor :is_enabled + + # Card network. + sig { returns(Lithic::Models::DigitalCardArtAPI::Network::TaggedSymbol) } + attr_accessor :network + + # Whether the card art is the default card art to be added upon tokenization. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_card_program_default + + sig { params(is_card_program_default: T::Boolean).void } + attr_writer :is_card_program_default + + sig do + params( + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: T::Boolean, + network: Lithic::Models::DigitalCardArtAPI::Network::OrSymbol, + is_card_program_default: T::Boolean + ) + .returns(T.attached_class) + end + def self.new(token:, card_program_token:, created:, description:, is_enabled:, network:, is_card_program_default: nil) + end + + sig do + override + .returns( + { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: T::Boolean, + network: Lithic::Models::DigitalCardArtAPI::Network::TaggedSymbol, + is_card_program_default: T::Boolean + } + ) + end + def to_hash + end + + # Card network. + module Network + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::DigitalCardArtAPI::Network) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::DigitalCardArtAPI::Network::TaggedSymbol) } + + MASTERCARD = T.let(:MASTERCARD, Lithic::Models::DigitalCardArtAPI::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::Models::DigitalCardArtAPI::Network::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::DigitalCardArtAPI::Network::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/digital_card_art_list_params.rbi b/rbi/lib/lithic/models/digital_card_art_list_params.rbi new file mode 100644 index 00000000..84fb3da4 --- /dev/null +++ b/rbi/lib/lithic/models/digital_card_art_list_params.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + class DigitalCardArtListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/digital_card_art_retrieve_params.rbi b/rbi/lib/lithic/models/digital_card_art_retrieve_params.rbi new file mode 100644 index 00000000..7e699407 --- /dev/null +++ b/rbi/lib/lithic/models/digital_card_art_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class DigitalCardArtRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute.rbi b/rbi/lib/lithic/models/dispute.rbi new file mode 100644 index 00000000..19b85701 --- /dev/null +++ b/rbi/lib/lithic/models/dispute.rbi @@ -0,0 +1,345 @@ +# typed: strong + +module Lithic + module Models + class Dispute < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Amount under dispute. May be different from the original transaction amount. + sig { returns(Integer) } + attr_accessor :amount + + # Date dispute entered arbitration. + sig { returns(T.nilable(Time)) } + attr_accessor :arbitration_date + + # Timestamp of when first Dispute was reported. + sig { returns(Time) } + attr_accessor :created + + # Date that the dispute was filed by the customer making the dispute. + sig { returns(T.nilable(Time)) } + attr_accessor :customer_filed_date + + # End customer description of the reason for the dispute. + sig { returns(T.nilable(String)) } + attr_accessor :customer_note + + # Unique identifiers for the dispute from the network. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :network_claim_ids + + # Date that the dispute was submitted to the network. + sig { returns(T.nilable(Time)) } + attr_accessor :network_filed_date + + # Network reason code used to file the dispute. + sig { returns(T.nilable(String)) } + attr_accessor :network_reason_code + + # Date dispute entered pre-arbitration. + sig { returns(T.nilable(Time)) } + attr_accessor :prearbitration_date + + # Unique identifier for the dispute from the network. If there are multiple, this + # will be the first claim id set by the network + sig { returns(T.nilable(String)) } + attr_accessor :primary_claim_id + + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + sig { returns(Lithic::Models::Dispute::Reason::TaggedSymbol) } + attr_accessor :reason + + # Date the representment was received. + sig { returns(T.nilable(Time)) } + attr_accessor :representment_date + + # Resolution amount net of network fees. + sig { returns(T.nilable(Integer)) } + attr_accessor :resolution_amount + + # Date that the dispute was resolved. + sig { returns(T.nilable(Time)) } + attr_accessor :resolution_date + + # Note by Dispute team on the case resolution. + sig { returns(T.nilable(String)) } + attr_accessor :resolution_note + + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + sig { returns(T.nilable(Lithic::Models::Dispute::ResolutionReason::TaggedSymbol)) } + attr_accessor :resolution_reason + + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + sig { returns(Lithic::Models::Dispute::Status::TaggedSymbol) } + attr_accessor :status + + # The transaction that is being disputed. A transaction can only be disputed once + # but may have multiple dispute cases. + sig { returns(String) } + attr_accessor :transaction_token + + # Dispute. + sig do + params( + token: String, + amount: Integer, + arbitration_date: T.nilable(Time), + created: Time, + customer_filed_date: T.nilable(Time), + customer_note: T.nilable(String), + network_claim_ids: T.nilable(T::Array[String]), + network_filed_date: T.nilable(Time), + network_reason_code: T.nilable(String), + prearbitration_date: T.nilable(Time), + primary_claim_id: T.nilable(String), + reason: Lithic::Models::Dispute::Reason::OrSymbol, + representment_date: T.nilable(Time), + resolution_amount: T.nilable(Integer), + resolution_date: T.nilable(Time), + resolution_note: T.nilable(String), + resolution_reason: T.nilable(Lithic::Models::Dispute::ResolutionReason::OrSymbol), + status: Lithic::Models::Dispute::Status::OrSymbol, + transaction_token: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + amount:, + arbitration_date:, + created:, + customer_filed_date:, + customer_note:, + network_claim_ids:, + network_filed_date:, + network_reason_code:, + prearbitration_date:, + primary_claim_id:, + reason:, + representment_date:, + resolution_amount:, + resolution_date:, + resolution_note:, + resolution_reason:, + status:, + transaction_token: + ) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + arbitration_date: T.nilable(Time), + created: Time, + customer_filed_date: T.nilable(Time), + customer_note: T.nilable(String), + network_claim_ids: T.nilable(T::Array[String]), + network_filed_date: T.nilable(Time), + network_reason_code: T.nilable(String), + prearbitration_date: T.nilable(Time), + primary_claim_id: T.nilable(String), + reason: Lithic::Models::Dispute::Reason::TaggedSymbol, + representment_date: T.nilable(Time), + resolution_amount: T.nilable(Integer), + resolution_date: T.nilable(Time), + resolution_note: T.nilable(String), + resolution_reason: T.nilable(Lithic::Models::Dispute::ResolutionReason::TaggedSymbol), + status: Lithic::Models::Dispute::Status::TaggedSymbol, + transaction_token: String + } + ) + end + def to_hash + end + + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + module Reason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Dispute::Reason) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Dispute::Reason::TaggedSymbol) } + + ATM_CASH_MISDISPENSE = T.let(:ATM_CASH_MISDISPENSE, Lithic::Models::Dispute::Reason::TaggedSymbol) + CANCELLED = T.let(:CANCELLED, Lithic::Models::Dispute::Reason::TaggedSymbol) + DUPLICATED = T.let(:DUPLICATED, Lithic::Models::Dispute::Reason::TaggedSymbol) + FRAUD_CARD_NOT_PRESENT = T.let(:FRAUD_CARD_NOT_PRESENT, Lithic::Models::Dispute::Reason::TaggedSymbol) + FRAUD_CARD_PRESENT = T.let(:FRAUD_CARD_PRESENT, Lithic::Models::Dispute::Reason::TaggedSymbol) + FRAUD_OTHER = T.let(:FRAUD_OTHER, Lithic::Models::Dispute::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_AS_DESCRIBED = + T.let(:GOODS_SERVICES_NOT_AS_DESCRIBED, Lithic::Models::Dispute::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_RECEIVED = + T.let(:GOODS_SERVICES_NOT_RECEIVED, Lithic::Models::Dispute::Reason::TaggedSymbol) + INCORRECT_AMOUNT = T.let(:INCORRECT_AMOUNT, Lithic::Models::Dispute::Reason::TaggedSymbol) + MISSING_AUTH = T.let(:MISSING_AUTH, Lithic::Models::Dispute::Reason::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::Models::Dispute::Reason::TaggedSymbol) + PROCESSING_ERROR = T.let(:PROCESSING_ERROR, Lithic::Models::Dispute::Reason::TaggedSymbol) + RECURRING_TRANSACTION_NOT_CANCELLED = + T.let(:RECURRING_TRANSACTION_NOT_CANCELLED, Lithic::Models::Dispute::Reason::TaggedSymbol) + REFUND_NOT_PROCESSED = T.let(:REFUND_NOT_PROCESSED, Lithic::Models::Dispute::Reason::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Dispute::Reason::TaggedSymbol]) } + def self.values + end + end + + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + module ResolutionReason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Dispute::ResolutionReason) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) } + + CASE_LOST = T.let(:CASE_LOST, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + NETWORK_REJECTED = T.let(:NETWORK_REJECTED, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + NO_DISPUTE_RIGHTS_3DS = + T.let(:NO_DISPUTE_RIGHTS_3DS, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + NO_DISPUTE_RIGHTS_BELOW_THRESHOLD = + T.let(:NO_DISPUTE_RIGHTS_BELOW_THRESHOLD, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + NO_DISPUTE_RIGHTS_CONTACTLESS = + T.let(:NO_DISPUTE_RIGHTS_CONTACTLESS, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + NO_DISPUTE_RIGHTS_HYBRID = + T.let(:NO_DISPUTE_RIGHTS_HYBRID, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS = + T.let(:NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + NO_DISPUTE_RIGHTS_OTHER = + T.let(:NO_DISPUTE_RIGHTS_OTHER, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + PAST_FILING_DATE = T.let(:PAST_FILING_DATE, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + PREARBITRATION_REJECTED = + T.let(:PREARBITRATION_REJECTED, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + PROCESSOR_REJECTED_OTHER = + T.let(:PROCESSOR_REJECTED_OTHER, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + REFUNDED = T.let(:REFUNDED, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + REFUNDED_AFTER_CHARGEBACK = + T.let(:REFUNDED_AFTER_CHARGEBACK, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + WITHDRAWN = T.let(:WITHDRAWN, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + WON_ARBITRATION = T.let(:WON_ARBITRATION, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + WON_FIRST_CHARGEBACK = + T.let(:WON_FIRST_CHARGEBACK, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + WON_PREARBITRATION = T.let(:WON_PREARBITRATION, Lithic::Models::Dispute::ResolutionReason::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Dispute::ResolutionReason::TaggedSymbol]) } + def self.values + end + end + + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Dispute::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Dispute::Status::TaggedSymbol) } + + ARBITRATION = T.let(:ARBITRATION, Lithic::Models::Dispute::Status::TaggedSymbol) + CASE_CLOSED = T.let(:CASE_CLOSED, Lithic::Models::Dispute::Status::TaggedSymbol) + CASE_WON = T.let(:CASE_WON, Lithic::Models::Dispute::Status::TaggedSymbol) + NEW = T.let(:NEW, Lithic::Models::Dispute::Status::TaggedSymbol) + PENDING_CUSTOMER = T.let(:PENDING_CUSTOMER, Lithic::Models::Dispute::Status::TaggedSymbol) + PREARBITRATION = T.let(:PREARBITRATION, Lithic::Models::Dispute::Status::TaggedSymbol) + REPRESENTMENT = T.let(:REPRESENTMENT, Lithic::Models::Dispute::Status::TaggedSymbol) + SUBMITTED = T.let(:SUBMITTED, Lithic::Models::Dispute::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Dispute::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_create_params.rbi b/rbi/lib/lithic/models/dispute_create_params.rbi new file mode 100644 index 00000000..bc70a0e7 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_create_params.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Lithic + module Models + class DisputeCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount to dispute + sig { returns(Integer) } + attr_accessor :amount + + # Reason for dispute + sig { returns(Lithic::Models::DisputeCreateParams::Reason::OrSymbol) } + attr_accessor :reason + + # Transaction to dispute + sig { returns(String) } + attr_accessor :transaction_token + + # Date the customer filed the dispute + sig { returns(T.nilable(Time)) } + attr_reader :customer_filed_date + + sig { params(customer_filed_date: Time).void } + attr_writer :customer_filed_date + + # Customer description of dispute + sig { returns(T.nilable(String)) } + attr_reader :customer_note + + sig { params(customer_note: String).void } + attr_writer :customer_note + + sig do + params( + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::Reason::OrSymbol, + transaction_token: String, + customer_filed_date: Time, + customer_note: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(amount:, reason:, transaction_token:, customer_filed_date: nil, customer_note: nil, request_options: {}) + end + + sig do + override + .returns( + { + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::Reason::OrSymbol, + transaction_token: String, + customer_filed_date: Time, + customer_note: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Reason for dispute + module Reason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::DisputeCreateParams::Reason) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) } + + ATM_CASH_MISDISPENSE = + T.let(:ATM_CASH_MISDISPENSE, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + CANCELLED = T.let(:CANCELLED, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + DUPLICATED = T.let(:DUPLICATED, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + FRAUD_CARD_NOT_PRESENT = + T.let(:FRAUD_CARD_NOT_PRESENT, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + FRAUD_CARD_PRESENT = + T.let(:FRAUD_CARD_PRESENT, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + FRAUD_OTHER = T.let(:FRAUD_OTHER, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_AS_DESCRIBED = + T.let(:GOODS_SERVICES_NOT_AS_DESCRIBED, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_RECEIVED = + T.let(:GOODS_SERVICES_NOT_RECEIVED, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + INCORRECT_AMOUNT = T.let(:INCORRECT_AMOUNT, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + MISSING_AUTH = T.let(:MISSING_AUTH, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + PROCESSING_ERROR = T.let(:PROCESSING_ERROR, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + RECURRING_TRANSACTION_NOT_CANCELLED = + T.let(:RECURRING_TRANSACTION_NOT_CANCELLED, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + REFUND_NOT_PROCESSED = + T.let(:REFUND_NOT_PROCESSED, Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::DisputeCreateParams::Reason::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_delete_evidence_params.rbi b/rbi/lib/lithic/models/dispute_delete_evidence_params.rbi new file mode 100644 index 00000000..cb283097 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_delete_evidence_params.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Lithic + module Models + class DisputeDeleteEvidenceParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(String) } + attr_accessor :dispute_token + + sig do + params(dispute_token: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(dispute_token:, request_options: {}) + end + + sig { override.returns({dispute_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_delete_params.rbi b/rbi/lib/lithic/models/dispute_delete_params.rbi new file mode 100644 index 00000000..2ea079c0 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_delete_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class DisputeDeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_evidence.rbi b/rbi/lib/lithic/models/dispute_evidence.rbi new file mode 100644 index 00000000..7b396f4d --- /dev/null +++ b/rbi/lib/lithic/models/dispute_evidence.rbi @@ -0,0 +1,108 @@ +# typed: strong + +module Lithic + module Models + class DisputeEvidence < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Timestamp of when dispute evidence was created. + sig { returns(Time) } + attr_accessor :created + + # Dispute token evidence is attached to. + sig { returns(String) } + attr_accessor :dispute_token + + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + sig { returns(Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol) } + attr_accessor :upload_status + + # URL to download evidence. Only shown when `upload_status` is `UPLOADED`. + sig { returns(T.nilable(String)) } + attr_reader :download_url + + sig { params(download_url: String).void } + attr_writer :download_url + + # File name of evidence. Recommended to give the dispute evidence a human-readable + # identifier. + sig { returns(T.nilable(String)) } + attr_reader :filename + + sig { params(filename: String).void } + attr_writer :filename + + # URL to upload evidence. Only shown when `upload_status` is `PENDING`. + sig { returns(T.nilable(String)) } + attr_reader :upload_url + + sig { params(upload_url: String).void } + attr_writer :upload_url + + # Dispute evidence. + sig do + params( + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::UploadStatus::OrSymbol, + download_url: String, + filename: String, + upload_url: String + ) + .returns(T.attached_class) + end + def self.new(token:, created:, dispute_token:, upload_status:, download_url: nil, filename: nil, upload_url: nil) + end + + sig do + override + .returns( + { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol, + download_url: String, + filename: String, + upload_url: String + } + ) + end + def to_hash + end + + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + module UploadStatus + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::DisputeEvidence::UploadStatus) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol) } + + DELETED = T.let(:DELETED, Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol) + ERROR = T.let(:ERROR, Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol) + REJECTED = T.let(:REJECTED, Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol) + UPLOADED = T.let(:UPLOADED, Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::DisputeEvidence::UploadStatus::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_initiate_evidence_upload_params.rbi b/rbi/lib/lithic/models/dispute_initiate_evidence_upload_params.rbi new file mode 100644 index 00000000..65d86fa0 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_initiate_evidence_upload_params.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Models + class DisputeInitiateEvidenceUploadParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Filename of the evidence. + sig { returns(T.nilable(String)) } + attr_reader :filename + + sig { params(filename: String).void } + attr_writer :filename + + sig do + params(filename: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(filename: nil, request_options: {}) + end + + sig { override.returns({filename: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_list_evidences_params.rbi b/rbi/lib/lithic/models/dispute_list_evidences_params.rbi new file mode 100644 index 00000000..2047bb16 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_list_evidences_params.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module Lithic + module Models + class DisputeListEvidencesParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_list_params.rbi b/rbi/lib/lithic/models/dispute_list_params.rbi new file mode 100644 index 00000000..3891fb94 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_list_params.rbi @@ -0,0 +1,127 @@ +# typed: strong + +module Lithic + module Models + class DisputeListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # List disputes of a specific status. + sig { returns(T.nilable(Lithic::Models::DisputeListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::DisputeListParams::Status::OrSymbol).void } + attr_writer :status + + # Transaction tokens to filter by. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :transaction_tokens + + sig { params(transaction_tokens: T::Array[String]).void } + attr_writer :transaction_tokens + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::DisputeListParams::Status::OrSymbol, + transaction_tokens: T::Array[String], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + end_: nil, + ending_before: nil, + page_size: nil, + starting_after: nil, + status: nil, + transaction_tokens: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::DisputeListParams::Status::OrSymbol, + transaction_tokens: T::Array[String], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # List disputes of a specific status. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::DisputeListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::DisputeListParams::Status::TaggedSymbol) } + + ARBITRATION = T.let(:ARBITRATION, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + CASE_CLOSED = T.let(:CASE_CLOSED, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + CASE_WON = T.let(:CASE_WON, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + NEW = T.let(:NEW, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + PENDING_CUSTOMER = T.let(:PENDING_CUSTOMER, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + PREARBITRATION = T.let(:PREARBITRATION, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + REPRESENTMENT = T.let(:REPRESENTMENT, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + SUBMITTED = T.let(:SUBMITTED, Lithic::Models::DisputeListParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::DisputeListParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_retrieve_evidence_params.rbi b/rbi/lib/lithic/models/dispute_retrieve_evidence_params.rbi new file mode 100644 index 00000000..7a9334d7 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_retrieve_evidence_params.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Lithic + module Models + class DisputeRetrieveEvidenceParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(String) } + attr_accessor :dispute_token + + sig do + params(dispute_token: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(dispute_token:, request_options: {}) + end + + sig { override.returns({dispute_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_retrieve_params.rbi b/rbi/lib/lithic/models/dispute_retrieve_params.rbi new file mode 100644 index 00000000..4dbfbdf9 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class DisputeRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/dispute_update_params.rbi b/rbi/lib/lithic/models/dispute_update_params.rbi new file mode 100644 index 00000000..49b1bc53 --- /dev/null +++ b/rbi/lib/lithic/models/dispute_update_params.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Lithic + module Models + class DisputeUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount to dispute + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # Date the customer filed the dispute + sig { returns(T.nilable(Time)) } + attr_reader :customer_filed_date + + sig { params(customer_filed_date: Time).void } + attr_writer :customer_filed_date + + # Customer description of dispute + sig { returns(T.nilable(String)) } + attr_reader :customer_note + + sig { params(customer_note: String).void } + attr_writer :customer_note + + # Reason for dispute + sig { returns(T.nilable(Lithic::Models::DisputeUpdateParams::Reason::OrSymbol)) } + attr_reader :reason + + sig { params(reason: Lithic::Models::DisputeUpdateParams::Reason::OrSymbol).void } + attr_writer :reason + + sig do + params( + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::Models::DisputeUpdateParams::Reason::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(amount: nil, customer_filed_date: nil, customer_note: nil, reason: nil, request_options: {}) + end + + sig do + override + .returns( + { + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::Models::DisputeUpdateParams::Reason::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Reason for dispute + module Reason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::DisputeUpdateParams::Reason) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) } + + ATM_CASH_MISDISPENSE = + T.let(:ATM_CASH_MISDISPENSE, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + CANCELLED = T.let(:CANCELLED, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + DUPLICATED = T.let(:DUPLICATED, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + FRAUD_CARD_NOT_PRESENT = + T.let(:FRAUD_CARD_NOT_PRESENT, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + FRAUD_CARD_PRESENT = + T.let(:FRAUD_CARD_PRESENT, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + FRAUD_OTHER = T.let(:FRAUD_OTHER, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_AS_DESCRIBED = + T.let(:GOODS_SERVICES_NOT_AS_DESCRIBED, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_RECEIVED = + T.let(:GOODS_SERVICES_NOT_RECEIVED, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + INCORRECT_AMOUNT = T.let(:INCORRECT_AMOUNT, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + MISSING_AUTH = T.let(:MISSING_AUTH, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + PROCESSING_ERROR = T.let(:PROCESSING_ERROR, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + RECURRING_TRANSACTION_NOT_CANCELLED = + T.let(:RECURRING_TRANSACTION_NOT_CANCELLED, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + REFUND_NOT_PROCESSED = + T.let(:REFUND_NOT_PROCESSED, Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::DisputeUpdateParams::Reason::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/document.rbi b/rbi/lib/lithic/models/document.rbi new file mode 100644 index 00000000..3f7bd3e3 --- /dev/null +++ b/rbi/lib/lithic/models/document.rbi @@ -0,0 +1,283 @@ +# typed: strong + +module Lithic + module Models + class Document < Lithic::BaseModel + # Globally unique identifier for the document. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :account_holder_token + + # Type of documentation to be submitted for verification of an account holder + sig { returns(Lithic::Models::Document::DocumentType::TaggedSymbol) } + attr_accessor :document_type + + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Represents a single image of the document to upload. + sig { returns(T::Array[Lithic::Models::Document::RequiredDocumentUpload]) } + attr_accessor :required_document_uploads + + # Describes the document and the required document image uploads required to + # re-run KYC + sig do + params( + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::DocumentType::OrSymbol, + entity_token: String, + required_document_uploads: T::Array[T.any(Lithic::Models::Document::RequiredDocumentUpload, Lithic::Util::AnyHash)] + ) + .returns(T.attached_class) + end + def self.new(token:, account_holder_token:, document_type:, entity_token:, required_document_uploads:) + end + + sig do + override + .returns( + { + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::DocumentType::TaggedSymbol, + entity_token: String, + required_document_uploads: T::Array[Lithic::Models::Document::RequiredDocumentUpload] + } + ) + end + def to_hash + end + + # Type of documentation to be submitted for verification of an account holder + module DocumentType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Document::DocumentType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Document::DocumentType::TaggedSymbol) } + + DRIVERS_LICENSE = T.let(:DRIVERS_LICENSE, Lithic::Models::Document::DocumentType::TaggedSymbol) + PASSPORT = T.let(:PASSPORT, Lithic::Models::Document::DocumentType::TaggedSymbol) + PASSPORT_CARD = T.let(:PASSPORT_CARD, Lithic::Models::Document::DocumentType::TaggedSymbol) + EIN_LETTER = T.let(:EIN_LETTER, Lithic::Models::Document::DocumentType::TaggedSymbol) + TAX_RETURN = T.let(:TAX_RETURN, Lithic::Models::Document::DocumentType::TaggedSymbol) + OPERATING_AGREEMENT = T.let(:OPERATING_AGREEMENT, Lithic::Models::Document::DocumentType::TaggedSymbol) + CERTIFICATE_OF_FORMATION = + T.let(:CERTIFICATE_OF_FORMATION, Lithic::Models::Document::DocumentType::TaggedSymbol) + CERTIFICATE_OF_GOOD_STANDING = + T.let(:CERTIFICATE_OF_GOOD_STANDING, Lithic::Models::Document::DocumentType::TaggedSymbol) + ARTICLES_OF_INCORPORATION = + T.let(:ARTICLES_OF_INCORPORATION, Lithic::Models::Document::DocumentType::TaggedSymbol) + ARTICLES_OF_ORGANIZATION = + T.let(:ARTICLES_OF_ORGANIZATION, Lithic::Models::Document::DocumentType::TaggedSymbol) + BYLAWS = T.let(:BYLAWS, Lithic::Models::Document::DocumentType::TaggedSymbol) + GOVERNMENT_BUSINESS_LICENSE = + T.let(:GOVERNMENT_BUSINESS_LICENSE, Lithic::Models::Document::DocumentType::TaggedSymbol) + PARTNERSHIP_AGREEMENT = + T.let(:PARTNERSHIP_AGREEMENT, Lithic::Models::Document::DocumentType::TaggedSymbol) + SS4_FORM = T.let(:SS4_FORM, Lithic::Models::Document::DocumentType::TaggedSymbol) + BANK_STATEMENT = T.let(:BANK_STATEMENT, Lithic::Models::Document::DocumentType::TaggedSymbol) + UTILITY_BILL_STATEMENT = + T.let(:UTILITY_BILL_STATEMENT, Lithic::Models::Document::DocumentType::TaggedSymbol) + SSN_CARD = T.let(:SSN_CARD, Lithic::Models::Document::DocumentType::TaggedSymbol) + ITIN_LETTER = T.let(:ITIN_LETTER, Lithic::Models::Document::DocumentType::TaggedSymbol) + FINCEN_BOI_REPORT = T.let(:FINCEN_BOI_REPORT, Lithic::Models::Document::DocumentType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Document::DocumentType::TaggedSymbol]) } + def self.values + end + end + + class RequiredDocumentUpload < Lithic::BaseModel + # Globally unique identifier for the document upload. + sig { returns(String) } + attr_accessor :token + + # A list of status reasons associated with a KYB account holder that have been + # satisfied by the document upload + sig { returns(T::Array[String]) } + attr_accessor :accepted_entity_status_reasons + + # When the document upload was created + sig { returns(Time) } + attr_accessor :created + + # Type of image to upload. + sig { returns(Lithic::Models::Document::RequiredDocumentUpload::ImageType::TaggedSymbol) } + attr_accessor :image_type + + # A list of status reasons associated with a KYB account holder that have not been + # satisfied by the document upload + sig { returns(T::Array[String]) } + attr_accessor :rejected_entity_status_reasons + + # Status of an account holder's document upload. + sig { returns(Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol) } + attr_accessor :status + + # Reasons for document image upload status. + sig { returns(T::Array[Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol]) } + attr_accessor :status_reasons + + # When the document upload was last updated + sig { returns(Time) } + attr_accessor :updated + + # URL to upload document image to. + # + # Note that the upload URLs expire after 7 days. If an upload URL expires, you can + # refresh the URLs by retrieving the document upload from + # `GET /account_holders/{account_holder_token}/documents`. + sig { returns(String) } + attr_accessor :upload_url + + # Represents a single image of the document to upload. + sig do + params( + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: Lithic::Models::Document::RequiredDocumentUpload::ImageType::OrSymbol, + rejected_entity_status_reasons: T::Array[String], + status: Lithic::Models::Document::RequiredDocumentUpload::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::Document::RequiredDocumentUpload::StatusReason::OrSymbol], + updated: Time, + upload_url: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + accepted_entity_status_reasons:, + created:, + image_type:, + rejected_entity_status_reasons:, + status:, + status_reasons:, + updated:, + upload_url: + ) + end + + sig do + override + .returns( + { + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: Lithic::Models::Document::RequiredDocumentUpload::ImageType::TaggedSymbol, + rejected_entity_status_reasons: T::Array[String], + status: Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol, + status_reasons: T::Array[Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol], + updated: Time, + upload_url: String + } + ) + end + def to_hash + end + + # Type of image to upload. + module ImageType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Document::RequiredDocumentUpload::ImageType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Document::RequiredDocumentUpload::ImageType::TaggedSymbol) } + + FRONT = T.let(:FRONT, Lithic::Models::Document::RequiredDocumentUpload::ImageType::TaggedSymbol) + BACK = T.let(:BACK, Lithic::Models::Document::RequiredDocumentUpload::ImageType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Document::RequiredDocumentUpload::ImageType::TaggedSymbol]) } + def self.values + end + end + + # Status of an account holder's document upload. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Document::RequiredDocumentUpload::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol) } + + ACCEPTED = T.let(:ACCEPTED, Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol) + REJECTED = T.let(:REJECTED, Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol) + PENDING_UPLOAD = + T.let(:PENDING_UPLOAD, Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol) + UPLOADED = T.let(:UPLOADED, Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol) + PARTIAL_APPROVAL = + T.let(:PARTIAL_APPROVAL, Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Document::RequiredDocumentUpload::Status::TaggedSymbol]) } + def self.values + end + end + + # The status reasons for an account holder document upload that is not ACCEPTED + module StatusReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Document::RequiredDocumentUpload::StatusReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol) } + + DOCUMENT_MISSING_REQUIRED_DATA = + T.let( + :DOCUMENT_MISSING_REQUIRED_DATA, + Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + DOCUMENT_UPLOAD_TOO_BLURRY = + T.let( + :DOCUMENT_UPLOAD_TOO_BLURRY, + Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + FILE_SIZE_TOO_LARGE = + T.let(:FILE_SIZE_TOO_LARGE, Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol) + INVALID_DOCUMENT_TYPE = + T.let( + :INVALID_DOCUMENT_TYPE, + Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + INVALID_DOCUMENT_UPLOAD = + T.let( + :INVALID_DOCUMENT_UPLOAD, + Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + INVALID_ENTITY = + T.let(:INVALID_ENTITY, Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol) + DOCUMENT_EXPIRED = + T.let(:DOCUMENT_EXPIRED, Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol) + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = + T.let( + :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS, + Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + DOCUMENT_TYPE_NOT_SUPPORTED = + T.let( + :DOCUMENT_TYPE_NOT_SUPPORTED, + Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + UNKNOWN_FAILURE_REASON = + T.let( + :UNKNOWN_FAILURE_REASON, + Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + UNKNOWN_ERROR = + T.let(:UNKNOWN_ERROR, Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/event.rbi b/rbi/lib/lithic/models/event.rbi new file mode 100644 index 00000000..34a91b1b --- /dev/null +++ b/rbi/lib/lithic/models/event.rbi @@ -0,0 +1,196 @@ +# typed: strong + +module Lithic + module Models + class Event < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + sig { returns(Time) } + attr_accessor :created + + # Event types: + # + # - `account_holder.created` - Notification that a new account holder has been + # created and was not rejected. + # - `account_holder.updated` - Notification that an account holder was updated. + # - `account_holder.verification` - Notification than an account holder's identity + # verification is complete. + # - `card.created` - Notification that a card has been created. + # - `card.renewed` - Notification that a card has been renewed. + # - `card.reissued` - Notification that a card has been reissued. + # - `card.shipped` - Physical card shipment notification. See + # https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. + # - `card.converted` - Notification that a virtual card has been converted to a + # physical card. + # - `card_transaction.updated` - Transaction Lifecycle webhook. See + # https://docs.lithic.com/docs/transaction-webhooks. + # - `dispute.updated` - A dispute has been updated. + # - `digital_wallet.tokenization_approval_request` - Card network's request to + # Lithic to activate a digital wallet token. + # - `digital_wallet.tokenization_result` - Notification of the end result of a + # tokenization, whether successful or failed. + # - `digital_wallet.tokenization_two_factor_authentication_code` - A code to be + # passed to an end user to complete digital wallet authentication. See + # https://docs.lithic.com/docs/tokenization-control#digital-wallet-tokenization-auth-code. + # - `digital_wallet.tokenization_two_factor_authentication_code_sent` - + # Notification that a two factor authentication code for activating a digital + # wallet has been sent to the end user. + # - `digital_wallet.tokenization_updated` - Notification that a digital wallet + # tokenization's status has changed. + sig { returns(Lithic::Models::Event::EventType::TaggedSymbol) } + attr_accessor :event_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :payload + + # A single event that affects the transaction state and lifecycle. + sig do + params( + token: String, + created: Time, + event_type: Lithic::Models::Event::EventType::OrSymbol, + payload: T::Hash[Symbol, T.anything] + ) + .returns(T.attached_class) + end + def self.new(token:, created:, event_type:, payload:) + end + + sig do + override + .returns( + { + token: String, + created: Time, + event_type: Lithic::Models::Event::EventType::TaggedSymbol, + payload: T::Hash[Symbol, T.anything] + } + ) + end + def to_hash + end + + # Event types: + # + # - `account_holder.created` - Notification that a new account holder has been + # created and was not rejected. + # - `account_holder.updated` - Notification that an account holder was updated. + # - `account_holder.verification` - Notification than an account holder's identity + # verification is complete. + # - `card.created` - Notification that a card has been created. + # - `card.renewed` - Notification that a card has been renewed. + # - `card.reissued` - Notification that a card has been reissued. + # - `card.shipped` - Physical card shipment notification. See + # https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. + # - `card.converted` - Notification that a virtual card has been converted to a + # physical card. + # - `card_transaction.updated` - Transaction Lifecycle webhook. See + # https://docs.lithic.com/docs/transaction-webhooks. + # - `dispute.updated` - A dispute has been updated. + # - `digital_wallet.tokenization_approval_request` - Card network's request to + # Lithic to activate a digital wallet token. + # - `digital_wallet.tokenization_result` - Notification of the end result of a + # tokenization, whether successful or failed. + # - `digital_wallet.tokenization_two_factor_authentication_code` - A code to be + # passed to an end user to complete digital wallet authentication. See + # https://docs.lithic.com/docs/tokenization-control#digital-wallet-tokenization-auth-code. + # - `digital_wallet.tokenization_two_factor_authentication_code_sent` - + # Notification that a two factor authentication code for activating a digital + # wallet has been sent to the end user. + # - `digital_wallet.tokenization_updated` - Notification that a digital wallet + # tokenization's status has changed. + module EventType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Event::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Event::EventType::TaggedSymbol) } + + ACCOUNT_HOLDER_CREATED = T.let(:"account_holder.created", Lithic::Models::Event::EventType::TaggedSymbol) + ACCOUNT_HOLDER_UPDATED = T.let(:"account_holder.updated", Lithic::Models::Event::EventType::TaggedSymbol) + ACCOUNT_HOLDER_VERIFICATION = + T.let(:"account_holder.verification", Lithic::Models::Event::EventType::TaggedSymbol) + AUTH_RULES_PERFORMANCE_REPORT_CREATED = + T.let(:"auth_rules.performance_report.created", Lithic::Models::Event::EventType::TaggedSymbol) + BALANCE_UPDATED = T.let(:"balance.updated", Lithic::Models::Event::EventType::TaggedSymbol) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let(:"book_transfer_transaction.created", Lithic::Models::Event::EventType::TaggedSymbol) + CARD_CREATED = T.let(:"card.created", Lithic::Models::Event::EventType::TaggedSymbol) + CARD_RENEWED = T.let(:"card.renewed", Lithic::Models::Event::EventType::TaggedSymbol) + CARD_REISSUED = T.let(:"card.reissued", Lithic::Models::Event::EventType::TaggedSymbol) + CARD_CONVERTED = T.let(:"card.converted", Lithic::Models::Event::EventType::TaggedSymbol) + CARD_SHIPPED = T.let(:"card.shipped", Lithic::Models::Event::EventType::TaggedSymbol) + CARD_TRANSACTION_UPDATED = + T.let(:"card_transaction.updated", Lithic::Models::Event::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let(:"digital_wallet.tokenization_approval_request", Lithic::Models::Event::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let(:"digital_wallet.tokenization_result", Lithic::Models::Event::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Models::Event::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Models::Event::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let(:"digital_wallet.tokenization_updated", Lithic::Models::Event::EventType::TaggedSymbol) + DISPUTE_UPDATED = T.let(:"dispute.updated", Lithic::Models::Event::EventType::TaggedSymbol) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let(:"dispute_evidence.upload_failed", Lithic::Models::Event::EventType::TaggedSymbol) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let(:"external_bank_account.created", Lithic::Models::Event::EventType::TaggedSymbol) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let(:"external_bank_account.updated", Lithic::Models::Event::EventType::TaggedSymbol) + EXTERNAL_PAYMENT_CREATED = + T.let(:"external_payment.created", Lithic::Models::Event::EventType::TaggedSymbol) + EXTERNAL_PAYMENT_UPDATED = + T.let(:"external_payment.updated", Lithic::Models::Event::EventType::TaggedSymbol) + FINANCIAL_ACCOUNT_CREATED = + T.let(:"financial_account.created", Lithic::Models::Event::EventType::TaggedSymbol) + FINANCIAL_ACCOUNT_UPDATED = + T.let(:"financial_account.updated", Lithic::Models::Event::EventType::TaggedSymbol) + LOAN_TAPE_CREATED = T.let(:"loan_tape.created", Lithic::Models::Event::EventType::TaggedSymbol) + LOAN_TAPE_UPDATED = T.let(:"loan_tape.updated", Lithic::Models::Event::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_CREATED = + T.let(:"management_operation.created", Lithic::Models::Event::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_UPDATED = + T.let(:"management_operation.updated", Lithic::Models::Event::EventType::TaggedSymbol) + PAYMENT_TRANSACTION_CREATED = + T.let(:"payment_transaction.created", Lithic::Models::Event::EventType::TaggedSymbol) + PAYMENT_TRANSACTION_UPDATED = + T.let(:"payment_transaction.updated", Lithic::Models::Event::EventType::TaggedSymbol) + INTERNAL_TRANSACTION_CREATED = + T.let(:"internal_transaction.created", Lithic::Models::Event::EventType::TaggedSymbol) + INTERNAL_TRANSACTION_UPDATED = + T.let(:"internal_transaction.updated", Lithic::Models::Event::EventType::TaggedSymbol) + SETTLEMENT_REPORT_UPDATED = + T.let(:"settlement_report.updated", Lithic::Models::Event::EventType::TaggedSymbol) + STATEMENTS_CREATED = T.let(:"statements.created", Lithic::Models::Event::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_CREATED = + T.let(:"three_ds_authentication.created", Lithic::Models::Event::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_UPDATED = + T.let(:"three_ds_authentication.updated", Lithic::Models::Event::EventType::TaggedSymbol) + TOKENIZATION_APPROVAL_REQUEST = + T.let(:"tokenization.approval_request", Lithic::Models::Event::EventType::TaggedSymbol) + TOKENIZATION_RESULT = T.let(:"tokenization.result", Lithic::Models::Event::EventType::TaggedSymbol) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let(:"tokenization.two_factor_authentication_code", Lithic::Models::Event::EventType::TaggedSymbol) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let(:"tokenization.two_factor_authentication_code_sent", Lithic::Models::Event::EventType::TaggedSymbol) + TOKENIZATION_UPDATED = T.let(:"tokenization.updated", Lithic::Models::Event::EventType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Event::EventType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/event_list_attempts_params.rbi b/rbi/lib/lithic/models/event_list_attempts_params.rbi new file mode 100644 index 00000000..62bedba8 --- /dev/null +++ b/rbi/lib/lithic/models/event_list_attempts_params.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Models + class EventListAttemptsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig { returns(T.nilable(Lithic::Models::EventListAttemptsParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::EventListAttemptsParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::EventListAttemptsParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + end_: nil, + ending_before: nil, + page_size: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::EventListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::EventListAttemptsParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::EventListAttemptsParams::Status::TaggedSymbol) } + + FAILED = T.let(:FAILED, Lithic::Models::EventListAttemptsParams::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::EventListAttemptsParams::Status::TaggedSymbol) + SENDING = T.let(:SENDING, Lithic::Models::EventListAttemptsParams::Status::TaggedSymbol) + SUCCESS = T.let(:SUCCESS, Lithic::Models::EventListAttemptsParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::EventListAttemptsParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/event_list_params.rbi b/rbi/lib/lithic/models/event_list_params.rbi new file mode 100644 index 00000000..4ef33611 --- /dev/null +++ b/rbi/lib/lithic/models/event_list_params.rbi @@ -0,0 +1,208 @@ +# typed: strong + +module Lithic + module Models + class EventListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Event types to filter events by. + sig { returns(T.nilable(T::Array[Lithic::Models::EventListParams::EventType::OrSymbol])) } + attr_reader :event_types + + sig { params(event_types: T::Array[Lithic::Models::EventListParams::EventType::OrSymbol]).void } + attr_writer :event_types + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Whether to include the event payload content in the response. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :with_content + + sig { params(with_content: T::Boolean).void } + attr_writer :with_content + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + event_types: T::Array[Lithic::Models::EventListParams::EventType::OrSymbol], + page_size: Integer, + starting_after: String, + with_content: T::Boolean, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + end_: nil, + ending_before: nil, + event_types: nil, + page_size: nil, + starting_after: nil, + with_content: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + end_: Time, + ending_before: String, + event_types: T::Array[Lithic::Models::EventListParams::EventType::OrSymbol], + page_size: Integer, + starting_after: String, + with_content: T::Boolean, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module EventType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::EventListParams::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::EventListParams::EventType::TaggedSymbol) } + + ACCOUNT_HOLDER_CREATED = + T.let(:"account_holder.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + ACCOUNT_HOLDER_UPDATED = + T.let(:"account_holder.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + ACCOUNT_HOLDER_VERIFICATION = + T.let(:"account_holder.verification", Lithic::Models::EventListParams::EventType::TaggedSymbol) + AUTH_RULES_PERFORMANCE_REPORT_CREATED = + T.let(:"auth_rules.performance_report.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + BALANCE_UPDATED = T.let(:"balance.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let(:"book_transfer_transaction.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + CARD_CREATED = T.let(:"card.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + CARD_RENEWED = T.let(:"card.renewed", Lithic::Models::EventListParams::EventType::TaggedSymbol) + CARD_REISSUED = T.let(:"card.reissued", Lithic::Models::EventListParams::EventType::TaggedSymbol) + CARD_CONVERTED = T.let(:"card.converted", Lithic::Models::EventListParams::EventType::TaggedSymbol) + CARD_SHIPPED = T.let(:"card.shipped", Lithic::Models::EventListParams::EventType::TaggedSymbol) + CARD_TRANSACTION_UPDATED = + T.let(:"card_transaction.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::Models::EventListParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let(:"digital_wallet.tokenization_result", Lithic::Models::EventListParams::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Models::EventListParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Models::EventListParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let(:"digital_wallet.tokenization_updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + DISPUTE_UPDATED = T.let(:"dispute.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let(:"dispute_evidence.upload_failed", Lithic::Models::EventListParams::EventType::TaggedSymbol) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let(:"external_bank_account.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let(:"external_bank_account.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + EXTERNAL_PAYMENT_CREATED = + T.let(:"external_payment.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + EXTERNAL_PAYMENT_UPDATED = + T.let(:"external_payment.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + FINANCIAL_ACCOUNT_CREATED = + T.let(:"financial_account.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + FINANCIAL_ACCOUNT_UPDATED = + T.let(:"financial_account.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + LOAN_TAPE_CREATED = T.let(:"loan_tape.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + LOAN_TAPE_UPDATED = T.let(:"loan_tape.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_CREATED = + T.let(:"management_operation.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_UPDATED = + T.let(:"management_operation.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + PAYMENT_TRANSACTION_CREATED = + T.let(:"payment_transaction.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + PAYMENT_TRANSACTION_UPDATED = + T.let(:"payment_transaction.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + INTERNAL_TRANSACTION_CREATED = + T.let(:"internal_transaction.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + INTERNAL_TRANSACTION_UPDATED = + T.let(:"internal_transaction.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + SETTLEMENT_REPORT_UPDATED = + T.let(:"settlement_report.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + STATEMENTS_CREATED = + T.let(:"statements.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_CREATED = + T.let(:"three_ds_authentication.created", Lithic::Models::EventListParams::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_UPDATED = + T.let(:"three_ds_authentication.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + TOKENIZATION_APPROVAL_REQUEST = + T.let(:"tokenization.approval_request", Lithic::Models::EventListParams::EventType::TaggedSymbol) + TOKENIZATION_RESULT = + T.let(:"tokenization.result", Lithic::Models::EventListParams::EventType::TaggedSymbol) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Models::EventListParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Models::EventListParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let(:"tokenization.updated", Lithic::Models::EventListParams::EventType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::EventListParams::EventType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/event_retrieve_params.rbi b/rbi/lib/lithic/models/event_retrieve_params.rbi new file mode 100644 index 00000000..f10c857e --- /dev/null +++ b/rbi/lib/lithic/models/event_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class EventRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/event_subscription.rbi b/rbi/lib/lithic/models/event_subscription.rbi new file mode 100644 index 00000000..272a2f05 --- /dev/null +++ b/rbi/lib/lithic/models/event_subscription.rbi @@ -0,0 +1,161 @@ +# typed: strong + +module Lithic + module Models + class EventSubscription < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # A description of the subscription. + sig { returns(String) } + attr_accessor :description + + # Whether the subscription is disabled. + sig { returns(T::Boolean) } + attr_accessor :disabled + + sig { returns(String) } + attr_accessor :url + + sig { returns(T.nilable(T::Array[Lithic::Models::EventSubscription::EventType::TaggedSymbol])) } + attr_accessor :event_types + + # A subscription to specific event types. + sig do + params( + token: String, + description: String, + disabled: T::Boolean, + url: String, + event_types: T.nilable(T::Array[Lithic::Models::EventSubscription::EventType::OrSymbol]) + ) + .returns(T.attached_class) + end + def self.new(token:, description:, disabled:, url:, event_types: nil) + end + + sig do + override + .returns( + { + token: String, + description: String, + disabled: T::Boolean, + url: String, + event_types: T.nilable(T::Array[Lithic::Models::EventSubscription::EventType::TaggedSymbol]) + } + ) + end + def to_hash + end + + module EventType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::EventSubscription::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::EventSubscription::EventType::TaggedSymbol) } + + ACCOUNT_HOLDER_CREATED = + T.let(:"account_holder.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + ACCOUNT_HOLDER_UPDATED = + T.let(:"account_holder.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + ACCOUNT_HOLDER_VERIFICATION = + T.let(:"account_holder.verification", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + AUTH_RULES_PERFORMANCE_REPORT_CREATED = + T.let( + :"auth_rules.performance_report.created", + Lithic::Models::EventSubscription::EventType::TaggedSymbol + ) + BALANCE_UPDATED = T.let(:"balance.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let(:"book_transfer_transaction.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + CARD_CREATED = T.let(:"card.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + CARD_RENEWED = T.let(:"card.renewed", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + CARD_REISSUED = T.let(:"card.reissued", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + CARD_CONVERTED = T.let(:"card.converted", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + CARD_SHIPPED = T.let(:"card.shipped", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + CARD_TRANSACTION_UPDATED = + T.let(:"card_transaction.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::Models::EventSubscription::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let(:"digital_wallet.tokenization_result", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Models::EventSubscription::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Models::EventSubscription::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let(:"digital_wallet.tokenization_updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + DISPUTE_UPDATED = T.let(:"dispute.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let(:"dispute_evidence.upload_failed", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let(:"external_bank_account.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let(:"external_bank_account.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + EXTERNAL_PAYMENT_CREATED = + T.let(:"external_payment.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + EXTERNAL_PAYMENT_UPDATED = + T.let(:"external_payment.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + FINANCIAL_ACCOUNT_CREATED = + T.let(:"financial_account.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + FINANCIAL_ACCOUNT_UPDATED = + T.let(:"financial_account.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + LOAN_TAPE_CREATED = + T.let(:"loan_tape.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + LOAN_TAPE_UPDATED = + T.let(:"loan_tape.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_CREATED = + T.let(:"management_operation.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_UPDATED = + T.let(:"management_operation.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + PAYMENT_TRANSACTION_CREATED = + T.let(:"payment_transaction.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + PAYMENT_TRANSACTION_UPDATED = + T.let(:"payment_transaction.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + INTERNAL_TRANSACTION_CREATED = + T.let(:"internal_transaction.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + INTERNAL_TRANSACTION_UPDATED = + T.let(:"internal_transaction.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + SETTLEMENT_REPORT_UPDATED = + T.let(:"settlement_report.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + STATEMENTS_CREATED = + T.let(:"statements.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_CREATED = + T.let(:"three_ds_authentication.created", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_UPDATED = + T.let(:"three_ds_authentication.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + TOKENIZATION_APPROVAL_REQUEST = + T.let(:"tokenization.approval_request", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + TOKENIZATION_RESULT = + T.let(:"tokenization.result", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Models::EventSubscription::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Models::EventSubscription::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let(:"tokenization.updated", Lithic::Models::EventSubscription::EventType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::EventSubscription::EventType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_create_params.rbi b/rbi/lib/lithic/models/events/subscription_create_params.rbi new file mode 100644 index 00000000..c3e310f5 --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_create_params.rbi @@ -0,0 +1,254 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + sig { returns(String) } + attr_accessor :url + + # Event subscription description. + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + # Whether the event subscription is active (false) or inactive (true). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :disabled + + sig { params(disabled: T::Boolean).void } + attr_writer :disabled + + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + sig { returns(T.nilable(T::Array[Lithic::Models::Events::SubscriptionCreateParams::EventType::OrSymbol])) } + attr_reader :event_types + + sig { params(event_types: T::Array[Lithic::Models::Events::SubscriptionCreateParams::EventType::OrSymbol]).void } + attr_writer :event_types + + sig do + params( + url: String, + description: String, + disabled: T::Boolean, + event_types: T::Array[Lithic::Models::Events::SubscriptionCreateParams::EventType::OrSymbol], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(url:, description: nil, disabled: nil, event_types: nil, request_options: {}) + end + + sig do + override + .returns( + { + url: String, + description: String, + disabled: T::Boolean, + event_types: T::Array[Lithic::Models::Events::SubscriptionCreateParams::EventType::OrSymbol], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module EventType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Events::SubscriptionCreateParams::EventType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) } + + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + AUTH_RULES_PERFORMANCE_REPORT_CREATED = + T.let( + :"auth_rules.performance_report.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let(:"balance.updated", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let(:"card.created", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + CARD_RENEWED = + T.let(:"card.renewed", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + CARD_REISSUED = + T.let(:"card.reissued", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + CARD_CONVERTED = + T.let(:"card.converted", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + CARD_SHIPPED = + T.let(:"card.shipped", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let(:"dispute.updated", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let(:"loan_tape.created", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + LOAN_TAPE_UPDATED = + T.let(:"loan_tape.updated", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let(:"statements.created", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let(:"tokenization.result", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let(:"tokenization.updated", Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Events::SubscriptionCreateParams::EventType::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_delete_params.rbi b/rbi/lib/lithic/models/events/subscription_delete_params.rbi new file mode 100644 index 00000000..6843ae8b --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_delete_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionDeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_list_attempts_params.rbi b/rbi/lib/lithic/models/events/subscription_list_attempts_params.rbi new file mode 100644 index 00000000..8eb382cd --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_list_attempts_params.rbi @@ -0,0 +1,115 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionListAttemptsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig { returns(T.nilable(Lithic::Models::Events::SubscriptionListAttemptsParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::Events::SubscriptionListAttemptsParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::Events::SubscriptionListAttemptsParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + end_: nil, + ending_before: nil, + page_size: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::Events::SubscriptionListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol) } + + FAILED = T.let(:FAILED, Lithic::Models::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol) + SENDING = T.let(:SENDING, Lithic::Models::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol) + SUCCESS = T.let(:SUCCESS, Lithic::Models::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_list_params.rbi b/rbi/lib/lithic/models/events/subscription_list_params.rbi new file mode 100644 index 00000000..48b39c8e --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_list_params.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_recover_params.rbi b/rbi/lib/lithic/models/events/subscription_recover_params.rbi new file mode 100644 index 00000000..3cf43c75 --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_recover_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRecoverParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + sig do + params( + begin_: Time, + end_: Time, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(begin_: nil, end_: nil, request_options: {}) + end + + sig { override.returns({begin_: Time, end_: Time, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_replay_missing_params.rbi b/rbi/lib/lithic/models/events/subscription_replay_missing_params.rbi new file mode 100644 index 00000000..d3871254 --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_replay_missing_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionReplayMissingParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + sig do + params( + begin_: Time, + end_: Time, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(begin_: nil, end_: nil, request_options: {}) + end + + sig { override.returns({begin_: Time, end_: Time, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_retrieve_params.rbi b/rbi/lib/lithic/models/events/subscription_retrieve_params.rbi new file mode 100644 index 00000000..df76837a --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_retrieve_secret_params.rbi b/rbi/lib/lithic/models/events/subscription_retrieve_secret_params.rbi new file mode 100644 index 00000000..3b4091d7 --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_retrieve_secret_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_retrieve_secret_response.rbi b/rbi/lib/lithic/models/events/subscription_retrieve_secret_response.rbi new file mode 100644 index 00000000..d64be833 --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_retrieve_secret_response.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRetrieveSecretResponse < Lithic::BaseModel + # The secret for the event subscription. + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new(secret: nil) + end + + sig { override.returns({secret: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_rotate_secret_params.rbi b/rbi/lib/lithic/models/events/subscription_rotate_secret_params.rbi new file mode 100644 index 00000000..98fefcfb --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_rotate_secret_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_send_simulated_example_params.rbi b/rbi/lib/lithic/models/events/subscription_send_simulated_example_params.rbi new file mode 100644 index 00000000..ebc93253 --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_send_simulated_example_params.rbi @@ -0,0 +1,272 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionSendSimulatedExampleParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Event type to send example message for. + sig { returns(T.nilable(Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol)) } + attr_reader :event_type + + sig do + params(event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol) + .void + end + attr_writer :event_type + + sig do + params( + event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(event_type: nil, request_options: {}) + end + + sig do + override + .returns( + { + event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Event type to send example message for. + module EventType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol) } + + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + AUTH_RULES_PERFORMANCE_REPORT_CREATED = + T.let( + :"auth_rules.performance_report.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let( + :"balance.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let( + :"card.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_RENEWED = + T.let( + :"card.renewed", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_REISSUED = + T.let( + :"card.reissued", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_CONVERTED = + T.let( + :"card.converted", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_SHIPPED = + T.let( + :"card.shipped", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let( + :"dispute.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let( + :"loan_tape.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + LOAN_TAPE_UPDATED = + T.let( + :"loan_tape.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let( + :"statements.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let( + :"tokenization.result", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let( + :"tokenization.updated", + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol]) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/events/subscription_update_params.rbi b/rbi/lib/lithic/models/events/subscription_update_params.rbi new file mode 100644 index 00000000..9be81a6f --- /dev/null +++ b/rbi/lib/lithic/models/events/subscription_update_params.rbi @@ -0,0 +1,254 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + sig { returns(String) } + attr_accessor :url + + # Event subscription description. + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + # Whether the event subscription is active (false) or inactive (true). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :disabled + + sig { params(disabled: T::Boolean).void } + attr_writer :disabled + + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + sig { returns(T.nilable(T::Array[Lithic::Models::Events::SubscriptionUpdateParams::EventType::OrSymbol])) } + attr_reader :event_types + + sig { params(event_types: T::Array[Lithic::Models::Events::SubscriptionUpdateParams::EventType::OrSymbol]).void } + attr_writer :event_types + + sig do + params( + url: String, + description: String, + disabled: T::Boolean, + event_types: T::Array[Lithic::Models::Events::SubscriptionUpdateParams::EventType::OrSymbol], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(url:, description: nil, disabled: nil, event_types: nil, request_options: {}) + end + + sig do + override + .returns( + { + url: String, + description: String, + disabled: T::Boolean, + event_types: T::Array[Lithic::Models::Events::SubscriptionUpdateParams::EventType::OrSymbol], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module EventType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Events::SubscriptionUpdateParams::EventType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) } + + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + AUTH_RULES_PERFORMANCE_REPORT_CREATED = + T.let( + :"auth_rules.performance_report.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let(:"balance.updated", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let(:"card.created", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + CARD_RENEWED = + T.let(:"card.renewed", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + CARD_REISSUED = + T.let(:"card.reissued", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + CARD_CONVERTED = + T.let(:"card.converted", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + CARD_SHIPPED = + T.let(:"card.shipped", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let(:"dispute.updated", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let(:"loan_tape.created", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + LOAN_TAPE_UPDATED = + T.let(:"loan_tape.updated", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let(:"statements.created", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let(:"tokenization.result", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let(:"tokenization.updated", Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Events::SubscriptionUpdateParams::EventType::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_address.rbi b/rbi/lib/lithic/models/external_bank_account_address.rbi new file mode 100644 index 00000000..cdc15d29 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_address.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountAddress < Lithic::BaseModel + sig { returns(String) } + attr_accessor :address1 + + sig { returns(String) } + attr_accessor :city + + sig { returns(String) } + attr_accessor :country + + sig { returns(String) } + attr_accessor :postal_code + + sig { returns(String) } + attr_accessor :state + + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_create_params.rbi b/rbi/lib/lithic/models/external_bank_account_create_params.rbi new file mode 100644 index 00000000..27005427 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_create_params.rbi @@ -0,0 +1,223 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Account Number + sig { returns(String) } + attr_accessor :account_number + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The financial account token of the operating account to fund the micro deposits + sig { returns(String) } + attr_accessor :financial_account_token + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::OwnerType::OrSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccountCreateParams::Type::OrSymbol) } + attr_accessor :type + + # Verification Method + sig { returns(Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod::OrSymbol) } + attr_accessor :verification_method + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verification_enforcement + + sig { params(verification_enforcement: T::Boolean).void } + attr_writer :verification_enforcement + + sig { returns(String) } + attr_accessor :processor_token + + sig do + params( + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::OwnerType::OrSymbol, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Type::OrSymbol, + verification_method: Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod::OrSymbol, + processor_token: String, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: T::Boolean, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_number:, + country:, + currency:, + financial_account_token:, + owner:, + owner_type:, + routing_number:, + type:, + verification_method:, + processor_token:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + name: nil, + user_defined_id: nil, + verification_enforcement: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::OwnerType::OrSymbol, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Type::OrSymbol, + verification_method: Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod::OrSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: T::Boolean, + processor_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountCreateParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountCreateParams::Type::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountCreateParams::Type::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountCreateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountCreateParams::Type::TaggedSymbol]) } + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod::TaggedSymbol) } + + EXTERNALLY_VERIFIED = + T.let( + :EXTERNALLY_VERIFIED, + Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_create_response.rbi b/rbi/lib/lithic/models/external_bank_account_create_response.rbi new file mode 100644 index 00000000..e37ec8f2 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_create_response.rbi @@ -0,0 +1,327 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountCreateResponse < Lithic::BaseModel + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig { returns(Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol) } + attr_accessor :verification_method + + # Verification State + sig { returns(Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol) } + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_reader :verification_failed_reason + + sig { params(verification_failed_reason: String).void } + attr_writer :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccountCreateResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::OrSymbol, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::OrSymbol, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + country:, + created:, + currency:, + last_four:, + owner:, + owner_type:, + routing_number:, + state:, + type:, + verification_attempts:, + verification_method:, + verification_state:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + financial_account_token: nil, + name: nil, + user_defined_id: nil, + verification_failed_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol, + type: Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol) } + + BUSINESS = T.let(:BUSINESS, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol) + INDIVIDUAL = + T.let(:INDIVIDUAL, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol]) } + def self.values + end + end + + # Account State + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol) } + + ENABLED = T.let(:ENABLED, Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol]) } + def self.values + end + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol]) } + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol) } + + MANUAL = + T.let(:MANUAL, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol) + MICRO_DEPOSIT = + T.let(:MICRO_DEPOSIT, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol) + PLAID = + T.let(:PLAID, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol) + PRENOTE = + T.let(:PRENOTE, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol]) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol) } + + PENDING = + T.let(:PENDING, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol) + ENABLED = + T.let(:ENABLED, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_list_params.rbi b/rbi/lib/lithic/models/external_bank_account_list_params.rbi new file mode 100644 index 00000000..7f4c7bdc --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_list_params.rbi @@ -0,0 +1,177 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + sig { returns(T.nilable(T::Array[Lithic::Models::ExternalBankAccountListParams::AccountType::OrSymbol])) } + attr_reader :account_types + + sig { params(account_types: T::Array[Lithic::Models::ExternalBankAccountListParams::AccountType::OrSymbol]).void } + attr_writer :account_types + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :countries + + sig { params(countries: T::Array[String]).void } + attr_writer :countries + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + sig { returns(T.nilable(T::Array[Lithic::Models::OwnerType::OrSymbol])) } + attr_reader :owner_types + + sig { params(owner_types: T::Array[Lithic::Models::OwnerType::OrSymbol]).void } + attr_writer :owner_types + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig { returns(T.nilable(T::Array[Lithic::Models::ExternalBankAccountListParams::State::OrSymbol])) } + attr_reader :states + + sig { params(states: T::Array[Lithic::Models::ExternalBankAccountListParams::State::OrSymbol]).void } + attr_writer :states + + sig { returns(T.nilable(T::Array[Lithic::Models::ExternalBankAccountListParams::VerificationState::OrSymbol])) } + attr_reader :verification_states + + sig do + params( + verification_states: T::Array[Lithic::Models::ExternalBankAccountListParams::VerificationState::OrSymbol] + ) + .void + end + attr_writer :verification_states + + sig do + params( + account_token: String, + account_types: T::Array[Lithic::Models::ExternalBankAccountListParams::AccountType::OrSymbol], + countries: T::Array[String], + ending_before: String, + owner_types: T::Array[Lithic::Models::OwnerType::OrSymbol], + page_size: Integer, + starting_after: String, + states: T::Array[Lithic::Models::ExternalBankAccountListParams::State::OrSymbol], + verification_states: T::Array[Lithic::Models::ExternalBankAccountListParams::VerificationState::OrSymbol], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + account_types: nil, + countries: nil, + ending_before: nil, + owner_types: nil, + page_size: nil, + starting_after: nil, + states: nil, + verification_states: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + account_types: T::Array[Lithic::Models::ExternalBankAccountListParams::AccountType::OrSymbol], + countries: T::Array[String], + ending_before: String, + owner_types: T::Array[Lithic::Models::OwnerType::OrSymbol], + page_size: Integer, + starting_after: String, + states: T::Array[Lithic::Models::ExternalBankAccountListParams::State::OrSymbol], + verification_states: T::Array[Lithic::Models::ExternalBankAccountListParams::VerificationState::OrSymbol], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module AccountType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListParams::AccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListParams::AccountType::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountListParams::AccountType::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountListParams::AccountType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountListParams::AccountType::TaggedSymbol]) } + def self.values + end + end + + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListParams::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListParams::State::TaggedSymbol) } + + ENABLED = T.let(:ENABLED, Lithic::Models::ExternalBankAccountListParams::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::ExternalBankAccountListParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::ExternalBankAccountListParams::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountListParams::State::TaggedSymbol]) } + def self.values + end + end + + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListParams::VerificationState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListParams::VerificationState::TaggedSymbol) } + + PENDING = T.let(:PENDING, Lithic::Models::ExternalBankAccountListParams::VerificationState::TaggedSymbol) + ENABLED = T.let(:ENABLED, Lithic::Models::ExternalBankAccountListParams::VerificationState::TaggedSymbol) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountListParams::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let(:INSUFFICIENT_FUNDS, Lithic::Models::ExternalBankAccountListParams::VerificationState::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountListParams::VerificationState::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_list_response.rbi b/rbi/lib/lithic/models/external_bank_account_list_response.rbi new file mode 100644 index 00000000..5ca4559e --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_list_response.rbi @@ -0,0 +1,324 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountListResponse < Lithic::BaseModel + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig { returns(Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol) } + attr_accessor :verification_method + + # Verification State + sig { returns(Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol) } + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_reader :verification_failed_reason + + sig { params(verification_failed_reason: String).void } + attr_writer :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccountListResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::OrSymbol, + verification_state: Lithic::Models::ExternalBankAccountListResponse::VerificationState::OrSymbol, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + country:, + created:, + currency:, + last_four:, + owner:, + owner_type:, + routing_number:, + state:, + type:, + verification_attempts:, + verification_method:, + verification_state:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + financial_account_token: nil, + name: nil, + user_defined_id: nil, + verification_failed_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol, + type: Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol, + verification_state: Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListResponse::OwnerType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol) } + + BUSINESS = T.let(:BUSINESS, Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol) + INDIVIDUAL = T.let(:INDIVIDUAL, Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol]) } + def self.values + end + end + + # Account State + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol) } + + ENABLED = T.let(:ENABLED, Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol]) } + def self.values + end + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol]) } + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol) } + + MANUAL = + T.let(:MANUAL, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol) + MICRO_DEPOSIT = + T.let(:MICRO_DEPOSIT, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol) + PLAID = T.let(:PLAID, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol) + PRENOTE = + T.let(:PRENOTE, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol]) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol) } + + PENDING = + T.let(:PENDING, Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol) + ENABLED = + T.let(:ENABLED, Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_retrieve_params.rbi b/rbi/lib/lithic/models/external_bank_account_retrieve_params.rbi new file mode 100644 index 00000000..2ed15bb4 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_retrieve_response.rbi b/rbi/lib/lithic/models/external_bank_account_retrieve_response.rbi new file mode 100644 index 00000000..f7e90cd7 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_retrieve_response.rbi @@ -0,0 +1,330 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetrieveResponse < Lithic::BaseModel + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig { returns(Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol) } + attr_accessor :verification_method + + # Verification State + sig { returns(Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol) } + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_reader :verification_failed_reason + + sig { params(verification_failed_reason: String).void } + attr_writer :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::OrSymbol, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::OrSymbol, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + country:, + created:, + currency:, + last_four:, + owner:, + owner_type:, + routing_number:, + state:, + type:, + verification_attempts:, + verification_method:, + verification_state:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + financial_account_token: nil, + name: nil, + user_defined_id: nil, + verification_failed_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol) } + + BUSINESS = T.let(:BUSINESS, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol) + INDIVIDUAL = + T.let(:INDIVIDUAL, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol]) } + def self.values + end + end + + # Account State + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol) } + + ENABLED = T.let(:ENABLED, Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol]) } + def self.values + end + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol]) } + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol) } + + MANUAL = + T.let(:MANUAL, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let(:PLAID, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol) + PRENOTE = + T.let(:PRENOTE, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol]) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol) } + + PENDING = + T.let(:PENDING, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol) + ENABLED = + T.let(:ENABLED, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rbi b/rbi/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rbi new file mode 100644 index 00000000..29e523d6 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetryMicroDepositsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(financial_account_token: nil, request_options: {}) + end + + sig { override.returns({financial_account_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rbi b/rbi/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rbi new file mode 100644 index 00000000..0a5c0807 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rbi @@ -0,0 +1,376 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetryMicroDepositsResponse < Lithic::BaseModel + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig { returns(Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol) } + attr_accessor :verification_method + + # Verification State + sig { returns(Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol) } + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_reader :verification_failed_reason + + sig { params(verification_failed_reason: String).void } + attr_writer :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::OrSymbol, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::OrSymbol, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + country:, + created:, + currency:, + last_four:, + owner:, + owner_type:, + routing_number:, + state:, + type:, + verification_attempts:, + verification_method:, + verification_state:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + financial_account_token: nil, + name: nil, + user_defined_id: nil, + verification_failed_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol) } + + BUSINESS = + T.let(:BUSINESS, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol) + INDIVIDUAL = + T.let(:INDIVIDUAL, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol]) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol) } + + ENABLED = + T.let(:ENABLED, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol) + CLOSED = + T.let(:CLOSED, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol) + PAUSED = + T.let(:PAUSED, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol]) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol) } + + CHECKING = + T.let(:CHECKING, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol) + SAVINGS = + T.let(:SAVINGS, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol]) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + end + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + end + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_retry_prenote_params.rbi b/rbi/lib/lithic/models/external_bank_account_retry_prenote_params.rbi new file mode 100644 index 00000000..84ffdf5d --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_retry_prenote_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetryPrenoteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(financial_account_token: nil, request_options: {}) + end + + sig { override.returns({financial_account_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_retry_prenote_response.rbi b/rbi/lib/lithic/models/external_bank_account_retry_prenote_response.rbi new file mode 100644 index 00000000..14ebba3c --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_retry_prenote_response.rbi @@ -0,0 +1,287 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetryPrenoteResponse < Lithic::BaseModel + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig { returns(Lithic::Models::VerificationMethod::TaggedSymbol) } + attr_accessor :verification_method + + # Verification State + sig { returns(Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol) } + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_reader :verification_failed_reason + + sig { params(verification_failed_reason: String).void } + attr_writer :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::VerificationMethod::OrSymbol, + verification_state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::OrSymbol, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + country:, + created:, + currency:, + last_four:, + owner:, + owner_type:, + routing_number:, + state:, + type:, + verification_attempts:, + verification_method:, + verification_state:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + financial_account_token: nil, + name: nil, + user_defined_id: nil, + verification_failed_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::TaggedSymbol, + type: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::VerificationMethod::TaggedSymbol, + verification_state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + ) + end + def to_hash + end + + # Account State + module State + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::TaggedSymbol) } + + ENABLED = T.let(:ENABLED, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State::TaggedSymbol]) } + def self.values + end + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type::TaggedSymbol]) } + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol) } + + PENDING = + T.let(:PENDING, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol) + ENABLED = + T.let(:ENABLED, Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_update_params.rbi b/rbi/lib/lithic/models/external_bank_account_update_params.rbi new file mode 100644 index 00000000..8311bf22 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_update_params.rbi @@ -0,0 +1,137 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(T.nilable(String)) } + attr_reader :owner + + sig { params(owner: String).void } + attr_writer :owner + + # Owner Type + sig { returns(T.nilable(Lithic::Models::OwnerType::OrSymbol)) } + attr_reader :owner_type + + sig { params(owner_type: Lithic::Models::OwnerType::OrSymbol).void } + attr_writer :owner_type + + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountUpdateParams::Type::OrSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::ExternalBankAccountUpdateParams::Type::OrSymbol).void } + attr_writer :type + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::Models::OwnerType::OrSymbol, + type: Lithic::Models::ExternalBankAccountUpdateParams::Type::OrSymbol, + user_defined_id: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + name: nil, + owner: nil, + owner_type: nil, + type: nil, + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::Models::OwnerType::OrSymbol, + type: Lithic::Models::ExternalBankAccountUpdateParams::Type::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountUpdateParams::Type::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountUpdateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountUpdateParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_account_update_response.rbi b/rbi/lib/lithic/models/external_bank_account_update_response.rbi new file mode 100644 index 00000000..507a32b5 --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_account_update_response.rbi @@ -0,0 +1,327 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountUpdateResponse < Lithic::BaseModel + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig { returns(Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol) } + attr_accessor :verification_method + + # Verification State + sig { returns(Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol) } + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_reader :verification_failed_reason + + sig { params(verification_failed_reason: String).void } + attr_writer :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccountUpdateResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::OrSymbol, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::OrSymbol, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + country:, + created:, + currency:, + last_four:, + owner:, + owner_type:, + routing_number:, + state:, + type:, + verification_attempts:, + verification_method:, + verification_state:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + financial_account_token: nil, + name: nil, + user_defined_id: nil, + verification_failed_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol, + type: Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol) } + + BUSINESS = T.let(:BUSINESS, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol) + INDIVIDUAL = + T.let(:INDIVIDUAL, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol]) } + def self.values + end + end + + # Account State + module State + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol) } + + ENABLED = T.let(:ENABLED, Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol]) } + def self.values + end + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol) } + + CHECKING = T.let(:CHECKING, Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol) + SAVINGS = T.let(:SAVINGS, Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol]) } + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol) } + + MANUAL = + T.let(:MANUAL, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol) + MICRO_DEPOSIT = + T.let(:MICRO_DEPOSIT, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol) + PLAID = + T.let(:PLAID, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol) + PRENOTE = + T.let(:PRENOTE, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol]) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol) } + + PENDING = + T.let(:PENDING, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol) + ENABLED = + T.let(:ENABLED, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rbi b/rbi/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rbi new file mode 100644 index 00000000..6363a93f --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + module ExternalBankAccounts + class MicroDepositCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T::Array[Integer]) } + attr_accessor :micro_deposits + + sig do + params( + micro_deposits: T::Array[Integer], + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(micro_deposits:, request_options: {}) + end + + sig { override.returns({micro_deposits: T::Array[Integer], request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rbi b/rbi/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rbi new file mode 100644 index 00000000..046bdf1e --- /dev/null +++ b/rbi/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rbi @@ -0,0 +1,390 @@ +# typed: strong + +module Lithic + module Models + module ExternalBankAccounts + class MicroDepositCreateResponse < Lithic::BaseModel + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig do + returns( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + end + attr_accessor :verification_method + + # Verification State + sig { returns(Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol) } + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::Models::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_reader :verification_failed_reason + + sig { params(verification_failed_reason: String).void } + attr_writer :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::OrSymbol, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::OrSymbol, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + country:, + created:, + currency:, + last_four:, + owner:, + owner_type:, + routing_number:, + state:, + type:, + verification_attempts:, + verification_method:, + verification_state:, + account_token: nil, + address: nil, + company_id: nil, + dob: nil, + doing_business_as: nil, + financial_account_token: nil, + name: nil, + user_defined_id: nil, + verification_failed_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol] + ) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol) } + + ENABLED = + T.let(:ENABLED, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol) + CLOSED = + T.let(:CLOSED, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol) + PAUSED = + T.let(:PAUSED, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol]) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol) } + + CHECKING = + T.let(:CHECKING, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol) + SAVINGS = + T.let(:SAVINGS, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol]) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + end + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + end + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment.rbi b/rbi/lib/lithic/models/external_payment.rbi new file mode 100644 index 00000000..a52df4e1 --- /dev/null +++ b/rbi/lib/lithic/models/external_payment.rbi @@ -0,0 +1,308 @@ +# typed: strong + +module Lithic + module Models + class ExternalPayment < Lithic::BaseModel + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Models::ExternalPayment::Category::TaggedSymbol) } + attr_accessor :category + + sig { returns(Time) } + attr_accessor :created + + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Array[Lithic::Models::ExternalPayment::Event]) } + attr_accessor :events + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Lithic::Models::ExternalPayment::PaymentType::TaggedSymbol) } + attr_accessor :payment_type + + sig { returns(Integer) } + attr_accessor :pending_amount + + sig { returns(Lithic::Models::ExternalPayment::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(Integer) } + attr_accessor :settled_amount + + sig { returns(Lithic::Models::ExternalPayment::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + token: String, + category: Lithic::Models::ExternalPayment::Category::OrSymbol, + created: Time, + currency: String, + events: T::Array[T.any(Lithic::Models::ExternalPayment::Event, Lithic::Util::AnyHash)], + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType::OrSymbol, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status::OrSymbol, + updated: Time, + user_defined_id: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + category:, + created:, + currency:, + events:, + financial_account_token:, + payment_type:, + pending_amount:, + result:, + settled_amount:, + status:, + updated:, + user_defined_id: nil + ) + end + + sig do + override + .returns( + { + token: String, + category: Lithic::Models::ExternalPayment::Category::TaggedSymbol, + created: Time, + currency: String, + events: T::Array[Lithic::Models::ExternalPayment::Event], + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType::TaggedSymbol, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status::TaggedSymbol, + updated: Time, + user_defined_id: String + } + ) + end + def to_hash + end + + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPayment::Category) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::ExternalPayment::Category::TaggedSymbol) } + + EXTERNAL_WIRE = T.let(:EXTERNAL_WIRE, Lithic::Models::ExternalPayment::Category::TaggedSymbol) + EXTERNAL_ACH = T.let(:EXTERNAL_ACH, Lithic::Models::ExternalPayment::Category::TaggedSymbol) + EXTERNAL_CHECK = T.let(:EXTERNAL_CHECK, Lithic::Models::ExternalPayment::Category::TaggedSymbol) + EXTERNAL_TRANSFER = T.let(:EXTERNAL_TRANSFER, Lithic::Models::ExternalPayment::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPayment::Category::TaggedSymbol]) } + def self.values + end + end + + class Event < Lithic::BaseModel + sig { returns(String) } + attr_accessor :token + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created + + sig { returns(T::Array[Lithic::Models::ExternalPayment::Event::DetailedResult::TaggedSymbol]) } + attr_accessor :detailed_results + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :memo + + sig { returns(Lithic::Models::ExternalPayment::Event::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) } + attr_accessor :type + + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: T::Array[Lithic::Models::ExternalPayment::Event::DetailedResult::OrSymbol], + effective_date: Date, + memo: String, + result: Lithic::Models::ExternalPayment::Event::Result::OrSymbol, + type: Lithic::Models::ExternalPayment::Event::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(token:, amount:, created:, detailed_results:, effective_date:, memo:, result:, type:) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: T::Array[Lithic::Models::ExternalPayment::Event::DetailedResult::TaggedSymbol], + effective_date: Date, + memo: String, + result: Lithic::Models::ExternalPayment::Event::Result::TaggedSymbol, + type: Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPayment::Event::DetailedResult) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPayment::Event::DetailedResult::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::ExternalPayment::Event::DetailedResult::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPayment::Event::DetailedResult::TaggedSymbol]) } + def self.values + end + end + + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPayment::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::ExternalPayment::Event::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::ExternalPayment::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ExternalPayment::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPayment::Event::Result::TaggedSymbol]) } + def self.values + end + end + + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPayment::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) } + + EXTERNAL_WIRE_INITIATED = + T.let(:EXTERNAL_WIRE_INITIATED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_CANCELED = + T.let(:EXTERNAL_WIRE_CANCELED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_SETTLED = + T.let(:EXTERNAL_WIRE_SETTLED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_REVERSED = + T.let(:EXTERNAL_WIRE_REVERSED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_RELEASED = + T.let(:EXTERNAL_WIRE_RELEASED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_ACH_INITIATED = + T.let(:EXTERNAL_ACH_INITIATED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_ACH_CANCELED = + T.let(:EXTERNAL_ACH_CANCELED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_ACH_SETTLED = + T.let(:EXTERNAL_ACH_SETTLED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_ACH_REVERSED = + T.let(:EXTERNAL_ACH_REVERSED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_ACH_RELEASED = + T.let(:EXTERNAL_ACH_RELEASED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_INITIATED = + T.let(:EXTERNAL_TRANSFER_INITIATED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_CANCELED = + T.let(:EXTERNAL_TRANSFER_CANCELED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_SETTLED = + T.let(:EXTERNAL_TRANSFER_SETTLED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_REVERSED = + T.let(:EXTERNAL_TRANSFER_REVERSED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_RELEASED = + T.let(:EXTERNAL_TRANSFER_RELEASED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_INITIATED = + T.let(:EXTERNAL_CHECK_INITIATED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_CANCELED = + T.let(:EXTERNAL_CHECK_CANCELED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_SETTLED = + T.let(:EXTERNAL_CHECK_SETTLED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_REVERSED = + T.let(:EXTERNAL_CHECK_REVERSED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_RELEASED = + T.let(:EXTERNAL_CHECK_RELEASED, Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPayment::Event::Type::TaggedSymbol]) } + def self.values + end + end + end + + module PaymentType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPayment::PaymentType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::ExternalPayment::PaymentType::TaggedSymbol) } + + DEPOSIT = T.let(:DEPOSIT, Lithic::Models::ExternalPayment::PaymentType::TaggedSymbol) + WITHDRAWAL = T.let(:WITHDRAWAL, Lithic::Models::ExternalPayment::PaymentType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPayment::PaymentType::TaggedSymbol]) } + def self.values + end + end + + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPayment::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::ExternalPayment::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::ExternalPayment::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ExternalPayment::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPayment::Result::TaggedSymbol]) } + def self.values + end + end + + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPayment::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::ExternalPayment::Status::TaggedSymbol) } + + PENDING = T.let(:PENDING, Lithic::Models::ExternalPayment::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::ExternalPayment::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ExternalPayment::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Models::ExternalPayment::Status::TaggedSymbol) + CANCELED = T.let(:CANCELED, Lithic::Models::ExternalPayment::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPayment::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment_cancel_params.rbi b/rbi/lib/lithic/models/external_payment_cancel_params.rbi new file mode 100644 index 00000000..f4684034 --- /dev/null +++ b/rbi/lib/lithic/models/external_payment_cancel_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentCancelParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + effective_date: Date, + memo: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(effective_date:, memo: nil, request_options: {}) + end + + sig { override.returns({effective_date: Date, memo: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment_create_params.rbi b/rbi/lib/lithic/models/external_payment_create_params.rbi new file mode 100644 index 00000000..e34e69c0 --- /dev/null +++ b/rbi/lib/lithic/models/external_payment_create_params.rbi @@ -0,0 +1,148 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::Models::ExternalPaymentCreateParams::Category::OrSymbol) } + attr_accessor :category + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Lithic::Models::ExternalPaymentCreateParams::PaymentType::OrSymbol) } + attr_accessor :payment_type + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig { returns(T.nilable(Lithic::Models::ExternalPaymentCreateParams::ProgressTo::OrSymbol)) } + attr_reader :progress_to + + sig { params(progress_to: Lithic::Models::ExternalPaymentCreateParams::ProgressTo::OrSymbol).void } + attr_writer :progress_to + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::Category::OrSymbol, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::PaymentType::OrSymbol, + token: String, + memo: String, + progress_to: Lithic::Models::ExternalPaymentCreateParams::ProgressTo::OrSymbol, + user_defined_id: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + amount:, + category:, + effective_date:, + financial_account_token:, + payment_type:, + token: nil, + memo: nil, + progress_to: nil, + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::Category::OrSymbol, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::PaymentType::OrSymbol, + token: String, + memo: String, + progress_to: Lithic::Models::ExternalPaymentCreateParams::ProgressTo::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPaymentCreateParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPaymentCreateParams::Category::TaggedSymbol) } + + EXTERNAL_WIRE = + T.let(:EXTERNAL_WIRE, Lithic::Models::ExternalPaymentCreateParams::Category::TaggedSymbol) + EXTERNAL_ACH = T.let(:EXTERNAL_ACH, Lithic::Models::ExternalPaymentCreateParams::Category::TaggedSymbol) + EXTERNAL_CHECK = + T.let(:EXTERNAL_CHECK, Lithic::Models::ExternalPaymentCreateParams::Category::TaggedSymbol) + EXTERNAL_TRANSFER = + T.let(:EXTERNAL_TRANSFER, Lithic::Models::ExternalPaymentCreateParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPaymentCreateParams::Category::TaggedSymbol]) } + def self.values + end + end + + module PaymentType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType::TaggedSymbol) } + + DEPOSIT = T.let(:DEPOSIT, Lithic::Models::ExternalPaymentCreateParams::PaymentType::TaggedSymbol) + WITHDRAWAL = T.let(:WITHDRAWAL, Lithic::Models::ExternalPaymentCreateParams::PaymentType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPaymentCreateParams::PaymentType::TaggedSymbol]) } + def self.values + end + end + + module ProgressTo + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo::TaggedSymbol) } + + SETTLED = T.let(:SETTLED, Lithic::Models::ExternalPaymentCreateParams::ProgressTo::TaggedSymbol) + RELEASED = T.let(:RELEASED, Lithic::Models::ExternalPaymentCreateParams::ProgressTo::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPaymentCreateParams::ProgressTo::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment_list_params.rbi b/rbi/lib/lithic/models/external_payment_list_params.rbi new file mode 100644 index 00000000..02ede61d --- /dev/null +++ b/rbi/lib/lithic/models/external_payment_list_params.rbi @@ -0,0 +1,191 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # External Payment category to be returned. + sig { returns(T.nilable(Lithic::Models::ExternalPaymentListParams::Category::OrSymbol)) } + attr_reader :category + + sig { params(category: Lithic::Models::ExternalPaymentListParams::Category::OrSymbol).void } + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # External Payment result to be returned. + sig { returns(T.nilable(Lithic::Models::ExternalPaymentListParams::Result::OrSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::ExternalPaymentListParams::Result::OrSymbol).void } + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Book transfer status to be returned. + sig { returns(T.nilable(Lithic::Models::ExternalPaymentListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::ExternalPaymentListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::Models::ExternalPaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::ExternalPaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::ExternalPaymentListParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + business_account_token: nil, + category: nil, + end_: nil, + ending_before: nil, + financial_account_token: nil, + page_size: nil, + result: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ExternalPaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::ExternalPaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::ExternalPaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # External Payment category to be returned. + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPaymentListParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPaymentListParams::Category::TaggedSymbol) } + + EXTERNAL_WIRE = T.let(:EXTERNAL_WIRE, Lithic::Models::ExternalPaymentListParams::Category::TaggedSymbol) + EXTERNAL_ACH = T.let(:EXTERNAL_ACH, Lithic::Models::ExternalPaymentListParams::Category::TaggedSymbol) + EXTERNAL_CHECK = + T.let(:EXTERNAL_CHECK, Lithic::Models::ExternalPaymentListParams::Category::TaggedSymbol) + EXTERNAL_TRANSFER = + T.let(:EXTERNAL_TRANSFER, Lithic::Models::ExternalPaymentListParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPaymentListParams::Category::TaggedSymbol]) } + def self.values + end + end + + # External Payment result to be returned. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPaymentListParams::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPaymentListParams::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::ExternalPaymentListParams::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ExternalPaymentListParams::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPaymentListParams::Result::TaggedSymbol]) } + def self.values + end + end + + # Book transfer status to be returned. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPaymentListParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPaymentListParams::Status::TaggedSymbol) } + + PENDING = T.let(:PENDING, Lithic::Models::ExternalPaymentListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::ExternalPaymentListParams::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ExternalPaymentListParams::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Models::ExternalPaymentListParams::Status::TaggedSymbol) + CANCELED = T.let(:CANCELED, Lithic::Models::ExternalPaymentListParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPaymentListParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment_release_params.rbi b/rbi/lib/lithic/models/external_payment_release_params.rbi new file mode 100644 index 00000000..b161a79a --- /dev/null +++ b/rbi/lib/lithic/models/external_payment_release_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentReleaseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + effective_date: Date, + memo: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(effective_date:, memo: nil, request_options: {}) + end + + sig { override.returns({effective_date: Date, memo: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment_retrieve_params.rbi b/rbi/lib/lithic/models/external_payment_retrieve_params.rbi new file mode 100644 index 00000000..1ec6d190 --- /dev/null +++ b/rbi/lib/lithic/models/external_payment_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment_reverse_params.rbi b/rbi/lib/lithic/models/external_payment_reverse_params.rbi new file mode 100644 index 00000000..ae5fa4d2 --- /dev/null +++ b/rbi/lib/lithic/models/external_payment_reverse_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentReverseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + effective_date: Date, + memo: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(effective_date:, memo: nil, request_options: {}) + end + + sig { override.returns({effective_date: Date, memo: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/external_payment_settle_params.rbi b/rbi/lib/lithic/models/external_payment_settle_params.rbi new file mode 100644 index 00000000..4c5d808e --- /dev/null +++ b/rbi/lib/lithic/models/external_payment_settle_params.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentSettleParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig { returns(T.nilable(Lithic::Models::ExternalPaymentSettleParams::ProgressTo::OrSymbol)) } + attr_reader :progress_to + + sig { params(progress_to: Lithic::Models::ExternalPaymentSettleParams::ProgressTo::OrSymbol).void } + attr_writer :progress_to + + sig do + params( + effective_date: Date, + memo: String, + progress_to: Lithic::Models::ExternalPaymentSettleParams::ProgressTo::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(effective_date:, memo: nil, progress_to: nil, request_options: {}) + end + + sig do + override + .returns( + { + effective_date: Date, + memo: String, + progress_to: Lithic::Models::ExternalPaymentSettleParams::ProgressTo::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module ProgressTo + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo::TaggedSymbol) } + + SETTLED = T.let(:SETTLED, Lithic::Models::ExternalPaymentSettleParams::ProgressTo::TaggedSymbol) + RELEASED = T.let(:RELEASED, Lithic::Models::ExternalPaymentSettleParams::ProgressTo::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ExternalPaymentSettleParams::ProgressTo::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_account.rbi b/rbi/lib/lithic/models/financial_account.rbi new file mode 100644 index 00000000..856939cc --- /dev/null +++ b/rbi/lib/lithic/models/financial_account.rbi @@ -0,0 +1,301 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccount < Lithic::BaseModel + # Globally unique identifier for the account + sig { returns(String) } + attr_accessor :token + + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + sig { returns(Time) } + attr_accessor :created + + sig { returns(T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration)) } + attr_reader :credit_configuration + + sig do + params( + credit_configuration: T.nilable(T.any(Lithic::Models::FinancialAccount::CreditConfiguration, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :credit_configuration + + # Whether financial account is for the benefit of another entity + sig { returns(T::Boolean) } + attr_accessor :is_for_benefit_of + + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + # Status of the financial account + sig { returns(Lithic::Models::FinancialAccount::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(Lithic::Models::FinancialAccount::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(String)) } + attr_accessor :account_number + + sig { returns(T.nilable(String)) } + attr_accessor :routing_number + + # Reason for the financial account status change + sig { returns(T.nilable(Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol)) } + attr_accessor :status_change_reason + + sig do + params( + token: String, + account_token: T.nilable(String), + created: Time, + credit_configuration: T.nilable(T.any(Lithic::Models::FinancialAccount::CreditConfiguration, Lithic::Util::AnyHash)), + is_for_benefit_of: T::Boolean, + nickname: T.nilable(String), + status: Lithic::Models::FinancialAccount::Status::OrSymbol, + type: Lithic::Models::FinancialAccount::Type::OrSymbol, + updated: Time, + account_number: T.nilable(String), + routing_number: T.nilable(String), + status_change_reason: T.nilable(Lithic::Models::FinancialAccount::StatusChangeReason::OrSymbol) + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_token:, + created:, + credit_configuration:, + is_for_benefit_of:, + nickname:, + status:, + type:, + updated:, + account_number: nil, + routing_number: nil, + status_change_reason: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_token: T.nilable(String), + created: Time, + credit_configuration: T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration), + is_for_benefit_of: T::Boolean, + nickname: T.nilable(String), + status: Lithic::Models::FinancialAccount::Status::TaggedSymbol, + type: Lithic::Models::FinancialAccount::Type::TaggedSymbol, + updated: Time, + account_number: T.nilable(String), + routing_number: T.nilable(String), + status_change_reason: T.nilable(Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol) + } + ) + end + def to_hash + end + + class CreditConfiguration < Lithic::BaseModel + # Reason for the financial account being marked as Charged Off + sig { returns(T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason::TaggedSymbol)) } + attr_accessor :charged_off_reason + + sig { returns(T.nilable(Integer)) } + attr_accessor :credit_limit + + # Globally unique identifier for the credit product + sig { returns(T.nilable(String)) } + attr_accessor :credit_product_token + + sig { returns(T.nilable(String)) } + attr_accessor :external_bank_account_token + + # State of the financial account + sig do + returns( + T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol) + ) + end + attr_accessor :financial_account_state + + sig { returns(T::Boolean) } + attr_accessor :is_spend_blocked + + # Tier assigned to the financial account + sig { returns(T.nilable(String)) } + attr_accessor :tier + + sig do + params( + charged_off_reason: T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason::OrSymbol), + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + financial_account_state: T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::OrSymbol), + is_spend_blocked: T::Boolean, + tier: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + charged_off_reason:, + credit_limit:, + credit_product_token:, + external_bank_account_token:, + financial_account_state:, + is_spend_blocked:, + tier: + ) + end + + sig do + override + .returns( + { + charged_off_reason: T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason::TaggedSymbol), + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + financial_account_state: T.nilable(Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol), + is_spend_blocked: T::Boolean, + tier: T.nilable(String) + } + ) + end + def to_hash + end + + # Reason for the financial account being marked as Charged Off + module ChargedOffReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason::TaggedSymbol) } + + DELINQUENT = + T.let(:DELINQUENT, Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason::TaggedSymbol) + FRAUD = + T.let(:FRAUD, Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::FinancialAccount::CreditConfiguration::ChargedOffReason::TaggedSymbol]) + end + def self.values + end + end + + # State of the financial account + module FinancialAccountState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol + ) + CURRENT = + T.let( + :CURRENT, + Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol + ) + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol + ) + CHARGED_OFF = + T.let( + :CHARGED_OFF, + Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccount::CreditConfiguration::FinancialAccountState::TaggedSymbol] + ) + end + def self.values + end + end + end + + # Status of the financial account + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccount::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccount::Status::TaggedSymbol) } + + OPEN = T.let(:OPEN, Lithic::Models::FinancialAccount::Status::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::FinancialAccount::Status::TaggedSymbol) + SUSPENDED = T.let(:SUSPENDED, Lithic::Models::FinancialAccount::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::FinancialAccount::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccount::Status::TaggedSymbol]) } + def self.values + end + end + + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccount::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccount::Type::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::FinancialAccount::Type::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::FinancialAccount::Type::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::FinancialAccount::Type::TaggedSymbol) + CHARGED_OFF_FEES = T.let(:CHARGED_OFF_FEES, Lithic::Models::FinancialAccount::Type::TaggedSymbol) + CHARGED_OFF_INTEREST = T.let(:CHARGED_OFF_INTEREST, Lithic::Models::FinancialAccount::Type::TaggedSymbol) + CHARGED_OFF_PRINCIPAL = + T.let(:CHARGED_OFF_PRINCIPAL, Lithic::Models::FinancialAccount::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccount::Type::TaggedSymbol]) } + def self.values + end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccount::StatusChangeReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol) } + + CHARGED_OFF_DELINQUENT = + T.let(:CHARGED_OFF_DELINQUENT, Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol) + CHARGED_OFF_FRAUD = + T.let(:CHARGED_OFF_FRAUD, Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol) + END_USER_REQUEST = + T.let(:END_USER_REQUEST, Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol) + BANK_REQUEST = T.let(:BANK_REQUEST, Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol) + DELINQUENT = T.let(:DELINQUENT, Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccount::StatusChangeReason::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_account_create_params.rbi b/rbi/lib/lithic/models/financial_account_create_params.rbi new file mode 100644 index 00000000..71b830a2 --- /dev/null +++ b/rbi/lib/lithic/models/financial_account_create_params.rbi @@ -0,0 +1,78 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(String) } + attr_accessor :nickname + + sig { returns(Lithic::Models::FinancialAccountCreateParams::Type::OrSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_for_benefit_of + + sig { params(is_for_benefit_of: T::Boolean).void } + attr_writer :is_for_benefit_of + + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + + sig do + params( + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::Type::OrSymbol, + account_token: String, + is_for_benefit_of: T::Boolean, + idempotency_key: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(nickname:, type:, account_token: nil, is_for_benefit_of: nil, idempotency_key: nil, request_options: {}) + end + + sig do + override + .returns( + { + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::Type::OrSymbol, + account_token: String, + is_for_benefit_of: T::Boolean, + idempotency_key: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccountCreateParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccountCreateParams::Type::TaggedSymbol) } + + OPERATING = T.let(:OPERATING, Lithic::Models::FinancialAccountCreateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccountCreateParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_account_list_params.rbi b/rbi/lib/lithic/models/financial_account_list_params.rbi new file mode 100644 index 00000000..5e7da58a --- /dev/null +++ b/rbi/lib/lithic/models/financial_account_list_params.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # List financial accounts for a given account_token or business_account_token + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # List financial accounts for a given business_account_token + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # List financial accounts of a given type + sig { returns(T.nilable(Lithic::Models::FinancialAccountListParams::Type::OrSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::FinancialAccountListParams::Type::OrSymbol).void } + attr_writer :type + + sig do + params( + account_token: String, + business_account_token: String, + type: Lithic::Models::FinancialAccountListParams::Type::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(account_token: nil, business_account_token: nil, type: nil, request_options: {}) + end + + sig do + override + .returns( + { + account_token: String, + business_account_token: String, + type: Lithic::Models::FinancialAccountListParams::Type::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # List financial accounts of a given type + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccountListParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccountListParams::Type::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::FinancialAccountListParams::Type::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::FinancialAccountListParams::Type::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::FinancialAccountListParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccountListParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_account_retrieve_params.rbi b/rbi/lib/lithic/models/financial_account_retrieve_params.rbi new file mode 100644 index 00000000..100407e7 --- /dev/null +++ b/rbi/lib/lithic/models/financial_account_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_account_update_params.rbi b/rbi/lib/lithic/models/financial_account_update_params.rbi new file mode 100644 index 00000000..cfad38ea --- /dev/null +++ b/rbi/lib/lithic/models/financial_account_update_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T.nilable(String)) } + attr_reader :nickname + + sig { params(nickname: String).void } + attr_writer :nickname + + sig do + params(nickname: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(nickname: nil, request_options: {}) + end + + sig { override.returns({nickname: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_account_update_status_params.rbi b/rbi/lib/lithic/models/financial_account_update_status_params.rbi new file mode 100644 index 00000000..4cab0ae9 --- /dev/null +++ b/rbi/lib/lithic/models/financial_account_update_status_params.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountUpdateStatusParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Status of the financial account + sig { returns(Lithic::Models::FinancialAccountUpdateStatusParams::Status::OrSymbol) } + attr_accessor :status + + # Reason for the financial account status change + sig { returns(T.nilable(Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::OrSymbol)) } + attr_accessor :status_change_reason + + sig do + params( + status: Lithic::Models::FinancialAccountUpdateStatusParams::Status::OrSymbol, + status_change_reason: T.nilable(Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::OrSymbol), + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(status:, status_change_reason:, request_options: {}) + end + + sig do + override + .returns( + { + status: Lithic::Models::FinancialAccountUpdateStatusParams::Status::OrSymbol, + status_change_reason: T.nilable(Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::OrSymbol), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Status of the financial account + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status::TaggedSymbol) } + + OPEN = T.let(:OPEN, Lithic::Models::FinancialAccountUpdateStatusParams::Status::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Models::FinancialAccountUpdateStatusParams::Status::TaggedSymbol) + SUSPENDED = T.let(:SUSPENDED, Lithic::Models::FinancialAccountUpdateStatusParams::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::FinancialAccountUpdateStatusParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccountUpdateStatusParams::Status::TaggedSymbol]) } + def self.values + end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::TaggedSymbol) } + + CHARGED_OFF_FRAUD = + T.let( + :CHARGED_OFF_FRAUD, + Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::TaggedSymbol + ) + BANK_REQUEST = + T.let(:BANK_REQUEST, Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::TaggedSymbol) + CHARGED_OFF_DELINQUENT = + T.let( + :CHARGED_OFF_DELINQUENT, + Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/balance_list_params.rbi b/rbi/lib/lithic/models/financial_accounts/balance_list_params.rbi new file mode 100644 index 00000000..c4fae5e1 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/balance_list_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class BalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # UTC date of the balance to retrieve. Defaults to latest available balance + sig { returns(T.nilable(Time)) } + attr_reader :balance_date + + sig { params(balance_date: Time).void } + attr_writer :balance_date + + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + sig { returns(T.nilable(String)) } + attr_reader :last_transaction_event_token + + sig { params(last_transaction_event_token: String).void } + attr_writer :last_transaction_event_token + + sig do + params( + balance_date: Time, + last_transaction_event_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(balance_date: nil, last_transaction_event_token: nil, request_options: {}) + end + + sig do + override + .returns( + { + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/balance_list_response.rbi b/rbi/lib/lithic/models/financial_accounts/balance_list_response.rbi new file mode 100644 index 00000000..fec4bb57 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/balance_list_response.rbi @@ -0,0 +1,121 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class BalanceListResponse < Lithic::BaseModel + # Globally unique identifier for the financial account that holds this balance. + sig { returns(String) } + attr_accessor :token + + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :available_amount + + # Date and time for when the balance was first created. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + sig { returns(String) } + attr_accessor :currency + + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + sig { returns(String) } + attr_accessor :last_transaction_event_token + + # Globally unique identifier for the last financial transaction that impacted this + # balance. + sig { returns(String) } + attr_accessor :last_transaction_token + + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + sig { returns(Integer) } + attr_accessor :pending_amount + + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + sig { returns(Integer) } + attr_accessor :total_amount + + # Type of financial account. + sig { returns(Lithic::Models::FinancialAccounts::BalanceListResponse::Type::TaggedSymbol) } + attr_accessor :type + + # Date and time for when the balance was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Balance of a Financial Account + sig do + params( + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccounts::BalanceListResponse::Type::OrSymbol, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + token:, + available_amount:, + created:, + currency:, + last_transaction_event_token:, + last_transaction_token:, + pending_amount:, + total_amount:, + type:, + updated: + ) + end + + sig do + override + .returns( + { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccounts::BalanceListResponse::Type::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Type of financial account. + module Type + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::BalanceListResponse::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccounts::BalanceListResponse::Type::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::FinancialAccounts::BalanceListResponse::Type::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::FinancialAccounts::BalanceListResponse::Type::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::FinancialAccounts::BalanceListResponse::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccounts::BalanceListResponse::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbi b/rbi/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbi new file mode 100644 index 00000000..ad4e7e2a --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class CreditConfigurationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/credit_configuration_update_params.rbi b/rbi/lib/lithic/models/financial_accounts/credit_configuration_update_params.rbi new file mode 100644 index 00000000..8aa4c1e1 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/credit_configuration_update_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class CreditConfigurationUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T.nilable(Integer)) } + attr_reader :credit_limit + + sig { params(credit_limit: Integer).void } + attr_writer :credit_limit + + # Globally unique identifier for the credit product + sig { returns(T.nilable(String)) } + attr_reader :credit_product_token + + sig { params(credit_product_token: String).void } + attr_writer :credit_product_token + + sig { returns(T.nilable(String)) } + attr_reader :external_bank_account_token + + sig { params(external_bank_account_token: String).void } + attr_writer :external_bank_account_token + + # Tier to assign to a financial account + sig { returns(T.nilable(String)) } + attr_reader :tier + + sig { params(tier: String).void } + attr_writer :tier + + sig do + params( + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + credit_limit: nil, + credit_product_token: nil, + external_bank_account_token: nil, + tier: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/financial_account_credit_config.rbi b/rbi/lib/lithic/models/financial_accounts/financial_account_credit_config.rbi new file mode 100644 index 00000000..e4dacd82 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/financial_account_credit_config.rbi @@ -0,0 +1,171 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountCreditConfig < Lithic::BaseModel + # Globally unique identifier for the account + sig { returns(String) } + attr_accessor :account_token + + # Reason for the financial account being marked as Charged Off + sig do + returns( + T.nilable(Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason::TaggedSymbol) + ) + end + attr_accessor :charged_off_reason + + sig { returns(T.nilable(Integer)) } + attr_accessor :credit_limit + + # Globally unique identifier for the credit product + sig { returns(T.nilable(String)) } + attr_accessor :credit_product_token + + sig { returns(T.nilable(String)) } + attr_accessor :external_bank_account_token + + # State of the financial account + sig do + returns( + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol + ) + end + attr_accessor :financial_account_state + + sig { returns(T::Boolean) } + attr_accessor :is_spend_blocked + + # Tier assigned to the financial account + sig { returns(T.nilable(String)) } + attr_accessor :tier + + sig do + params( + account_token: String, + charged_off_reason: T.nilable(Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason::OrSymbol), + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + financial_account_state: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::OrSymbol, + is_spend_blocked: T::Boolean, + tier: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + account_token:, + charged_off_reason:, + credit_limit:, + credit_product_token:, + external_bank_account_token:, + financial_account_state:, + is_spend_blocked:, + tier: + ) + end + + sig do + override + .returns( + { + account_token: String, + charged_off_reason: T.nilable(Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason::TaggedSymbol), + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + financial_account_state: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol, + is_spend_blocked: T::Boolean, + tier: T.nilable(String) + } + ) + end + def to_hash + end + + # Reason for the financial account being marked as Charged Off + module ChargedOffReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason::TaggedSymbol + ) + end + + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason::TaggedSymbol + ) + FRAUD = + T.let( + :FRAUD, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason::TaggedSymbol] + ) + end + def self.values + end + end + + # State of the financial account + module FinancialAccountState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol + ) + end + + PENDING = + T.let( + :PENDING, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol + ) + CURRENT = + T.let( + :CURRENT, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol + ) + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol + ) + CHARGED_OFF = + T.let( + :CHARGED_OFF, + Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState::TaggedSymbol] + ) + end + def self.values + end + end + end + end + + FinancialAccountCreditConfig = FinancialAccounts::FinancialAccountCreditConfig + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/financial_transaction_list_params.rbi b/rbi/lib/lithic/models/financial_accounts/financial_transaction_list_params.rbi new file mode 100644 index 00000000..3564fa99 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/financial_transaction_list_params.rbi @@ -0,0 +1,197 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialTransactionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Financial Transaction category to be returned. + sig { returns(T.nilable(Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol)) } + attr_reader :category + + sig do + params(category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol) + .void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Financial Transaction result to be returned. + sig { returns(T.nilable(Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol).void } + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Financial Transaction status to be returned. + sig { returns(T.nilable(Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + begin_: Time, + category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + category: nil, + end_: nil, + ending_before: nil, + result: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Financial Transaction category to be returned. + module Category + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol) } + + ACH = + T.let(:ACH, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol) + CARD = + T.let(:CARD, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol) + INTERNAL = + T.let( + :INTERNAL, + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol] + ) + end + def self.values + end + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::TaggedSymbol) } + + APPROVED = + T.let(:APPROVED, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::TaggedSymbol]) + end + def self.values + end + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol) } + + DECLINED = + T.let(:DECLINED, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol) + EXPIRED = + T.let(:EXPIRED, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol) + PENDING = + T.let(:PENDING, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol) + RETURNED = + T.let(:RETURNED, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol) + SETTLED = + T.let(:SETTLED, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol) + VOIDED = + T.let(:VOIDED, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol]) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbi b/rbi/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbi new file mode 100644 index 00000000..923c835a --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialTransactionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(financial_account_token:, request_options: {}) + end + + sig { override.returns({financial_account_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/loan_tape.rbi b/rbi/lib/lithic/models/financial_accounts/loan_tape.rbi new file mode 100644 index 00000000..ff53e931 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/loan_tape.rbi @@ -0,0 +1,1111 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTape < Lithic::BaseModel + # Globally unique identifier for a loan tape + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::AccountStanding) } + attr_reader :account_standing + + sig do + params( + account_standing: T.any(Lithic::Models::FinancialAccounts::LoanTape::AccountStanding, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :account_standing + + # Amount of credit available to spend in cents + sig { returns(Integer) } + attr_accessor :available_credit + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::Balances) } + attr_reader :balances + + sig { params(balances: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances, Lithic::Util::AnyHash)).void } + attr_writer :balances + + # Timestamp of when the loan tape was created + sig { returns(Time) } + attr_accessor :created + + # For prepay accounts, this is the minimum prepay balance that must be maintained. + # For charge card accounts, this is the maximum credit balance extended by a + # lender + sig { returns(Integer) } + attr_accessor :credit_limit + + # Globally unique identifier for a credit product + sig { returns(String) } + attr_accessor :credit_product_token + + # Date of transactions that this loan tape covers + sig { returns(Date) } + attr_accessor :date + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::DayTotals) } + attr_reader :day_totals + + sig do + params(day_totals: T.any(Lithic::Models::FinancialAccounts::LoanTape::DayTotals, Lithic::Util::AnyHash)) + .void + end + attr_writer :day_totals + + # Balance at the end of the day + sig { returns(Integer) } + attr_accessor :ending_balance + + # Excess credits in the form of provisional credits, payments, or purchase + # refunds. If positive, the account is in net credit state with no outstanding + # balances. An overpayment could land an account in this state + sig { returns(Integer) } + attr_accessor :excess_credits + + # Globally unique identifier for a financial account + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(T.nilable(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails)) } + attr_reader :interest_details + + sig do + params( + interest_details: T.nilable(T.any(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :interest_details + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance) } + attr_reader :minimum_payment_balance + + sig do + params( + minimum_payment_balance: T.any(Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :minimum_payment_balance + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation) } + attr_reader :payment_allocation + + sig do + params( + payment_allocation: T.any(Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :payment_allocation + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals) } + attr_reader :period_totals + + sig do + params( + period_totals: T.any(Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :period_totals + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance) } + attr_reader :previous_statement_balance + + sig do + params( + previous_statement_balance: T.any(Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :previous_statement_balance + + # Balance at the start of the day + sig { returns(Integer) } + attr_accessor :starting_balance + + # Timestamp of when the loan tape was updated + sig { returns(Time) } + attr_accessor :updated + + # Version number of the loan tape. This starts at 1 + sig { returns(Integer) } + attr_accessor :version + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::YtdTotals) } + attr_reader :ytd_totals + + sig do + params(ytd_totals: T.any(Lithic::Models::FinancialAccounts::LoanTape::YtdTotals, Lithic::Util::AnyHash)) + .void + end + attr_writer :ytd_totals + + # Interest tier to which this account belongs to + sig { returns(T.nilable(String)) } + attr_reader :tier + + sig { params(tier: String).void } + attr_writer :tier + + sig do + params( + token: String, + account_standing: T.any(Lithic::Models::FinancialAccounts::LoanTape::AccountStanding, Lithic::Util::AnyHash), + available_credit: Integer, + balances: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances, Lithic::Util::AnyHash), + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: T.any(Lithic::Models::FinancialAccounts::LoanTape::DayTotals, Lithic::Util::AnyHash), + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: T.nilable(T.any(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails, Lithic::Util::AnyHash)), + minimum_payment_balance: T.any(Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance, Lithic::Util::AnyHash), + payment_allocation: T.any(Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation, Lithic::Util::AnyHash), + period_totals: T.any(Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals, Lithic::Util::AnyHash), + previous_statement_balance: T.any(Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance, Lithic::Util::AnyHash), + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: T.any(Lithic::Models::FinancialAccounts::LoanTape::YtdTotals, Lithic::Util::AnyHash), + tier: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_standing:, + available_credit:, + balances:, + created:, + credit_limit:, + credit_product_token:, + date:, + day_totals:, + ending_balance:, + excess_credits:, + financial_account_token:, + interest_details:, + minimum_payment_balance:, + payment_allocation:, + period_totals:, + previous_statement_balance:, + starting_balance:, + updated:, + version:, + ytd_totals:, + tier: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_standing: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::Models::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::Models::FinancialAccounts::LoanTape::DayTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: T.nilable(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails), + minimum_payment_balance: Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals, + previous_statement_balance: Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::Models::FinancialAccounts::LoanTape::YtdTotals, + tier: String + } + ) + end + def to_hash + end + + class AccountStanding < Lithic::BaseModel + # Number of consecutive full payments made + sig { returns(Integer) } + attr_accessor :consecutive_full_payments_made + + # Number of consecutive minimum payments made + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_made + + # Number of consecutive minimum payments missed + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_missed + + # Number of days past due + sig { returns(Integer) } + attr_accessor :days_past_due + + # Information about the financial account state + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState) } + attr_reader :financial_account_state + + sig do + params( + financial_account_state: T.any( + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :financial_account_state + + # Whether the account currently has grace or not + sig { returns(T::Boolean) } + attr_accessor :has_grace + + # Current overall period number + sig { returns(Integer) } + attr_accessor :period_number + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol) } + attr_accessor :period_state + + sig do + params( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: T.any( + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + Lithic::Util::AnyHash + ), + has_grace: T::Boolean, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::OrSymbol + ) + .returns(T.attached_class) + end + def self.new( + consecutive_full_payments_made:, + consecutive_minimum_payments_made:, + consecutive_minimum_payments_missed:, + days_past_due:, + financial_account_state:, + has_grace:, + period_number:, + period_state: + ) + end + + sig do + override + .returns( + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + has_grace: T::Boolean, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol + } + ) + end + def to_hash + end + + class FinancialAccountState < Lithic::BaseModel + # Status of the financial account + sig do + returns( + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the financial account status change + sig do + returns( + T.nilable( + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + ) + end + attr_accessor :status_change_reason + + # Information about the financial account state + sig do + params( + status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::OrSymbol, + status_change_reason: T.nilable( + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::OrSymbol + ) + ) + .returns(T.attached_class) + end + def self.new(status:, status_change_reason: nil) + end + + sig do + override + .returns( + { + status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol, + status_change_reason: T.nilable( + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # Status of the financial account + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + end + + OPEN = + T.let( + :OPEN, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + SUSPENDED = + T.let( + :SUSPENDED, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + end + + CHARGED_OFF_DELINQUENT = + T.let( + :CHARGED_OFF_DELINQUENT, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + CHARGED_OFF_FRAUD = + T.let( + :CHARGED_OFF_FRAUD, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + BANK_REQUEST = + T.let( + :BANK_REQUEST, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module PeriodState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol) } + + STANDARD = + T.let(:STANDARD, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol) + PROMO = + T.let(:PROMO, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol) + PENALTY = + T.let(:PENALTY, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol]) + end + def self.values + end + end + end + + class Balances < Lithic::BaseModel + # Amount due for the prior billing cycle. Any amounts not fully paid off on this + # due date will be considered past due the next day + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::Balances::Due) } + attr_reader :due + + sig { params(due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::Due, Lithic::Util::AnyHash)).void } + attr_writer :due + + # Amount due for the current billing cycle. Any amounts not paid off by early + # payments or credits will be considered due at the end of the current billing + # period + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue) } + attr_reader :next_statement_due + + sig do + params( + next_statement_due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :next_statement_due + + # Amount not paid off on previous due dates + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue) } + attr_reader :past_due + + sig do + params( + past_due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :past_due + + # Amount due for the past billing cycles. + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue) } + attr_reader :past_statements_due + + sig do + params( + past_statements_due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :past_statements_due + + sig do + params( + due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::Due, Lithic::Util::AnyHash), + next_statement_due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue, Lithic::Util::AnyHash), + past_due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue, Lithic::Util::AnyHash), + past_statements_due: T.any(Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(due:, next_statement_due:, past_due:, past_statements_due:) + end + + sig do + override + .returns( + { + due: Lithic::Models::FinancialAccounts::LoanTape::Balances::Due, + next_statement_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue, + past_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue, + past_statements_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue + } + ) + end + def to_hash + end + + class Due < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :fees + + sig { returns(Integer) } + attr_accessor :interest + + sig { returns(Integer) } + attr_accessor :principal + + # Amount due for the prior billing cycle. Any amounts not fully paid off on this + # due date will be considered past due the next day + sig { params(fees: Integer, interest: Integer, principal: Integer).returns(T.attached_class) } + def self.new(fees:, interest:, principal:) + end + + sig { override.returns({fees: Integer, interest: Integer, principal: Integer}) } + def to_hash + end + end + + class NextStatementDue < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :fees + + sig { returns(Integer) } + attr_accessor :interest + + sig { returns(Integer) } + attr_accessor :principal + + # Amount due for the current billing cycle. Any amounts not paid off by early + # payments or credits will be considered due at the end of the current billing + # period + sig { params(fees: Integer, interest: Integer, principal: Integer).returns(T.attached_class) } + def self.new(fees:, interest:, principal:) + end + + sig { override.returns({fees: Integer, interest: Integer, principal: Integer}) } + def to_hash + end + end + + class PastDue < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :fees + + sig { returns(Integer) } + attr_accessor :interest + + sig { returns(Integer) } + attr_accessor :principal + + # Amount not paid off on previous due dates + sig { params(fees: Integer, interest: Integer, principal: Integer).returns(T.attached_class) } + def self.new(fees:, interest:, principal:) + end + + sig { override.returns({fees: Integer, interest: Integer, principal: Integer}) } + def to_hash + end + end + + class PastStatementsDue < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :fees + + sig { returns(Integer) } + attr_accessor :interest + + sig { returns(Integer) } + attr_accessor :principal + + # Amount due for the past billing cycles. + sig { params(fees: Integer, interest: Integer, principal: Integer).returns(T.attached_class) } + def self.new(fees:, interest:, principal:) + end + + sig { override.returns({fees: Integer, interest: Integer, principal: Integer}) } + def to_hash + end + end + end + + class DayTotals < Lithic::BaseModel + # Opening balance transferred from previous account in cents + sig { returns(Integer) } + attr_accessor :balance_transfers + + # ATM and cashback transactions in cents + sig { returns(Integer) } + attr_accessor :cash_advances + + # Volume of credit management operation transactions less any balance transfers in + # cents + sig { returns(Integer) } + attr_accessor :credits + + # Volume of debit management operation transactions less any interest in cents + sig { returns(Integer) } + attr_accessor :fees + + # Interest accrued in cents + sig { returns(Integer) } + attr_accessor :interest + + # Any funds transfers which affective the balance in cents + sig { returns(Integer) } + attr_accessor :payments + + # Net card transaction volume less any cash advances in cents + sig { returns(Integer) } + attr_accessor :purchases + + sig do + params( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) + .returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:) + end + + sig do + override + .returns( + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + ) + end + def to_hash + end + end + + class InterestDetails < Lithic::BaseModel + sig { returns(T.nilable(Integer)) } + attr_accessor :actual_interest_charged + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts) } + attr_reader :daily_balance_amounts + + sig do + params( + daily_balance_amounts: T.any( + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :daily_balance_amounts + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr) } + attr_reader :effective_apr + + sig do + params( + effective_apr: T.any(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :effective_apr + + sig do + returns( + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + end + attr_accessor :interest_calculation_method + + sig { returns(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod) } + attr_reader :interest_for_period + + sig do + params( + interest_for_period: T.any( + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :interest_for_period + + sig { returns(T.nilable(String)) } + attr_accessor :prime_rate + + sig { returns(T.nilable(Integer)) } + attr_accessor :minimum_interest_charged + + sig do + params( + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: T.any( + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts, + Lithic::Util::AnyHash + ), + effective_apr: T.any(Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr, Lithic::Util::AnyHash), + interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::OrSymbol, + interest_for_period: T.any( + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod, + Lithic::Util::AnyHash + ), + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + ) + .returns(T.attached_class) + end + def self.new( + actual_interest_charged:, + daily_balance_amounts:, + effective_apr:, + interest_calculation_method:, + interest_for_period:, + prime_rate:, + minimum_interest_charged: nil + ) + end + + sig do + override + .returns( + { + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts, + effective_apr: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr, + interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol, + interest_for_period: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod, + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + } + ) + end + def to_hash + end + + class DailyBalanceAmounts < Lithic::BaseModel + sig { returns(String) } + attr_accessor :balance_transfers + + sig { returns(String) } + attr_accessor :cash_advances + + sig { returns(String) } + attr_accessor :purchases + + sig do + params( + balance_transfers: String, + cash_advances: String, + purchases: String + ).returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, purchases:) + end + + sig { override.returns({balance_transfers: String, cash_advances: String, purchases: String}) } + def to_hash + end + end + + class EffectiveApr < Lithic::BaseModel + sig { returns(String) } + attr_accessor :balance_transfers + + sig { returns(String) } + attr_accessor :cash_advances + + sig { returns(String) } + attr_accessor :purchases + + sig do + params( + balance_transfers: String, + cash_advances: String, + purchases: String + ).returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, purchases:) + end + + sig { override.returns({balance_transfers: String, cash_advances: String, purchases: String}) } + def to_hash + end + end + + module InterestCalculationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + end + + DAILY = + T.let( + :DAILY, + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + AVERAGE_DAILY = + T.let( + :AVERAGE_DAILY, + Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol] + ) + end + def self.values + end + end + + class InterestForPeriod < Lithic::BaseModel + sig { returns(String) } + attr_accessor :balance_transfers + + sig { returns(String) } + attr_accessor :cash_advances + + sig { returns(String) } + attr_accessor :purchases + + sig do + params( + balance_transfers: String, + cash_advances: String, + purchases: String + ).returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, purchases:) + end + + sig { override.returns({balance_transfers: String, cash_advances: String, purchases: String}) } + def to_hash + end + end + end + + class MinimumPaymentBalance < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Integer) } + attr_accessor :remaining + + sig { params(amount: Integer, remaining: Integer).returns(T.attached_class) } + def self.new(amount:, remaining:) + end + + sig { override.returns({amount: Integer, remaining: Integer}) } + def to_hash + end + end + + class PaymentAllocation < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :fees + + sig { returns(Integer) } + attr_accessor :interest + + sig { returns(Integer) } + attr_accessor :principal + + sig { params(fees: Integer, interest: Integer, principal: Integer).returns(T.attached_class) } + def self.new(fees:, interest:, principal:) + end + + sig { override.returns({fees: Integer, interest: Integer, principal: Integer}) } + def to_hash + end + end + + class PeriodTotals < Lithic::BaseModel + # Opening balance transferred from previous account in cents + sig { returns(Integer) } + attr_accessor :balance_transfers + + # ATM and cashback transactions in cents + sig { returns(Integer) } + attr_accessor :cash_advances + + # Volume of credit management operation transactions less any balance transfers in + # cents + sig { returns(Integer) } + attr_accessor :credits + + # Volume of debit management operation transactions less any interest in cents + sig { returns(Integer) } + attr_accessor :fees + + # Interest accrued in cents + sig { returns(Integer) } + attr_accessor :interest + + # Any funds transfers which affective the balance in cents + sig { returns(Integer) } + attr_accessor :payments + + # Net card transaction volume less any cash advances in cents + sig { returns(Integer) } + attr_accessor :purchases + + sig do + params( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) + .returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:) + end + + sig do + override + .returns( + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + ) + end + def to_hash + end + end + + class PreviousStatementBalance < Lithic::BaseModel + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Integer) } + attr_accessor :remaining + + sig { params(amount: Integer, remaining: Integer).returns(T.attached_class) } + def self.new(amount:, remaining:) + end + + sig { override.returns({amount: Integer, remaining: Integer}) } + def to_hash + end + end + + class YtdTotals < Lithic::BaseModel + # Opening balance transferred from previous account in cents + sig { returns(Integer) } + attr_accessor :balance_transfers + + # ATM and cashback transactions in cents + sig { returns(Integer) } + attr_accessor :cash_advances + + # Volume of credit management operation transactions less any balance transfers in + # cents + sig { returns(Integer) } + attr_accessor :credits + + # Volume of debit management operation transactions less any interest in cents + sig { returns(Integer) } + attr_accessor :fees + + # Interest accrued in cents + sig { returns(Integer) } + attr_accessor :interest + + # Any funds transfers which affective the balance in cents + sig { returns(Integer) } + attr_accessor :payments + + # Net card transaction volume less any cash advances in cents + sig { returns(Integer) } + attr_accessor :purchases + + sig do + params( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) + .returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:) + end + + sig do + override + .returns( + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/loan_tape_list_params.rbi b/rbi/lib/lithic/models/financial_accounts/loan_tape_list_params.rbi new file mode 100644 index 00000000..2e64e4db --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/loan_tape_list_params.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTapeListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :begin_ + + sig { params(begin_: Date).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :end_ + + sig { params(end_: Date).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rbi b/rbi/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rbi new file mode 100644 index 00000000..48f590f1 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTapeRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(financial_account_token:, request_options: {}) + end + + sig { override.returns({financial_account_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/statement.rbi b/rbi/lib/lithic/models/financial_accounts/statement.rbi new file mode 100644 index 00000000..f604ff33 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/statement.rbi @@ -0,0 +1,852 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class Statement < Lithic::BaseModel + # Globally unique identifier for a statement + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Models::FinancialAccounts::Statement::AccountStanding) } + attr_reader :account_standing + + sig do + params( + account_standing: T.any(Lithic::Models::FinancialAccounts::Statement::AccountStanding, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :account_standing + + sig { returns(Lithic::Models::FinancialAccounts::Statement::AmountDue) } + attr_reader :amount_due + + sig do + params(amount_due: T.any(Lithic::Models::FinancialAccounts::Statement::AmountDue, Lithic::Util::AnyHash)) + .void + end + attr_writer :amount_due + + # Amount of credit available to spend in cents + sig { returns(Integer) } + attr_accessor :available_credit + + # Timestamp of when the statement was created + sig { returns(Time) } + attr_accessor :created + + # This is the maximum credit balance extended by the lender in cents + sig { returns(Integer) } + attr_accessor :credit_limit + + # Globally unique identifier for a credit product + sig { returns(String) } + attr_accessor :credit_product_token + + # Number of days in the billing cycle + sig { returns(Integer) } + attr_accessor :days_in_billing_cycle + + # Balance at the end of the billing period. For charge cards, this should be the + # same at the statement amount due in cents + sig { returns(Integer) } + attr_accessor :ending_balance + + # Globally unique identifier for a financial account + sig { returns(String) } + attr_accessor :financial_account_token + + # Date when the payment is due + sig { returns(T.nilable(Date)) } + attr_accessor :payment_due_date + + sig { returns(Lithic::Models::FinancialAccounts::Statement::PeriodTotals) } + attr_reader :period_totals + + sig do + params( + period_totals: T.any(Lithic::Models::FinancialAccounts::Statement::PeriodTotals, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :period_totals + + # Balance at the start of the billing period + sig { returns(Integer) } + attr_accessor :starting_balance + + # Date when the billing period ended + sig { returns(Date) } + attr_accessor :statement_end_date + + # Date when the billing period began + sig { returns(Date) } + attr_accessor :statement_start_date + + sig { returns(Lithic::Models::FinancialAccounts::Statement::StatementType::TaggedSymbol) } + attr_accessor :statement_type + + # Timestamp of when the statement was updated + sig { returns(Time) } + attr_accessor :updated + + sig { returns(Lithic::Models::FinancialAccounts::Statement::YtdTotals) } + attr_reader :ytd_totals + + sig do + params(ytd_totals: T.any(Lithic::Models::FinancialAccounts::Statement::YtdTotals, Lithic::Util::AnyHash)) + .void + end + attr_writer :ytd_totals + + sig { returns(T.nilable(Lithic::Models::FinancialAccounts::Statement::InterestDetails)) } + attr_reader :interest_details + + sig do + params( + interest_details: T.nilable(T.any(Lithic::Models::FinancialAccounts::Statement::InterestDetails, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :interest_details + + # Date when the next payment is due + sig { returns(T.nilable(Date)) } + attr_reader :next_payment_due_date + + sig { params(next_payment_due_date: Date).void } + attr_writer :next_payment_due_date + + # Date when the next billing period will end + sig { returns(T.nilable(Date)) } + attr_reader :next_statement_end_date + + sig { params(next_statement_end_date: Date).void } + attr_writer :next_statement_end_date + + sig do + params( + token: String, + account_standing: T.any(Lithic::Models::FinancialAccounts::Statement::AccountStanding, Lithic::Util::AnyHash), + amount_due: T.any(Lithic::Models::FinancialAccounts::Statement::AmountDue, Lithic::Util::AnyHash), + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: T.nilable(Date), + period_totals: T.any(Lithic::Models::FinancialAccounts::Statement::PeriodTotals, Lithic::Util::AnyHash), + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::StatementType::OrSymbol, + updated: Time, + ytd_totals: T.any(Lithic::Models::FinancialAccounts::Statement::YtdTotals, Lithic::Util::AnyHash), + interest_details: T.nilable(T.any(Lithic::Models::FinancialAccounts::Statement::InterestDetails, Lithic::Util::AnyHash)), + next_payment_due_date: Date, + next_statement_end_date: Date + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_standing:, + amount_due:, + available_credit:, + created:, + credit_limit:, + credit_product_token:, + days_in_billing_cycle:, + ending_balance:, + financial_account_token:, + payment_due_date:, + period_totals:, + starting_balance:, + statement_end_date:, + statement_start_date:, + statement_type:, + updated:, + ytd_totals:, + interest_details: nil, + next_payment_due_date: nil, + next_statement_end_date: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_standing: Lithic::Models::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::Models::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: T.nilable(Date), + period_totals: Lithic::Models::FinancialAccounts::Statement::PeriodTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::StatementType::TaggedSymbol, + updated: Time, + ytd_totals: Lithic::Models::FinancialAccounts::Statement::YtdTotals, + interest_details: T.nilable(Lithic::Models::FinancialAccounts::Statement::InterestDetails), + next_payment_due_date: Date, + next_statement_end_date: Date + } + ) + end + def to_hash + end + + class AccountStanding < Lithic::BaseModel + # Number of consecutive full payments made + sig { returns(Integer) } + attr_accessor :consecutive_full_payments_made + + # Number of consecutive minimum payments made + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_made + + # Number of consecutive minimum payments missed + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_missed + + # Number of days past due + sig { returns(Integer) } + attr_accessor :days_past_due + + # Information about the financial account state + sig { returns(Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState) } + attr_reader :financial_account_state + + sig do + params( + financial_account_state: T.any( + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :financial_account_state + + # Whether the account currently has grace or not + sig { returns(T::Boolean) } + attr_accessor :has_grace + + # Current overall period number + sig { returns(Integer) } + attr_accessor :period_number + + sig { returns(Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol) } + attr_accessor :period_state + + sig do + params( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: T.any( + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + Lithic::Util::AnyHash + ), + has_grace: T::Boolean, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::OrSymbol + ) + .returns(T.attached_class) + end + def self.new( + consecutive_full_payments_made:, + consecutive_minimum_payments_made:, + consecutive_minimum_payments_missed:, + days_past_due:, + financial_account_state:, + has_grace:, + period_number:, + period_state: + ) + end + + sig do + override + .returns( + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + has_grace: T::Boolean, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol + } + ) + end + def to_hash + end + + class FinancialAccountState < Lithic::BaseModel + # Status of the financial account + sig do + returns( + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the financial account status change + sig do + returns( + T.nilable( + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + ) + end + attr_accessor :status_change_reason + + # Information about the financial account state + sig do + params( + status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::OrSymbol, + status_change_reason: T.nilable( + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::OrSymbol + ) + ) + .returns(T.attached_class) + end + def self.new(status:, status_change_reason: nil) + end + + sig do + override + .returns( + { + status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol, + status_change_reason: T.nilable( + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # Status of the financial account + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + end + + OPEN = + T.let( + :OPEN, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + SUSPENDED = + T.let( + :SUSPENDED, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # Reason for the financial account status change + module StatusChangeReason + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + end + + CHARGED_OFF_DELINQUENT = + T.let( + :CHARGED_OFF_DELINQUENT, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + CHARGED_OFF_FRAUD = + T.let( + :CHARGED_OFF_FRAUD, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + BANK_REQUEST = + T.let( + :BANK_REQUEST, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::StatusChangeReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module PeriodState + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol) } + + STANDARD = + T.let(:STANDARD, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol) + PROMO = + T.let(:PROMO, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol) + PENALTY = + T.let(:PENALTY, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol] + ) + end + def self.values + end + end + end + + class AmountDue < Lithic::BaseModel + # Payment due at the end of the billing period in cents. Negative amount indicates + # something is owed. If the amount owed is positive there was a net credit. If + # auto-collections are enabled this is the amount that will be requested on the + # payment due date + sig { returns(Integer) } + attr_accessor :amount + + # Amount past due for statement in cents + sig { returns(Integer) } + attr_accessor :past_due + + sig { params(amount: Integer, past_due: Integer).returns(T.attached_class) } + def self.new(amount:, past_due:) + end + + sig { override.returns({amount: Integer, past_due: Integer}) } + def to_hash + end + end + + class PeriodTotals < Lithic::BaseModel + # Opening balance transferred from previous account in cents + sig { returns(Integer) } + attr_accessor :balance_transfers + + # ATM and cashback transactions in cents + sig { returns(Integer) } + attr_accessor :cash_advances + + # Volume of credit management operation transactions less any balance transfers in + # cents + sig { returns(Integer) } + attr_accessor :credits + + # Volume of debit management operation transactions less any interest in cents + sig { returns(Integer) } + attr_accessor :fees + + # Interest accrued in cents + sig { returns(Integer) } + attr_accessor :interest + + # Any funds transfers which affective the balance in cents + sig { returns(Integer) } + attr_accessor :payments + + # Net card transaction volume less any cash advances in cents + sig { returns(Integer) } + attr_accessor :purchases + + sig do + params( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) + .returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:) + end + + sig do + override + .returns( + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + ) + end + def to_hash + end + end + + module StatementType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::Statement::StatementType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialAccounts::Statement::StatementType::TaggedSymbol) } + + INITIAL = T.let(:INITIAL, Lithic::Models::FinancialAccounts::Statement::StatementType::TaggedSymbol) + PERIOD_END = + T.let(:PERIOD_END, Lithic::Models::FinancialAccounts::Statement::StatementType::TaggedSymbol) + FINAL = T.let(:FINAL, Lithic::Models::FinancialAccounts::Statement::StatementType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialAccounts::Statement::StatementType::TaggedSymbol]) } + def self.values + end + end + + class YtdTotals < Lithic::BaseModel + # Opening balance transferred from previous account in cents + sig { returns(Integer) } + attr_accessor :balance_transfers + + # ATM and cashback transactions in cents + sig { returns(Integer) } + attr_accessor :cash_advances + + # Volume of credit management operation transactions less any balance transfers in + # cents + sig { returns(Integer) } + attr_accessor :credits + + # Volume of debit management operation transactions less any interest in cents + sig { returns(Integer) } + attr_accessor :fees + + # Interest accrued in cents + sig { returns(Integer) } + attr_accessor :interest + + # Any funds transfers which affective the balance in cents + sig { returns(Integer) } + attr_accessor :payments + + # Net card transaction volume less any cash advances in cents + sig { returns(Integer) } + attr_accessor :purchases + + sig do + params( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) + .returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, credits:, fees:, interest:, payments:, purchases:) + end + + sig do + override + .returns( + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + ) + end + def to_hash + end + end + + class InterestDetails < Lithic::BaseModel + sig { returns(T.nilable(Integer)) } + attr_accessor :actual_interest_charged + + sig { returns(Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts) } + attr_reader :daily_balance_amounts + + sig do + params( + daily_balance_amounts: T.any( + Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :daily_balance_amounts + + sig { returns(Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr) } + attr_reader :effective_apr + + sig do + params( + effective_apr: T.any(Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :effective_apr + + sig do + returns( + Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + end + attr_accessor :interest_calculation_method + + sig { returns(Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod) } + attr_reader :interest_for_period + + sig do + params( + interest_for_period: T.any( + Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :interest_for_period + + sig { returns(T.nilable(String)) } + attr_accessor :prime_rate + + sig { returns(T.nilable(Integer)) } + attr_accessor :minimum_interest_charged + + sig do + params( + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: T.any( + Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts, + Lithic::Util::AnyHash + ), + effective_apr: T.any(Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr, Lithic::Util::AnyHash), + interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::OrSymbol, + interest_for_period: T.any( + Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod, + Lithic::Util::AnyHash + ), + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + ) + .returns(T.attached_class) + end + def self.new( + actual_interest_charged:, + daily_balance_amounts:, + effective_apr:, + interest_calculation_method:, + interest_for_period:, + prime_rate:, + minimum_interest_charged: nil + ) + end + + sig do + override + .returns( + { + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts, + effective_apr: Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr, + interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol, + interest_for_period: Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod, + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + } + ) + end + def to_hash + end + + class DailyBalanceAmounts < Lithic::BaseModel + sig { returns(String) } + attr_accessor :balance_transfers + + sig { returns(String) } + attr_accessor :cash_advances + + sig { returns(String) } + attr_accessor :purchases + + sig do + params( + balance_transfers: String, + cash_advances: String, + purchases: String + ).returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, purchases:) + end + + sig { override.returns({balance_transfers: String, cash_advances: String, purchases: String}) } + def to_hash + end + end + + class EffectiveApr < Lithic::BaseModel + sig { returns(String) } + attr_accessor :balance_transfers + + sig { returns(String) } + attr_accessor :cash_advances + + sig { returns(String) } + attr_accessor :purchases + + sig do + params( + balance_transfers: String, + cash_advances: String, + purchases: String + ).returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, purchases:) + end + + sig { override.returns({balance_transfers: String, cash_advances: String, purchases: String}) } + def to_hash + end + end + + module InterestCalculationMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + end + + DAILY = + T.let( + :DAILY, + Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + AVERAGE_DAILY = + T.let( + :AVERAGE_DAILY, + Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol] + ) + end + def self.values + end + end + + class InterestForPeriod < Lithic::BaseModel + sig { returns(String) } + attr_accessor :balance_transfers + + sig { returns(String) } + attr_accessor :cash_advances + + sig { returns(String) } + attr_accessor :purchases + + sig do + params( + balance_transfers: String, + cash_advances: String, + purchases: String + ).returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, purchases:) + end + + sig { override.returns({balance_transfers: String, cash_advances: String, purchases: String}) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/statement_list_params.rbi b/rbi/lib/lithic/models/financial_accounts/statement_list_params.rbi new file mode 100644 index 00000000..1e18874a --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/statement_list_params.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class StatementListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :begin_ + + sig { params(begin_: Date).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :end_ + + sig { params(end_: Date).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Whether to include the initial statement. It is not included by default. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_initial_statements + + sig { params(include_initial_statements: T::Boolean).void } + attr_writer :include_initial_statements + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + end_: nil, + ending_before: nil, + include_initial_statements: nil, + page_size: nil, + starting_after: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/statement_retrieve_params.rbi b/rbi/lib/lithic/models/financial_accounts/statement_retrieve_params.rbi new file mode 100644 index 00000000..95c94857 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/statement_retrieve_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class StatementRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(financial_account_token:, request_options: {}) + end + + sig { override.returns({financial_account_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/statements.rbi b/rbi/lib/lithic/models/financial_accounts/statements.rbi new file mode 100644 index 00000000..cc79a71c --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/statements.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountsStatements < Lithic::BaseModel + sig { returns(T::Array[Lithic::Models::FinancialAccounts::Statement]) } + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: T::Array[T.any(Lithic::Models::FinancialAccounts::Statement, Lithic::Util::AnyHash)], + has_more: T::Boolean + ) + .returns(T.attached_class) + end + def self.new(data:, has_more:) + end + + sig { override.returns({data: T::Array[Lithic::Models::FinancialAccounts::Statement], has_more: T::Boolean}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/statements/line_item_list_params.rbi b/rbi/lib/lithic/models/financial_accounts/statements/line_item_list_params.rbi new file mode 100644 index 00000000..427c21ad --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/statements/line_item_list_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + module Statements + class LineItemListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + financial_account_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(financial_account_token:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + financial_account_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/financial_accounts/statements/statement_line_items.rbi b/rbi/lib/lithic/models/financial_accounts/statements/statement_line_items.rbi new file mode 100644 index 00000000..ec813bf0 --- /dev/null +++ b/rbi/lib/lithic/models/financial_accounts/statements/statement_line_items.rbi @@ -0,0 +1,573 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + module Statements + class StatementLineItems < Lithic::BaseModel + sig { returns(T::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data]) } + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: T::Array[T.any(Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data, Lithic::Util::AnyHash)], + has_more: T::Boolean + ) + .returns(T.attached_class) + end + def self.new(data:, has_more:) + end + + sig do + override + .returns( + { + data: T::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data], + has_more: T::Boolean + } + ) + end + def to_hash + end + + class Data < Lithic::BaseModel + # Globally unique identifier for a Statement Line Item + sig { returns(String) } + attr_accessor :token + + # Transaction amount in cents + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol) } + attr_accessor :category + + # Timestamp of when the line item was generated + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + sig { returns(String) } + attr_accessor :currency + + # Date that the transaction effected the account balance + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol) } + attr_accessor :event_type + + # Globally unique identifier for a financial account + sig { returns(String) } + attr_accessor :financial_account_token + + # Globally unique identifier for a financial transaction event + sig { returns(String) } + attr_accessor :financial_transaction_event_token + + # Globally unique identifier for a financial transaction + sig { returns(String) } + attr_accessor :financial_transaction_token + + # Globally unique identifier for a card + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + sig { returns(T.nilable(String)) } + attr_reader :descriptor + + sig { params(descriptor: String).void } + attr_writer :descriptor + + sig do + params( + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::OrSymbol, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::OrSymbol, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: String, + descriptor: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + amount:, + category:, + created:, + currency:, + effective_date:, + event_type:, + financial_account_token:, + financial_transaction_event_token:, + financial_transaction_token:, + card_token: nil, + descriptor: nil + ) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: String, + descriptor: String + } + ) + end + def to_hash + end + + module Category + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + end + + ACH = + T.let( + :ACH, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + CARD = + T.let( + :CARD, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_ACH = + T.let( + :EXTERNAL_ACH, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_WIRE = + T.let( + :EXTERNAL_WIRE, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol] + ) + end + def self.values + end + end + + module EventType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + end + + ACH_ORIGINATION_CANCELLED = + T.let( + :ACH_ORIGINATION_CANCELLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_INITIATED = + T.let( + :ACH_ORIGINATION_INITIATED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_PROCESSED = + T.let( + :ACH_ORIGINATION_PROCESSED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_RELEASED = + T.let( + :ACH_ORIGINATION_RELEASED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_REVIEWED = + T.let( + :ACH_ORIGINATION_REVIEWED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_SETTLED = + T.let( + :ACH_ORIGINATION_SETTLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RECEIPT_PROCESSED = + T.let( + :ACH_RECEIPT_PROCESSED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RECEIPT_SETTLED = + T.let( + :ACH_RECEIPT_SETTLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RETURN_INITIATED = + T.let( + :ACH_RETURN_INITIATED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RETURN_PROCESSED = + T.let( + :ACH_RETURN_PROCESSED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RETURN_SETTLED = + T.let( + :ACH_RETURN_SETTLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION_ADVICE = + T.let( + :AUTHORIZATION_ADVICE, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION_EXPIRY = + T.let( + :AUTHORIZATION_EXPIRY, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION_REVERSAL = + T.let( + :AUTHORIZATION_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + BALANCE_INQUIRY = + T.let( + :BALANCE_INQUIRY, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + BILLING_ERROR = + T.let( + :BILLING_ERROR, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + BILLING_ERROR_REVERSAL = + T.let( + :BILLING_ERROR_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CARD_TO_CARD = + T.let( + :CARD_TO_CARD, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CASH_BACK = + T.let( + :CASH_BACK, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CASH_BACK_REVERSAL = + T.let( + :CASH_BACK_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CLEARING = + T.let( + :CLEARING, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CORRECTION_CREDIT = + T.let( + :CORRECTION_CREDIT, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CORRECTION_DEBIT = + T.let( + :CORRECTION_DEBIT, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CREDIT_AUTHORIZATION = + T.let( + :CREDIT_AUTHORIZATION, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CREDIT_AUTHORIZATION_ADVICE = + T.let( + :CREDIT_AUTHORIZATION_ADVICE, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CURRENCY_CONVERSION = + T.let( + :CURRENCY_CONVERSION, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CURRENCY_CONVERSION_REVERSAL = + T.let( + :CURRENCY_CONVERSION_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + DISPUTE_WON = + T.let( + :DISPUTE_WON, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_CANCELED = + T.let( + :EXTERNAL_ACH_CANCELED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_INITIATED = + T.let( + :EXTERNAL_ACH_INITIATED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_RELEASED = + T.let( + :EXTERNAL_ACH_RELEASED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_REVERSED = + T.let( + :EXTERNAL_ACH_REVERSED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_SETTLED = + T.let( + :EXTERNAL_ACH_SETTLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_CANCELED = + T.let( + :EXTERNAL_CHECK_CANCELED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_INITIATED = + T.let( + :EXTERNAL_CHECK_INITIATED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_RELEASED = + T.let( + :EXTERNAL_CHECK_RELEASED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_REVERSED = + T.let( + :EXTERNAL_CHECK_REVERSED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_SETTLED = + T.let( + :EXTERNAL_CHECK_SETTLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_CANCELED = + T.let( + :EXTERNAL_TRANSFER_CANCELED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_INITIATED = + T.let( + :EXTERNAL_TRANSFER_INITIATED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_RELEASED = + T.let( + :EXTERNAL_TRANSFER_RELEASED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_REVERSED = + T.let( + :EXTERNAL_TRANSFER_REVERSED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_SETTLED = + T.let( + :EXTERNAL_TRANSFER_SETTLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_CANCELED = + T.let( + :EXTERNAL_WIRE_CANCELED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_INITIATED = + T.let( + :EXTERNAL_WIRE_INITIATED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_RELEASED = + T.let( + :EXTERNAL_WIRE_RELEASED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_REVERSED = + T.let( + :EXTERNAL_WIRE_REVERSED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_SETTLED = + T.let( + :EXTERNAL_WIRE_SETTLED, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + INTEREST = + T.let( + :INTEREST, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + INTEREST_REVERSAL = + T.let( + :INTEREST_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + INTERNAL_ADJUSTMENT = + T.let( + :INTERNAL_ADJUSTMENT, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + LATE_PAYMENT = + T.let( + :LATE_PAYMENT, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + LATE_PAYMENT_REVERSAL = + T.let( + :LATE_PAYMENT_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + PROVISIONAL_CREDIT = + T.let( + :PROVISIONAL_CREDIT, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + PROVISIONAL_CREDIT_REVERSAL = + T.let( + :PROVISIONAL_CREDIT_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURN = + T.let( + :RETURN, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURN_REVERSAL = + T.let( + :RETURN_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + TRANSFER_INSUFFICIENT_FUNDS = + T.let( + :TRANSFER_INSUFFICIENT_FUNDS, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURNED_PAYMENT = + T.let( + :RETURNED_PAYMENT, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURNED_PAYMENT_REVERSAL = + T.let( + :RETURNED_PAYMENT_REVERSAL, + Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + + StatementLineItems = Statements::StatementLineItems + end + end +end diff --git a/rbi/lib/lithic/models/financial_transaction.rbi b/rbi/lib/lithic/models/financial_transaction.rbi new file mode 100644 index 00000000..176abb7e --- /dev/null +++ b/rbi/lib/lithic/models/financial_transaction.rbi @@ -0,0 +1,403 @@ +# typed: strong + +module Lithic + module Models + class FinancialTransaction < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + sig { returns(Lithic::Models::FinancialTransaction::Category::TaggedSymbol) } + attr_accessor :category + + # Date and time when the financial transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + sig { returns(String) } + attr_accessor :currency + + # A string that provides a description of the financial transaction; may be useful + # to display to users. + sig { returns(String) } + attr_accessor :descriptor + + # A list of all financial events that have modified this financial transaction. + sig { returns(T::Array[Lithic::Models::FinancialTransaction::Event]) } + attr_accessor :events + + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + sig { returns(Integer) } + attr_accessor :pending_amount + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + sig { returns(Lithic::Models::FinancialTransaction::Result::TaggedSymbol) } + attr_accessor :result + + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents), including any acquirer fees. This may change over time. + sig { returns(Integer) } + attr_accessor :settled_amount + + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + sig { returns(Lithic::Models::FinancialTransaction::Status::TaggedSymbol) } + attr_accessor :status + + # Date and time when the financial transaction was last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig do + params( + token: String, + category: Lithic::Models::FinancialTransaction::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[T.any(Lithic::Models::FinancialTransaction::Event, Lithic::Util::AnyHash)], + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::Status::OrSymbol, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + token:, + category:, + created:, + currency:, + descriptor:, + events:, + pending_amount:, + result:, + settled_amount:, + status:, + updated: + ) + end + + sig do + override + .returns( + { + token: String, + category: Lithic::Models::FinancialTransaction::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::Models::FinancialTransaction::Event], + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialTransaction::Category) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::FinancialTransaction::Category::TaggedSymbol) } + + ACH = T.let(:ACH, Lithic::Models::FinancialTransaction::Category::TaggedSymbol) + CARD = T.let(:CARD, Lithic::Models::FinancialTransaction::Category::TaggedSymbol) + INTERNAL = T.let(:INTERNAL, Lithic::Models::FinancialTransaction::Category::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Lithic::Models::FinancialTransaction::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialTransaction::Category::TaggedSymbol]) } + def self.values + end + end + + class Event < Lithic::BaseModel + # Globally unique identifier. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # Date and time when the financial event occurred. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + sig { returns(T.nilable(Lithic::Models::FinancialTransaction::Event::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::FinancialTransaction::Event::Result::OrSymbol).void } + attr_writer :result + + sig { returns(T.nilable(Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::FinancialTransaction::Event::Type::OrSymbol).void } + attr_writer :type + + sig do + params( + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::FinancialTransaction::Event::Result::OrSymbol, + type: Lithic::Models::FinancialTransaction::Event::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(token: nil, amount: nil, created: nil, result: nil, type: nil) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::FinancialTransaction::Event::Result::TaggedSymbol, + type: Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialTransaction::Event::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialTransaction::Event::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::FinancialTransaction::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::FinancialTransaction::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialTransaction::Event::Result::TaggedSymbol]) } + def self.values + end + end + + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialTransaction::Event::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) } + + ACH_ORIGINATION_CANCELLED = + T.let(:ACH_ORIGINATION_CANCELLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_ORIGINATION_INITIATED = + T.let(:ACH_ORIGINATION_INITIATED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_ORIGINATION_PROCESSED = + T.let(:ACH_ORIGINATION_PROCESSED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_ORIGINATION_RELEASED = + T.let(:ACH_ORIGINATION_RELEASED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_ORIGINATION_REVIEWED = + T.let(:ACH_ORIGINATION_REVIEWED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_ORIGINATION_SETTLED = + T.let(:ACH_ORIGINATION_SETTLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_RECEIPT_PROCESSED = + T.let(:ACH_RECEIPT_PROCESSED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_RECEIPT_SETTLED = + T.let(:ACH_RECEIPT_SETTLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_RETURN_INITIATED = + T.let(:ACH_RETURN_INITIATED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_RETURN_PROCESSED = + T.let(:ACH_RETURN_PROCESSED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + ACH_RETURN_SETTLED = + T.let(:ACH_RETURN_SETTLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + AUTHORIZATION = T.let(:AUTHORIZATION, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + AUTHORIZATION_ADVICE = + T.let(:AUTHORIZATION_ADVICE, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + AUTHORIZATION_EXPIRY = + T.let(:AUTHORIZATION_EXPIRY, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + AUTHORIZATION_REVERSAL = + T.let(:AUTHORIZATION_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + BALANCE_INQUIRY = + T.let(:BALANCE_INQUIRY, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + BILLING_ERROR = T.let(:BILLING_ERROR, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + BILLING_ERROR_REVERSAL = + T.let(:BILLING_ERROR_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CARD_TO_CARD = T.let(:CARD_TO_CARD, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CASH_BACK = T.let(:CASH_BACK, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CASH_BACK_REVERSAL = + T.let(:CASH_BACK_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CLEARING = T.let(:CLEARING, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CORRECTION_CREDIT = + T.let(:CORRECTION_CREDIT, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CORRECTION_DEBIT = + T.let(:CORRECTION_DEBIT, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CREDIT_AUTHORIZATION = + T.let(:CREDIT_AUTHORIZATION, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CREDIT_AUTHORIZATION_ADVICE = + T.let(:CREDIT_AUTHORIZATION_ADVICE, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CURRENCY_CONVERSION = + T.let(:CURRENCY_CONVERSION, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + CURRENCY_CONVERSION_REVERSAL = + T.let(:CURRENCY_CONVERSION_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + DISPUTE_WON = T.let(:DISPUTE_WON, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_ACH_CANCELED = + T.let(:EXTERNAL_ACH_CANCELED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_ACH_INITIATED = + T.let(:EXTERNAL_ACH_INITIATED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_ACH_RELEASED = + T.let(:EXTERNAL_ACH_RELEASED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_ACH_REVERSED = + T.let(:EXTERNAL_ACH_REVERSED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_ACH_SETTLED = + T.let(:EXTERNAL_ACH_SETTLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_CANCELED = + T.let(:EXTERNAL_CHECK_CANCELED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_INITIATED = + T.let(:EXTERNAL_CHECK_INITIATED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_RELEASED = + T.let(:EXTERNAL_CHECK_RELEASED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_REVERSED = + T.let(:EXTERNAL_CHECK_REVERSED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_SETTLED = + T.let(:EXTERNAL_CHECK_SETTLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_CANCELED = + T.let(:EXTERNAL_TRANSFER_CANCELED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_INITIATED = + T.let(:EXTERNAL_TRANSFER_INITIATED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_RELEASED = + T.let(:EXTERNAL_TRANSFER_RELEASED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_REVERSED = + T.let(:EXTERNAL_TRANSFER_REVERSED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_SETTLED = + T.let(:EXTERNAL_TRANSFER_SETTLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_CANCELED = + T.let(:EXTERNAL_WIRE_CANCELED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_INITIATED = + T.let(:EXTERNAL_WIRE_INITIATED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_RELEASED = + T.let(:EXTERNAL_WIRE_RELEASED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_REVERSED = + T.let(:EXTERNAL_WIRE_REVERSED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_SETTLED = + T.let(:EXTERNAL_WIRE_SETTLED, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + FINANCIAL_AUTHORIZATION = + T.let(:FINANCIAL_AUTHORIZATION, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let(:FINANCIAL_CREDIT_AUTHORIZATION, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + INTEREST = T.let(:INTEREST, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + INTEREST_REVERSAL = + T.let(:INTEREST_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + INTERNAL_ADJUSTMENT = + T.let(:INTERNAL_ADJUSTMENT, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + LATE_PAYMENT = T.let(:LATE_PAYMENT, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + LATE_PAYMENT_REVERSAL = + T.let(:LATE_PAYMENT_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + PROVISIONAL_CREDIT = + T.let(:PROVISIONAL_CREDIT, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + PROVISIONAL_CREDIT_REVERSAL = + T.let(:PROVISIONAL_CREDIT_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + RETURN = T.let(:RETURN, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + RETURN_REVERSAL = + T.let(:RETURN_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + TRANSFER_INSUFFICIENT_FUNDS = + T.let(:TRANSFER_INSUFFICIENT_FUNDS, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + RETURNED_PAYMENT = + T.let(:RETURNED_PAYMENT, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + RETURNED_PAYMENT_REVERSAL = + T.let(:RETURNED_PAYMENT_REVERSAL, Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialTransaction::Event::Type::TaggedSymbol]) } + def self.values + end + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialTransaction::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::FinancialTransaction::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::FinancialTransaction::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::FinancialTransaction::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialTransaction::Result::TaggedSymbol]) } + def self.values + end + end + + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::FinancialTransaction::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::FinancialTransaction::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::FinancialTransaction::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Models::FinancialTransaction::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::FinancialTransaction::Status::TaggedSymbol) + RETURNED = T.let(:RETURNED, Lithic::Models::FinancialTransaction::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::FinancialTransaction::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Models::FinancialTransaction::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::FinancialTransaction::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/instance_financial_account_type.rbi b/rbi/lib/lithic/models/instance_financial_account_type.rbi new file mode 100644 index 00000000..f4e5b93a --- /dev/null +++ b/rbi/lib/lithic/models/instance_financial_account_type.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Lithic + module Models + # Type of instance financial account + module InstanceFinancialAccountType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::InstanceFinancialAccountType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::InstanceFinancialAccountType::TaggedSymbol) } + + ISSUING = T.let(:ISSUING, Lithic::Models::InstanceFinancialAccountType::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::Models::InstanceFinancialAccountType::TaggedSymbol) + OPERATING = T.let(:OPERATING, Lithic::Models::InstanceFinancialAccountType::TaggedSymbol) + CHARGED_OFF_FEES = T.let(:CHARGED_OFF_FEES, Lithic::Models::InstanceFinancialAccountType::TaggedSymbol) + CHARGED_OFF_INTEREST = + T.let(:CHARGED_OFF_INTEREST, Lithic::Models::InstanceFinancialAccountType::TaggedSymbol) + CHARGED_OFF_PRINCIPAL = + T.let(:CHARGED_OFF_PRINCIPAL, Lithic::Models::InstanceFinancialAccountType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::InstanceFinancialAccountType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/lib/lithic/models/kyb.rbi b/rbi/lib/lithic/models/kyb.rbi new file mode 100644 index 00000000..1466b17f --- /dev/null +++ b/rbi/lib/lithic/models/kyb.rbi @@ -0,0 +1,464 @@ +# typed: strong + +module Lithic + module Models + class KYB < Lithic::BaseModel + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background. If no business owner is an entity, pass in an + # empty list. However, either this parameter or `beneficial_owner_individuals` + # must be populated. on entities that should be included. + sig { returns(T::Array[Lithic::Models::KYB::BeneficialOwnerEntity]) } + attr_accessor :beneficial_owner_entities + + # List of all direct and indirect individuals with >25% ownership in the company. + # If no entity or individual owns >25% of the company, and the largest shareholder + # is an individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. If no + # individual is an entity, pass in an empty list. However, either this parameter + # or `beneficial_owner_entities` must be populated. + sig { returns(T::Array[Lithic::Models::KYB::BeneficialOwnerIndividual]) } + attr_accessor :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(Lithic::Models::KYB::BusinessEntity) } + attr_reader :business_entity + + sig { params(business_entity: T.any(Lithic::Models::KYB::BusinessEntity, Lithic::Util::AnyHash)).void } + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig { returns(Lithic::Models::KYB::ControlPerson) } + attr_reader :control_person + + sig { params(control_person: T.any(Lithic::Models::KYB::ControlPerson, Lithic::Util::AnyHash)).void } + attr_writer :control_person + + # Short description of the company's line of business (i.e., what does the company + # do?). + sig { returns(String) } + attr_accessor :nature_of_business + + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + sig { returns(String) } + attr_accessor :tos_timestamp + + # Specifies the type of KYB workflow to run. + sig { returns(Lithic::Models::KYB::Workflow::OrSymbol) } + attr_accessor :workflow + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + sig { returns(T.nilable(String)) } + attr_reader :kyb_passed_timestamp + + sig { params(kyb_passed_timestamp: String).void } + attr_writer :kyb_passed_timestamp + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::KYB::BeneficialOwnerEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::KYB::BeneficialOwnerIndividual, Lithic::Util::AnyHash)], + business_entity: T.any(Lithic::Models::KYB::BusinessEntity, Lithic::Util::AnyHash), + control_person: T.any(Lithic::Models::KYB::ControlPerson, Lithic::Util::AnyHash), + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::KYB::Workflow::OrSymbol, + external_id: String, + kyb_passed_timestamp: String, + website_url: String + ) + .returns(T.attached_class) + end + def self.new( + beneficial_owner_entities:, + beneficial_owner_individuals:, + business_entity:, + control_person:, + nature_of_business:, + tos_timestamp:, + workflow:, + external_id: nil, + kyb_passed_timestamp: nil, + website_url: nil + ) + end + + sig do + override + .returns( + { + beneficial_owner_entities: T::Array[Lithic::Models::KYB::BeneficialOwnerEntity], + beneficial_owner_individuals: T::Array[Lithic::Models::KYB::BeneficialOwnerIndividual], + business_entity: Lithic::Models::KYB::BusinessEntity, + control_person: Lithic::Models::KYB::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::KYB::Workflow::OrSymbol, + external_id: String, + kyb_passed_timestamp: String, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerEntity < Lithic::BaseModel + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + government_id:, + legal_business_name:, + phone_numbers:, + dba_business_name: nil, + parent_company: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + } + ) + end + def to_hash + end + end + + class BeneficialOwnerIndividual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Individuals associated with a KYB application. Phone number is optional. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class BusinessEntity < Lithic::BaseModel + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # Information for business for which the account is being opened and KYB is being + # run. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + government_id:, + legal_business_name:, + phone_numbers:, + dba_business_name: nil, + parent_company: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Specifies the type of KYB workflow to run. + module Workflow + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::KYB::Workflow) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::KYB::Workflow::TaggedSymbol) } + + KYB_BASIC = T.let(:KYB_BASIC, Lithic::Models::KYB::Workflow::TaggedSymbol) + KYB_BYO = T.let(:KYB_BYO, Lithic::Models::KYB::Workflow::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::KYB::Workflow::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/kyb_business_entity.rbi b/rbi/lib/lithic/models/kyb_business_entity.rbi new file mode 100644 index 00000000..0bc63229 --- /dev/null +++ b/rbi/lib/lithic/models/kyb_business_entity.rbi @@ -0,0 +1,146 @@ +# typed: strong + +module Lithic + module Models + class KYBBusinessEntity < Lithic::BaseModel + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::KYBBusinessEntity::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::KYBBusinessEntity::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + sig do + params( + address: T.any(Lithic::Models::KYBBusinessEntity::Address, Lithic::Util::AnyHash), + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + government_id:, + legal_business_name:, + phone_numbers:, + dba_business_name: nil, + parent_company: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::KYBBusinessEntity::Address, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + } + ) + end + def to_hash + end + + class Address < Lithic::BaseModel + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ) + .returns(T.attached_class) + end + def self.new(address1:, city:, country:, postal_code:, state:, address2: nil) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/kyc.rbi b/rbi/lib/lithic/models/kyc.rbi new file mode 100644 index 00000000..53dae428 --- /dev/null +++ b/rbi/lib/lithic/models/kyc.rbi @@ -0,0 +1,158 @@ +# typed: strong + +module Lithic + module Models + class KYC < Lithic::BaseModel + # Information on individual for whom the account is being opened and KYC is being + # run. + sig { returns(Lithic::Models::KYC::Individual) } + attr_reader :individual + + sig { params(individual: T.any(Lithic::Models::KYC::Individual, Lithic::Util::AnyHash)).void } + attr_writer :individual + + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + sig { returns(String) } + attr_accessor :tos_timestamp + + # Specifies the type of KYC workflow to run. + sig { returns(Lithic::Models::KYC::Workflow::OrSymbol) } + attr_accessor :workflow + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + sig { returns(T.nilable(String)) } + attr_reader :kyc_passed_timestamp + + sig { params(kyc_passed_timestamp: String).void } + attr_writer :kyc_passed_timestamp + + sig do + params( + individual: T.any(Lithic::Models::KYC::Individual, Lithic::Util::AnyHash), + tos_timestamp: String, + workflow: Lithic::Models::KYC::Workflow::OrSymbol, + external_id: String, + kyc_passed_timestamp: String + ) + .returns(T.attached_class) + end + def self.new(individual:, tos_timestamp:, workflow:, external_id: nil, kyc_passed_timestamp: nil) + end + + sig do + override + .returns( + { + individual: Lithic::Models::KYC::Individual, + tos_timestamp: String, + workflow: Lithic::Models::KYC::Workflow::OrSymbol, + external_id: String, + kyc_passed_timestamp: String + } + ) + end + def to_hash + end + + class Individual < Lithic::BaseModel + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Information on individual for whom the account is being opened and KYC is being + # run. + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number:) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Specifies the type of KYC workflow to run. + module Workflow + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::KYC::Workflow) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::KYC::Workflow::TaggedSymbol) } + + KYC_BASIC = T.let(:KYC_BASIC, Lithic::Models::KYC::Workflow::TaggedSymbol) + KYC_BYO = T.let(:KYC_BYO, Lithic::Models::KYC::Workflow::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::KYC::Workflow::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/kyc_exempt.rbi b/rbi/lib/lithic/models/kyc_exempt.rbi new file mode 100644 index 00000000..f0e9c1d4 --- /dev/null +++ b/rbi/lib/lithic/models/kyc_exempt.rbi @@ -0,0 +1,131 @@ +# typed: strong + +module Lithic + module Models + class KYCExempt < Lithic::BaseModel + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Models::Address) } + attr_reader :address + + sig { params(address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash)).void } + attr_writer :address + + # The KYC Exempt user's email + sig { returns(String) } + attr_accessor :email + + # The KYC Exempt user's first name + sig { returns(String) } + attr_accessor :first_name + + # Specifies the type of KYC Exempt user + sig { returns(Lithic::Models::KYCExempt::KYCExemptionType::OrSymbol) } + attr_accessor :kyc_exemption_type + + # The KYC Exempt user's last name + sig { returns(String) } + attr_accessor :last_name + + # The KYC Exempt user's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + sig { returns(Lithic::Models::KYCExempt::Workflow::OrSymbol) } + attr_accessor :workflow + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + sig do + params( + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::KYCExempt::KYCExemptionType::OrSymbol, + last_name: String, + phone_number: String, + workflow: Lithic::Models::KYCExempt::Workflow::OrSymbol, + business_account_token: String, + external_id: String + ) + .returns(T.attached_class) + end + def self.new( + address:, + email:, + first_name:, + kyc_exemption_type:, + last_name:, + phone_number:, + workflow:, + business_account_token: nil, + external_id: nil + ) + end + + sig do + override + .returns( + { + address: Lithic::Models::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::KYCExempt::KYCExemptionType::OrSymbol, + last_name: String, + phone_number: String, + workflow: Lithic::Models::KYCExempt::Workflow::OrSymbol, + business_account_token: String, + external_id: String + } + ) + end + def to_hash + end + + # Specifies the type of KYC Exempt user + module KYCExemptionType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::KYCExempt::KYCExemptionType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::KYCExempt::KYCExemptionType::TaggedSymbol) } + + AUTHORIZED_USER = T.let(:AUTHORIZED_USER, Lithic::Models::KYCExempt::KYCExemptionType::TaggedSymbol) + PREPAID_CARD_USER = T.let(:PREPAID_CARD_USER, Lithic::Models::KYCExempt::KYCExemptionType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::KYCExempt::KYCExemptionType::TaggedSymbol]) } + def self.values + end + end + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + module Workflow + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::KYCExempt::Workflow) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::KYCExempt::Workflow::TaggedSymbol) } + + KYC_EXEMPT = T.let(:KYC_EXEMPT, Lithic::Models::KYCExempt::Workflow::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::KYCExempt::Workflow::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/management_operation_create_params.rbi b/rbi/lib/lithic/models/management_operation_create_params.rbi new file mode 100644 index 00000000..e8787ea0 --- /dev/null +++ b/rbi/lib/lithic/models/management_operation_create_params.rbi @@ -0,0 +1,190 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::Models::ManagementOperationCreateParams::Category::OrSymbol) } + attr_accessor :category + + sig { returns(Lithic::Models::ManagementOperationCreateParams::Direction::OrSymbol) } + attr_accessor :direction + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(Lithic::Models::ManagementOperationCreateParams::EventType::OrSymbol) } + attr_accessor :event_type + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig { returns(T.nilable(String)) } + attr_reader :subtype + + sig { params(subtype: String).void } + attr_writer :subtype + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::Category::OrSymbol, + direction: Lithic::Models::ManagementOperationCreateParams::Direction::OrSymbol, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::EventType::OrSymbol, + financial_account_token: String, + token: String, + memo: String, + subtype: String, + user_defined_id: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + amount:, + category:, + direction:, + effective_date:, + event_type:, + financial_account_token:, + token: nil, + memo: nil, + subtype: nil, + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::Category::OrSymbol, + direction: Lithic::Models::ManagementOperationCreateParams::Direction::OrSymbol, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::EventType::OrSymbol, + financial_account_token: String, + token: String, + memo: String, + subtype: String, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationCreateParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationCreateParams::Category::TaggedSymbol) } + + MANAGEMENT_FEE = + T.let(:MANAGEMENT_FEE, Lithic::Models::ManagementOperationCreateParams::Category::TaggedSymbol) + MANAGEMENT_DISPUTE = + T.let(:MANAGEMENT_DISPUTE, Lithic::Models::ManagementOperationCreateParams::Category::TaggedSymbol) + MANAGEMENT_REWARD = + T.let(:MANAGEMENT_REWARD, Lithic::Models::ManagementOperationCreateParams::Category::TaggedSymbol) + MANAGEMENT_ADJUSTMENT = + T.let(:MANAGEMENT_ADJUSTMENT, Lithic::Models::ManagementOperationCreateParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationCreateParams::Category::TaggedSymbol]) } + def self.values + end + end + + module Direction + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationCreateParams::Direction) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationCreateParams::Direction::TaggedSymbol) } + + CREDIT = T.let(:CREDIT, Lithic::Models::ManagementOperationCreateParams::Direction::TaggedSymbol) + DEBIT = T.let(:DEBIT, Lithic::Models::ManagementOperationCreateParams::Direction::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationCreateParams::Direction::TaggedSymbol]) } + def self.values + end + end + + module EventType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationCreateParams::EventType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) } + + CASH_BACK = T.let(:CASH_BACK, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + CURRENCY_CONVERSION = + T.let(:CURRENCY_CONVERSION, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + INTEREST = T.let(:INTEREST, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + LATE_PAYMENT = + T.let(:LATE_PAYMENT, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + BILLING_ERROR = + T.let(:BILLING_ERROR, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + PROVISIONAL_CREDIT = + T.let(:PROVISIONAL_CREDIT, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + LOSS_WRITE_OFF = + T.let(:LOSS_WRITE_OFF, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + CASH_BACK_REVERSAL = + T.let(:CASH_BACK_REVERSAL, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + CURRENCY_CONVERSION_REVERSAL = + T.let( + :CURRENCY_CONVERSION_REVERSAL, + Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + INTEREST_REVERSAL = + T.let(:INTEREST_REVERSAL, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + LATE_PAYMENT_REVERSAL = + T.let(:LATE_PAYMENT_REVERSAL, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + BILLING_ERROR_REVERSAL = + T.let(:BILLING_ERROR_REVERSAL, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + PROVISIONAL_CREDIT_REVERSAL = + T.let( + :PROVISIONAL_CREDIT_REVERSAL, + Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + RETURNED_PAYMENT = + T.let(:RETURNED_PAYMENT, Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol) + RETURNED_PAYMENT_REVERSAL = + T.let( + :RETURNED_PAYMENT_REVERSAL, + Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationCreateParams::EventType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/management_operation_list_params.rbi b/rbi/lib/lithic/models/management_operation_list_params.rbi new file mode 100644 index 00000000..64165ad7 --- /dev/null +++ b/rbi/lib/lithic/models/management_operation_list_params.rbi @@ -0,0 +1,167 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Management operation category to be returned. + sig { returns(T.nilable(Lithic::Models::ManagementOperationListParams::Category::OrSymbol)) } + attr_reader :category + + sig { params(category: Lithic::Models::ManagementOperationListParams::Category::OrSymbol).void } + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Management operation status to be returned. + sig { returns(T.nilable(Lithic::Models::ManagementOperationListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::ManagementOperationListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::Models::ManagementOperationListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::ManagementOperationListParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + business_account_token: nil, + category: nil, + end_: nil, + ending_before: nil, + financial_account_token: nil, + page_size: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ManagementOperationListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::ManagementOperationListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Management operation category to be returned. + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationListParams::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationListParams::Category::TaggedSymbol) } + + MANAGEMENT_FEE = + T.let(:MANAGEMENT_FEE, Lithic::Models::ManagementOperationListParams::Category::TaggedSymbol) + MANAGEMENT_DISPUTE = + T.let(:MANAGEMENT_DISPUTE, Lithic::Models::ManagementOperationListParams::Category::TaggedSymbol) + MANAGEMENT_REWARD = + T.let(:MANAGEMENT_REWARD, Lithic::Models::ManagementOperationListParams::Category::TaggedSymbol) + MANAGEMENT_ADJUSTMENT = + T.let(:MANAGEMENT_ADJUSTMENT, Lithic::Models::ManagementOperationListParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationListParams::Category::TaggedSymbol]) } + def self.values + end + end + + # Management operation status to be returned. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationListParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationListParams::Status::TaggedSymbol) } + + PENDING = T.let(:PENDING, Lithic::Models::ManagementOperationListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::ManagementOperationListParams::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ManagementOperationListParams::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Models::ManagementOperationListParams::Status::TaggedSymbol) + CANCELED = T.let(:CANCELED, Lithic::Models::ManagementOperationListParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationListParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/management_operation_retrieve_params.rbi b/rbi/lib/lithic/models/management_operation_retrieve_params.rbi new file mode 100644 index 00000000..11f21549 --- /dev/null +++ b/rbi/lib/lithic/models/management_operation_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/management_operation_reverse_params.rbi b/rbi/lib/lithic/models/management_operation_reverse_params.rbi new file mode 100644 index 00000000..9d0e8176 --- /dev/null +++ b/rbi/lib/lithic/models/management_operation_reverse_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationReverseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + effective_date: Date, + memo: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(effective_date:, memo: nil, request_options: {}) + end + + sig { override.returns({effective_date: Date, memo: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/management_operation_transaction.rbi b/rbi/lib/lithic/models/management_operation_transaction.rbi new file mode 100644 index 00000000..679525d5 --- /dev/null +++ b/rbi/lib/lithic/models/management_operation_transaction.rbi @@ -0,0 +1,330 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationTransaction < Lithic::BaseModel + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol) } + attr_accessor :category + + sig { returns(Time) } + attr_accessor :created + + sig { returns(String) } + attr_accessor :currency + + sig { returns(Lithic::Models::ManagementOperationTransaction::Direction::TaggedSymbol) } + attr_accessor :direction + + sig { returns(T::Array[Lithic::Models::ManagementOperationTransaction::Event]) } + attr_accessor :events + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Integer) } + attr_accessor :pending_amount + + sig { returns(Lithic::Models::ManagementOperationTransaction::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(Integer) } + attr_accessor :settled_amount + + sig { returns(Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + token: String, + category: Lithic::Models::ManagementOperationTransaction::Category::OrSymbol, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::Direction::OrSymbol, + events: T::Array[T.any(Lithic::Models::ManagementOperationTransaction::Event, Lithic::Util::AnyHash)], + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::Status::OrSymbol, + updated: Time, + user_defined_id: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + category:, + created:, + currency:, + direction:, + events:, + financial_account_token:, + pending_amount:, + result:, + settled_amount:, + status:, + updated:, + user_defined_id: nil + ) + end + + sig do + override + .returns( + { + token: String, + category: Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::Direction::TaggedSymbol, + events: T::Array[Lithic::Models::ManagementOperationTransaction::Event], + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol, + updated: Time, + user_defined_id: String + } + ) + end + def to_hash + end + + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationTransaction::Category) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol) } + + MANAGEMENT_FEE = + T.let(:MANAGEMENT_FEE, Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol) + MANAGEMENT_DISPUTE = + T.let(:MANAGEMENT_DISPUTE, Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol) + MANAGEMENT_REWARD = + T.let(:MANAGEMENT_REWARD, Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol) + MANAGEMENT_ADJUSTMENT = + T.let(:MANAGEMENT_ADJUSTMENT, Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationTransaction::Category::TaggedSymbol]) } + def self.values + end + end + + module Direction + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationTransaction::Direction) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationTransaction::Direction::TaggedSymbol) } + + CREDIT = T.let(:CREDIT, Lithic::Models::ManagementOperationTransaction::Direction::TaggedSymbol) + DEBIT = T.let(:DEBIT, Lithic::Models::ManagementOperationTransaction::Direction::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationTransaction::Direction::TaggedSymbol]) } + def self.values + end + end + + class Event < Lithic::BaseModel + sig { returns(String) } + attr_accessor :token + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created + + sig { returns(T::Array[Lithic::Models::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol]) } + attr_accessor :detailed_results + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :memo + + sig { returns(Lithic::Models::ManagementOperationTransaction::Event::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :subtype + + sig { params(subtype: String).void } + attr_writer :subtype + + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: T::Array[Lithic::Models::ManagementOperationTransaction::Event::DetailedResult::OrSymbol], + effective_date: Date, + memo: String, + result: Lithic::Models::ManagementOperationTransaction::Event::Result::OrSymbol, + type: Lithic::Models::ManagementOperationTransaction::Event::Type::OrSymbol, + subtype: String + ) + .returns(T.attached_class) + end + def self.new(token:, amount:, created:, detailed_results:, effective_date:, memo:, result:, type:, subtype: nil) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: T::Array[Lithic::Models::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol], + effective_date: Date, + memo: String, + result: Lithic::Models::ManagementOperationTransaction::Event::Result::TaggedSymbol, + type: Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol, + subtype: String + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationTransaction::Event::DetailedResult) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol) } + + APPROVED = + T.let(:APPROVED, Lithic::Models::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol]) + end + def self.values + end + end + + module Result + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationTransaction::Event::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationTransaction::Event::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::ManagementOperationTransaction::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ManagementOperationTransaction::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationTransaction::Event::Result::TaggedSymbol]) } + def self.values + end + end + + module Type + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationTransaction::Event::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) } + + CASH_BACK = T.let(:CASH_BACK, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + CURRENCY_CONVERSION = + T.let(:CURRENCY_CONVERSION, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + INTEREST = T.let(:INTEREST, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + LATE_PAYMENT = + T.let(:LATE_PAYMENT, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + BILLING_ERROR = + T.let(:BILLING_ERROR, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + PROVISIONAL_CREDIT = + T.let(:PROVISIONAL_CREDIT, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + LOSS_WRITE_OFF = + T.let(:LOSS_WRITE_OFF, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + CASH_BACK_REVERSAL = + T.let(:CASH_BACK_REVERSAL, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + CURRENCY_CONVERSION_REVERSAL = + T.let( + :CURRENCY_CONVERSION_REVERSAL, + Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + INTEREST_REVERSAL = + T.let(:INTEREST_REVERSAL, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + LATE_PAYMENT_REVERSAL = + T.let(:LATE_PAYMENT_REVERSAL, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + BILLING_ERROR_REVERSAL = + T.let(:BILLING_ERROR_REVERSAL, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + PROVISIONAL_CREDIT_REVERSAL = + T.let( + :PROVISIONAL_CREDIT_REVERSAL, + Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + RETURNED_PAYMENT = + T.let(:RETURNED_PAYMENT, Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol) + RETURNED_PAYMENT_REVERSAL = + T.let( + :RETURNED_PAYMENT_REVERSAL, + Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationTransaction::Event::Type::TaggedSymbol]) } + def self.values + end + end + end + + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationTransaction::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationTransaction::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::ManagementOperationTransaction::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ManagementOperationTransaction::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationTransaction::Result::TaggedSymbol]) } + def self.values + end + end + + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ManagementOperationTransaction::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol) } + + PENDING = T.let(:PENDING, Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol) + CANCELED = T.let(:CANCELED, Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ManagementOperationTransaction::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/message_attempt.rbi b/rbi/lib/lithic/models/message_attempt.rbi new file mode 100644 index 00000000..b6b7a499 --- /dev/null +++ b/rbi/lib/lithic/models/message_attempt.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Lithic + module Models + class MessageAttempt < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + sig { returns(Time) } + attr_accessor :created + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :event_subscription_token + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :event_token + + # The response body from the event subscription's URL. + sig { returns(String) } + attr_accessor :response + + # The response status code from the event subscription's URL. + sig { returns(Integer) } + attr_accessor :response_status_code + + # The status of the event attempt. + sig { returns(Lithic::Models::MessageAttempt::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :url + + # A subscription to specific event types. + sig do + params( + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::Status::OrSymbol, + url: String + ) + .returns(T.attached_class) + end + def self.new(token:, created:, event_subscription_token:, event_token:, response:, response_status_code:, status:, url:) + end + + sig do + override + .returns( + { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::Status::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + # The status of the event attempt. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::MessageAttempt::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::MessageAttempt::Status::TaggedSymbol) } + + FAILED = T.let(:FAILED, Lithic::Models::MessageAttempt::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::MessageAttempt::Status::TaggedSymbol) + SENDING = T.let(:SENDING, Lithic::Models::MessageAttempt::Status::TaggedSymbol) + SUCCESS = T.let(:SUCCESS, Lithic::Models::MessageAttempt::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::MessageAttempt::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/owner_type.rbi b/rbi/lib/lithic/models/owner_type.rbi new file mode 100644 index 00000000..de2a1889 --- /dev/null +++ b/rbi/lib/lithic/models/owner_type.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Lithic + module Models + module OwnerType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::OwnerType) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::OwnerType::TaggedSymbol) } + + INDIVIDUAL = T.let(:INDIVIDUAL, Lithic::Models::OwnerType::TaggedSymbol) + BUSINESS = T.let(:BUSINESS, Lithic::Models::OwnerType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::OwnerType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/lib/lithic/models/payment.rbi b/rbi/lib/lithic/models/payment.rbi new file mode 100644 index 00000000..706a4786 --- /dev/null +++ b/rbi/lib/lithic/models/payment.rbi @@ -0,0 +1,486 @@ +# typed: strong + +module Lithic + module Models + class Payment < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Payment category + sig { returns(Lithic::Models::Payment::Category::TaggedSymbol) } + attr_accessor :category + + # Date and time when the payment first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the payment. + sig { returns(String) } + attr_accessor :currency + + # A string that provides a description of the payment; may be useful to display to + # users. + sig { returns(String) } + attr_accessor :descriptor + + sig { returns(Lithic::Models::Payment::Direction::TaggedSymbol) } + attr_accessor :direction + + # A list of all payment events that have modified this payment. + sig { returns(T::Array[Lithic::Models::Payment::Event]) } + attr_accessor :events + + sig { returns(T.nilable(String)) } + attr_accessor :external_bank_account_token + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Lithic::Models::Payment::Method::TaggedSymbol) } + attr_accessor :method_ + + sig { returns(Lithic::Models::Payment::MethodAttributes) } + attr_reader :method_attributes + + sig { params(method_attributes: T.any(Lithic::Models::Payment::MethodAttributes, Lithic::Util::AnyHash)).void } + attr_writer :method_attributes + + # Pending amount of the payment in the currency's smallest unit (e.g., cents). The + # value of this field will go to zero over time once the payment is settled. + sig { returns(Integer) } + attr_accessor :pending_amount + + # APPROVED payments were successful while DECLINED payments were declined by + # Lithic or returned. + sig { returns(Lithic::Models::Payment::Result::TaggedSymbol) } + attr_accessor :result + + # Amount of the payment that has been settled in the currency's smallest unit + # (e.g., cents). + sig { returns(Integer) } + attr_accessor :settled_amount + + sig { returns(Lithic::Models::Payment::Source::TaggedSymbol) } + attr_accessor :source + + # Status types: + # + # - `DECLINED` - The payment was declined. + # - `PENDING` - The payment is being processed and has yet to settle or release + # (origination debit). + # - `RETURNED` - The payment has been returned. + # - `SETTLED` - The payment is completed. + sig { returns(Lithic::Models::Payment::Status::TaggedSymbol) } + attr_accessor :status + + # Date and time when the financial transaction was last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + sig do + params( + token: String, + category: Lithic::Models::Payment::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + direction: Lithic::Models::Payment::Direction::OrSymbol, + events: T::Array[T.any(Lithic::Models::Payment::Event, Lithic::Util::AnyHash)], + external_bank_account_token: T.nilable(String), + financial_account_token: String, + method_: Lithic::Models::Payment::Method::OrSymbol, + method_attributes: T.any(Lithic::Models::Payment::MethodAttributes, Lithic::Util::AnyHash), + pending_amount: Integer, + result: Lithic::Models::Payment::Result::OrSymbol, + settled_amount: Integer, + source: Lithic::Models::Payment::Source::OrSymbol, + status: Lithic::Models::Payment::Status::OrSymbol, + updated: Time, + user_defined_id: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + token:, + category:, + created:, + currency:, + descriptor:, + direction:, + events:, + external_bank_account_token:, + financial_account_token:, + method_:, + method_attributes:, + pending_amount:, + result:, + settled_amount:, + source:, + status:, + updated:, + user_defined_id: + ) + end + + sig do + override + .returns( + { + token: String, + category: Lithic::Models::Payment::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + direction: Lithic::Models::Payment::Direction::TaggedSymbol, + events: T::Array[Lithic::Models::Payment::Event], + external_bank_account_token: T.nilable(String), + financial_account_token: String, + method_: Lithic::Models::Payment::Method::TaggedSymbol, + method_attributes: Lithic::Models::Payment::MethodAttributes, + pending_amount: Integer, + result: Lithic::Models::Payment::Result::TaggedSymbol, + settled_amount: Integer, + source: Lithic::Models::Payment::Source::TaggedSymbol, + status: Lithic::Models::Payment::Status::TaggedSymbol, + updated: Time, + user_defined_id: T.nilable(String) + } + ) + end + def to_hash + end + + # Payment category + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Category) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Category::TaggedSymbol) } + + ACH = T.let(:ACH, Lithic::Models::Payment::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Category::TaggedSymbol]) } + def self.values + end + end + + module Direction + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Direction::TaggedSymbol) } + + CREDIT = T.let(:CREDIT, Lithic::Models::Payment::Direction::TaggedSymbol) + DEBIT = T.let(:DEBIT, Lithic::Models::Payment::Direction::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Direction::TaggedSymbol]) } + def self.values + end + end + + class Event < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + sig { returns(Integer) } + attr_accessor :amount + + # Date and time when the financial event occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + sig { returns(Lithic::Models::Payment::Event::Result::TaggedSymbol) } + attr_accessor :result + + # Event types: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the fed. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + # Financial Institution. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RETURN_SETTLED` - ACH receipt return settled by the Receiving Depository + # Financial Institution. + sig { returns(Lithic::Models::Payment::Event::Type::TaggedSymbol) } + attr_accessor :type + + # More detailed reasons for the event + sig { returns(T.nilable(T::Array[Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol])) } + attr_reader :detailed_results + + sig { params(detailed_results: T::Array[Lithic::Models::Payment::Event::DetailedResult::OrSymbol]).void } + attr_writer :detailed_results + + sig do + params( + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Payment::Event::Result::OrSymbol, + type: Lithic::Models::Payment::Event::Type::OrSymbol, + detailed_results: T::Array[Lithic::Models::Payment::Event::DetailedResult::OrSymbol] + ) + .returns(T.attached_class) + end + def self.new(token:, amount:, created:, result:, type:, detailed_results: nil) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Payment::Event::Result::TaggedSymbol, + type: Lithic::Models::Payment::Event::Type::TaggedSymbol, + detailed_results: T::Array[Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol] + } + ) + end + def to_hash + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Event::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::Payment::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Payment::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Event::Result::TaggedSymbol]) } + def self.values + end + end + + # Event types: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the fed. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + # Financial Institution. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RETURN_SETTLED` - ACH receipt return settled by the Receiving Depository + # Financial Institution. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Event::Type::TaggedSymbol) } + + ACH_ORIGINATION_CANCELLED = + T.let(:ACH_ORIGINATION_CANCELLED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_ORIGINATION_INITIATED = + T.let(:ACH_ORIGINATION_INITIATED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_ORIGINATION_PROCESSED = + T.let(:ACH_ORIGINATION_PROCESSED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_ORIGINATION_SETTLED = + T.let(:ACH_ORIGINATION_SETTLED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_ORIGINATION_RELEASED = + T.let(:ACH_ORIGINATION_RELEASED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_ORIGINATION_REVIEWED = + T.let(:ACH_ORIGINATION_REVIEWED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_RECEIPT_PROCESSED = T.let(:ACH_RECEIPT_PROCESSED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_RECEIPT_SETTLED = T.let(:ACH_RECEIPT_SETTLED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_RETURN_INITIATED = T.let(:ACH_RETURN_INITIATED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_RETURN_PROCESSED = T.let(:ACH_RETURN_PROCESSED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + ACH_RETURN_SETTLED = T.let(:ACH_RETURN_SETTLED, Lithic::Models::Payment::Event::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Event::Type::TaggedSymbol]) } + def self.values + end + end + + module DetailedResult + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Event::DetailedResult) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol) + FUNDS_INSUFFICIENT = + T.let(:FUNDS_INSUFFICIENT, Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol) + ACCOUNT_INVALID = T.let(:ACCOUNT_INVALID, Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol) + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = + T.let(:PROGRAM_TRANSACTION_LIMIT_EXCEEDED, Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol) + PROGRAM_DAILY_LIMIT_EXCEEDED = + T.let(:PROGRAM_DAILY_LIMIT_EXCEEDED, Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol) + PROGRAM_MONTHLY_LIMIT_EXCEEDED = + T.let(:PROGRAM_MONTHLY_LIMIT_EXCEEDED, Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Event::DetailedResult::TaggedSymbol]) } + def self.values + end + end + end + + module Method + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Method) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Method::TaggedSymbol) } + + ACH_NEXT_DAY = T.let(:ACH_NEXT_DAY, Lithic::Models::Payment::Method::TaggedSymbol) + ACH_SAME_DAY = T.let(:ACH_SAME_DAY, Lithic::Models::Payment::Method::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Method::TaggedSymbol]) } + def self.values + end + end + + class MethodAttributes < Lithic::BaseModel + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + sig { returns(T.nilable(String)) } + attr_accessor :receipt_routing_number + + sig { returns(T.nilable(Integer)) } + attr_accessor :retries + + sig { returns(T.nilable(String)) } + attr_accessor :return_reason_code + + sig { returns(Lithic::Models::Payment::MethodAttributes::SecCode::TaggedSymbol) } + attr_accessor :sec_code + + sig { returns(T::Array[T.nilable(String)]) } + attr_accessor :trace_numbers + + sig do + params( + company_id: T.nilable(String), + receipt_routing_number: T.nilable(String), + retries: T.nilable(Integer), + return_reason_code: T.nilable(String), + sec_code: Lithic::Models::Payment::MethodAttributes::SecCode::OrSymbol, + trace_numbers: T::Array[T.nilable(String)] + ) + .returns(T.attached_class) + end + def self.new(company_id:, receipt_routing_number:, retries:, return_reason_code:, sec_code:, trace_numbers:) + end + + sig do + override + .returns( + { + company_id: T.nilable(String), + receipt_routing_number: T.nilable(String), + retries: T.nilable(Integer), + return_reason_code: T.nilable(String), + sec_code: Lithic::Models::Payment::MethodAttributes::SecCode::TaggedSymbol, + trace_numbers: T::Array[T.nilable(String)] + } + ) + end + def to_hash + end + + module SecCode + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::MethodAttributes::SecCode) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Payment::MethodAttributes::SecCode::TaggedSymbol) } + + CCD = T.let(:CCD, Lithic::Models::Payment::MethodAttributes::SecCode::TaggedSymbol) + PPD = T.let(:PPD, Lithic::Models::Payment::MethodAttributes::SecCode::TaggedSymbol) + WEB = T.let(:WEB, Lithic::Models::Payment::MethodAttributes::SecCode::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::MethodAttributes::SecCode::TaggedSymbol]) } + def self.values + end + end + end + + # APPROVED payments were successful while DECLINED payments were declined by + # Lithic or returned. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::Payment::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Payment::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Result::TaggedSymbol]) } + def self.values + end + end + + module Source + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Source) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Source::TaggedSymbol) } + + CUSTOMER = T.let(:CUSTOMER, Lithic::Models::Payment::Source::TaggedSymbol) + LITHIC = T.let(:LITHIC, Lithic::Models::Payment::Source::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Source::TaggedSymbol]) } + def self.values + end + end + + # Status types: + # + # - `DECLINED` - The payment was declined. + # - `PENDING` - The payment is being processed and has yet to settle or release + # (origination debit). + # - `RETURNED` - The payment has been returned. + # - `SETTLED` - The payment is completed. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Payment::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Payment::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::Payment::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::Payment::Status::TaggedSymbol) + RETURNED = T.let(:RETURNED, Lithic::Models::Payment::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::Payment::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Payment::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_create_params.rbi b/rbi/lib/lithic/models/payment_create_params.rbi new file mode 100644 index 00000000..8811fc50 --- /dev/null +++ b/rbi/lib/lithic/models/payment_create_params.rbi @@ -0,0 +1,166 @@ +# typed: strong + +module Lithic + module Models + class PaymentCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Lithic::Models::PaymentCreateParams::Method::OrSymbol) } + attr_accessor :method_ + + sig { returns(Lithic::Models::PaymentCreateParams::MethodAttributes) } + attr_reader :method_attributes + + sig do + params( + method_attributes: T.any(Lithic::Models::PaymentCreateParams::MethodAttributes, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :method_attributes + + sig { returns(Lithic::Models::PaymentCreateParams::Type::OrSymbol) } + attr_accessor :type + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::Method::OrSymbol, + method_attributes: T.any(Lithic::Models::PaymentCreateParams::MethodAttributes, Lithic::Util::AnyHash), + type: Lithic::Models::PaymentCreateParams::Type::OrSymbol, + token: String, + memo: String, + user_defined_id: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + amount:, + external_bank_account_token:, + financial_account_token:, + method_:, + method_attributes:, + type:, + token: nil, + memo: nil, + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::Method::OrSymbol, + method_attributes: Lithic::Models::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::Type::OrSymbol, + token: String, + memo: String, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Method + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentCreateParams::Method) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::PaymentCreateParams::Method::TaggedSymbol) } + + ACH_NEXT_DAY = T.let(:ACH_NEXT_DAY, Lithic::Models::PaymentCreateParams::Method::TaggedSymbol) + ACH_SAME_DAY = T.let(:ACH_SAME_DAY, Lithic::Models::PaymentCreateParams::Method::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentCreateParams::Method::TaggedSymbol]) } + def self.values + end + end + + class MethodAttributes < Lithic::BaseModel + sig { returns(Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::OrSymbol) } + attr_accessor :sec_code + + sig do + params(sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::OrSymbol) + .returns(T.attached_class) + end + def self.new(sec_code:) + end + + sig { override.returns({sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::OrSymbol}) } + def to_hash + end + + module SecCode + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol) } + + CCD = T.let(:CCD, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol) + PPD = T.let(:PPD, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol) + WEB = T.let(:WEB, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol]) } + def self.values + end + end + end + + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::PaymentCreateParams::Type::TaggedSymbol) } + + COLLECTION = T.let(:COLLECTION, Lithic::Models::PaymentCreateParams::Type::TaggedSymbol) + PAYMENT = T.let(:PAYMENT, Lithic::Models::PaymentCreateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentCreateParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_create_response.rbi b/rbi/lib/lithic/models/payment_create_response.rbi new file mode 100644 index 00000000..f0d84794 --- /dev/null +++ b/rbi/lib/lithic/models/payment_create_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class PaymentCreateResponse < Lithic::Models::Payment + # Balance + sig { returns(T.nilable(Lithic::Models::Balance)) } + attr_reader :balance + + sig { params(balance: T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)).void } + attr_writer :balance + + sig { params(balance: T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)).returns(T.attached_class) } + def self.new(balance: nil) + end + + sig { override.returns({balance: Lithic::Models::Balance}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_list_params.rbi b/rbi/lib/lithic/models/payment_list_params.rbi new file mode 100644 index 00000000..3c0ac7df --- /dev/null +++ b/rbi/lib/lithic/models/payment_list_params.rbi @@ -0,0 +1,183 @@ +# typed: strong + +module Lithic + module Models + class PaymentListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + sig { returns(T.nilable(Lithic::Models::PaymentListParams::Category::OrSymbol)) } + attr_reader :category + + sig { params(category: Lithic::Models::PaymentListParams::Category::OrSymbol).void } + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + sig { returns(T.nilable(Lithic::Models::PaymentListParams::Result::OrSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::PaymentListParams::Result::OrSymbol).void } + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig { returns(T.nilable(Lithic::Models::PaymentListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::PaymentListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::PaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::PaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::PaymentListParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + begin_: nil, + business_account_token: nil, + category: nil, + end_: nil, + ending_before: nil, + financial_account_token: nil, + page_size: nil, + result: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::PaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::PaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::PaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentListParams::Category) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::PaymentListParams::Category::TaggedSymbol) } + + ACH = T.let(:ACH, Lithic::Models::PaymentListParams::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentListParams::Category::TaggedSymbol]) } + def self.values + end + end + + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentListParams::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::PaymentListParams::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::PaymentListParams::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::PaymentListParams::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentListParams::Result::TaggedSymbol]) } + def self.values + end + end + + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::PaymentListParams::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::PaymentListParams::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::PaymentListParams::Status::TaggedSymbol) + RETURNED = T.let(:RETURNED, Lithic::Models::PaymentListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::PaymentListParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentListParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_retrieve_params.rbi b/rbi/lib/lithic/models/payment_retrieve_params.rbi new file mode 100644 index 00000000..0f75f8cf --- /dev/null +++ b/rbi/lib/lithic/models/payment_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class PaymentRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_retry_params.rbi b/rbi/lib/lithic/models/payment_retry_params.rbi new file mode 100644 index 00000000..6168d6f9 --- /dev/null +++ b/rbi/lib/lithic/models/payment_retry_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class PaymentRetryParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_retry_response.rbi b/rbi/lib/lithic/models/payment_retry_response.rbi new file mode 100644 index 00000000..4cf19529 --- /dev/null +++ b/rbi/lib/lithic/models/payment_retry_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class PaymentRetryResponse < Lithic::Models::Payment + # Balance + sig { returns(T.nilable(Lithic::Models::Balance)) } + attr_reader :balance + + sig { params(balance: T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)).void } + attr_writer :balance + + sig { params(balance: T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)).returns(T.attached_class) } + def self.new(balance: nil) + end + + sig { override.returns({balance: Lithic::Models::Balance}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_action_params.rbi b/rbi/lib/lithic/models/payment_simulate_action_params.rbi new file mode 100644 index 00000000..a9f75695 --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_action_params.rbi @@ -0,0 +1,113 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateActionParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Event Type + sig { returns(Lithic::Models::PaymentSimulateActionParams::EventType::OrSymbol) } + attr_accessor :event_type + + # Decline reason + sig { returns(T.nilable(Lithic::Models::PaymentSimulateActionParams::DeclineReason::OrSymbol)) } + attr_reader :decline_reason + + sig { params(decline_reason: Lithic::Models::PaymentSimulateActionParams::DeclineReason::OrSymbol).void } + attr_writer :decline_reason + + # Return Reason Code + sig { returns(T.nilable(String)) } + attr_reader :return_reason_code + + sig { params(return_reason_code: String).void } + attr_writer :return_reason_code + + sig do + params( + event_type: Lithic::Models::PaymentSimulateActionParams::EventType::OrSymbol, + decline_reason: Lithic::Models::PaymentSimulateActionParams::DeclineReason::OrSymbol, + return_reason_code: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(event_type:, decline_reason: nil, return_reason_code: nil, request_options: {}) + end + + sig do + override + .returns( + { + event_type: Lithic::Models::PaymentSimulateActionParams::EventType::OrSymbol, + decline_reason: Lithic::Models::PaymentSimulateActionParams::DeclineReason::OrSymbol, + return_reason_code: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Event Type + module EventType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentSimulateActionParams::EventType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) } + + ACH_ORIGINATION_REVIEWED = + T.let(:ACH_ORIGINATION_REVIEWED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + ACH_ORIGINATION_RELEASED = + T.let(:ACH_ORIGINATION_RELEASED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + ACH_ORIGINATION_PROCESSED = + T.let(:ACH_ORIGINATION_PROCESSED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + ACH_ORIGINATION_SETTLED = + T.let(:ACH_ORIGINATION_SETTLED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + ACH_RECEIPT_SETTLED = + T.let(:ACH_RECEIPT_SETTLED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + ACH_RETURN_INITIATED = + T.let(:ACH_RETURN_INITIATED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + ACH_RETURN_PROCESSED = + T.let(:ACH_RETURN_PROCESSED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + ACH_RETURN_SETTLED = + T.let(:ACH_RETURN_SETTLED, Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentSimulateActionParams::EventType::TaggedSymbol]) } + def self.values + end + end + + # Decline reason + module DeclineReason + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason::TaggedSymbol) } + + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = + T.let( + :PROGRAM_TRANSACTION_LIMIT_EXCEEDED, + Lithic::Models::PaymentSimulateActionParams::DeclineReason::TaggedSymbol + ) + PROGRAM_DAILY_LIMIT_EXCEEDED = + T.let( + :PROGRAM_DAILY_LIMIT_EXCEEDED, + Lithic::Models::PaymentSimulateActionParams::DeclineReason::TaggedSymbol + ) + PROGRAM_MONTHLY_LIMIT_EXCEEDED = + T.let( + :PROGRAM_MONTHLY_LIMIT_EXCEEDED, + Lithic::Models::PaymentSimulateActionParams::DeclineReason::TaggedSymbol + ) + + sig { override.returns(T::Array[Lithic::Models::PaymentSimulateActionParams::DeclineReason::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_action_response.rbi b/rbi/lib/lithic/models/payment_simulate_action_response.rbi new file mode 100644 index 00000000..d16ee5a1 --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_action_response.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateActionResponse < Lithic::BaseModel + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig { returns(Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol) } + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::Result::OrSymbol, + transaction_event_token: String + ) + .returns(T.attached_class) + end + def self.new(debugging_request_id:, result:, transaction_event_token:) + end + + sig do + override + .returns( + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentSimulateActionResponse::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_receipt_params.rbi b/rbi/lib/lithic/models/payment_simulate_receipt_params.rbi new file mode 100644 index 00000000..3d5317e3 --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_receipt_params.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReceiptParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Payment token + sig { returns(String) } + attr_accessor :token + + # Amount + sig { returns(Integer) } + attr_accessor :amount + + # Financial Account Token + sig { returns(String) } + attr_accessor :financial_account_token + + # Receipt Type + sig { returns(Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::OrSymbol) } + attr_accessor :receipt_type + + # Memo + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::OrSymbol, + memo: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::OrSymbol, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Receipt Type + module ReceiptType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::TaggedSymbol) } + + RECEIPT_CREDIT = + T.let(:RECEIPT_CREDIT, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::TaggedSymbol) + RECEIPT_DEBIT = + T.let(:RECEIPT_DEBIT, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_receipt_response.rbi b/rbi/lib/lithic/models/payment_simulate_receipt_response.rbi new file mode 100644 index 00000000..0d6768c2 --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_receipt_response.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReceiptResponse < Lithic::BaseModel + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig { returns(Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol) } + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::Result::OrSymbol, + transaction_event_token: String + ) + .returns(T.attached_class) + end + def self.new(debugging_request_id:, result:, transaction_event_token:) + end + + sig do + override + .returns( + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentSimulateReceiptResponse::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_release_params.rbi b/rbi/lib/lithic/models/payment_simulate_release_params.rbi new file mode 100644 index 00000000..91bd8556 --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_release_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReleaseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Payment Token + sig { returns(String) } + attr_accessor :payment_token + + sig do + params(payment_token: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(payment_token:, request_options: {}) + end + + sig { override.returns({payment_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_release_response.rbi b/rbi/lib/lithic/models/payment_simulate_release_response.rbi new file mode 100644 index 00000000..3fce376d --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_release_response.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReleaseResponse < Lithic::BaseModel + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig { returns(Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol) } + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::Result::OrSymbol, + transaction_event_token: String + ) + .returns(T.attached_class) + end + def self.new(debugging_request_id:, result:, transaction_event_token:) + end + + sig do + override + .returns( + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentSimulateReleaseResponse::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_return_params.rbi b/rbi/lib/lithic/models/payment_simulate_return_params.rbi new file mode 100644 index 00000000..8ea45731 --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_return_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReturnParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Payment Token + sig { returns(String) } + attr_accessor :payment_token + + # Return Reason Code + sig { returns(T.nilable(String)) } + attr_reader :return_reason_code + + sig { params(return_reason_code: String).void } + attr_writer :return_reason_code + + sig do + params( + payment_token: String, + return_reason_code: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(payment_token:, return_reason_code: nil, request_options: {}) + end + + sig do + override + .returns({ + payment_token: String, + return_reason_code: String, + request_options: Lithic::RequestOptions + }) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/payment_simulate_return_response.rbi b/rbi/lib/lithic/models/payment_simulate_return_response.rbi new file mode 100644 index 00000000..4d005bb2 --- /dev/null +++ b/rbi/lib/lithic/models/payment_simulate_return_response.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReturnResponse < Lithic::BaseModel + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig { returns(Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol) } + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::Result::OrSymbol, + transaction_event_token: String + ) + .returns(T.attached_class) + end + def self.new(debugging_request_id:, result:, transaction_event_token:) + end + + sig do + override + .returns( + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::PaymentSimulateReturnResponse::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/reports/settlement/network_total_list_params.rbi b/rbi/lib/lithic/models/reports/settlement/network_total_list_params.rbi new file mode 100644 index 00000000..599d8de7 --- /dev/null +++ b/rbi/lib/lithic/models/reports/settlement/network_total_list_params.rbi @@ -0,0 +1,176 @@ +# typed: strong + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Institution ID to filter on. + sig { returns(T.nilable(String)) } + attr_reader :institution_id + + sig { params(institution_id: String).void } + attr_writer :institution_id + + # Network to filter on. + sig { returns(T.nilable(Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol)) } + attr_reader :network + + sig { params(network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol).void } + attr_writer :network + + # Number of records per page. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + sig { returns(T.nilable(Date)) } + attr_reader :report_date + + sig { params(report_date: Date).void } + attr_writer :report_date + + # Earliest report date to filter on, inclusive (YYYY-MM-DD). + sig { returns(T.nilable(Date)) } + attr_reader :report_date_begin + + sig { params(report_date_begin: Date).void } + attr_writer :report_date_begin + + # Latest report date to filter on, inclusive (YYYY-MM-DD). + sig { returns(T.nilable(Date)) } + attr_reader :report_date_end + + sig { params(report_date_end: Date).void } + attr_writer :report_date_end + + # Settlement institution ID to filter on. + sig { returns(T.nilable(String)) } + attr_reader :settlement_institution_id + + sig { params(settlement_institution_id: String).void } + attr_writer :settlement_institution_id + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + begin_: nil, + end_: nil, + ending_before: nil, + institution_id: nil, + network: nil, + page_size: nil, + report_date: nil, + report_date_begin: nil, + report_date_end: nil, + settlement_institution_id: nil, + starting_after: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Network to filter on. + module Network + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol) } + + VISA = T.let(:VISA, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol) + MASTERCARD = + T.let(:MASTERCARD, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol) + MAESTRO = + T.let(:MAESTRO, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol) + INTERLINK = + T.let(:INTERLINK, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol]) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/reports/settlement/network_total_list_response.rbi b/rbi/lib/lithic/models/reports/settlement/network_total_list_response.rbi new file mode 100644 index 00000000..d43af12e --- /dev/null +++ b/rbi/lib/lithic/models/reports/settlement/network_total_list_response.rbi @@ -0,0 +1,196 @@ +# typed: strong + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalListResponse < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts) } + attr_reader :amounts + + sig do + params( + amounts: T.any(Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :amounts + + # RFC 3339 timestamp for when the record was created. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code. + sig { returns(String) } + attr_accessor :currency + + # The institution that activity occurred on. For Mastercard: ICA (Interbank Card + # Association). For Maestro: institution ID. For Visa: lowest level SRE + # (Settlement Reporting Entity). + sig { returns(String) } + attr_accessor :institution_id + + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + sig { returns(Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol) } + attr_accessor :network + + # Date that the network total record applies to. YYYY-MM-DD format. + sig { returns(Date) } + attr_accessor :report_date + + # The institution responsible for settlement. For Mastercard: same as + # `institution_id`. For Maestro: billing ICA. For Visa: Funds Transfer SRE + # (FTSRE). + sig { returns(String) } + attr_accessor :settlement_institution_id + + # Settlement service. + sig { returns(String) } + attr_accessor :settlement_service + + # RFC 3339 timestamp for when the record was last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + # The clearing cycle that the network total record applies to. Mastercard only. + sig { returns(T.nilable(Integer)) } + attr_reader :cycle + + sig { params(cycle: Integer).void } + attr_writer :cycle + + sig do + params( + token: String, + amounts: T.any(Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts, Lithic::Util::AnyHash), + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::OrSymbol, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + ) + .returns(T.attached_class) + end + def self.new( + token:, + amounts:, + created:, + currency:, + institution_id:, + network:, + report_date:, + settlement_institution_id:, + settlement_service:, + updated:, + cycle: nil + ) + end + + sig do + override + .returns( + { + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + } + ) + end + def to_hash + end + + class Amounts < Lithic::BaseModel + # Total settlement amount excluding interchange, in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :gross_settlement + + # Interchange amount, in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :interchange_fees + + # `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :net_settlement + + # Charges specific to Visa/Interlink, in currency's smallest unit. + sig { returns(T.nilable(Integer)) } + attr_reader :visa_charges + + sig { params(visa_charges: Integer).void } + attr_writer :visa_charges + + sig do + params( + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + ) + .returns(T.attached_class) + end + def self.new(gross_settlement:, interchange_fees:, net_settlement:, visa_charges: nil) + end + + sig do + override + .returns( + { + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + } + ) + end + def to_hash + end + end + + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + module Network + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol) } + + VISA = T.let(:VISA, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol) + MASTERCARD = + T.let(:MASTERCARD, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol) + MAESTRO = + T.let(:MAESTRO, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol) + INTERLINK = + T.let(:INTERLINK, Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network::TaggedSymbol]) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/reports/settlement/network_total_retrieve_params.rbi b/rbi/lib/lithic/models/reports/settlement/network_total_retrieve_params.rbi new file mode 100644 index 00000000..900348fe --- /dev/null +++ b/rbi/lib/lithic/models/reports/settlement/network_total_retrieve_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/reports/settlement/network_total_retrieve_response.rbi b/rbi/lib/lithic/models/reports/settlement/network_total_retrieve_response.rbi new file mode 100644 index 00000000..2da25f2e --- /dev/null +++ b/rbi/lib/lithic/models/reports/settlement/network_total_retrieve_response.rbi @@ -0,0 +1,205 @@ +# typed: strong + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalRetrieveResponse < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts) } + attr_reader :amounts + + sig do + params( + amounts: T.any(Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :amounts + + # RFC 3339 timestamp for when the record was created. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code. + sig { returns(String) } + attr_accessor :currency + + # The institution that activity occurred on. For Mastercard: ICA (Interbank Card + # Association). For Maestro: institution ID. For Visa: lowest level SRE + # (Settlement Reporting Entity). + sig { returns(String) } + attr_accessor :institution_id + + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + sig { returns(Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol) } + attr_accessor :network + + # Date that the network total record applies to. YYYY-MM-DD format. + sig { returns(Date) } + attr_accessor :report_date + + # The institution responsible for settlement. For Mastercard: same as + # `institution_id`. For Maestro: billing ICA. For Visa: Funds Transfer SRE + # (FTSRE). + sig { returns(String) } + attr_accessor :settlement_institution_id + + # Settlement service. + sig { returns(String) } + attr_accessor :settlement_service + + # RFC 3339 timestamp for when the record was last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + # The clearing cycle that the network total record applies to. Mastercard only. + sig { returns(T.nilable(Integer)) } + attr_reader :cycle + + sig { params(cycle: Integer).void } + attr_writer :cycle + + sig do + params( + token: String, + amounts: T.any(Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts, Lithic::Util::AnyHash), + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::OrSymbol, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + ) + .returns(T.attached_class) + end + def self.new( + token:, + amounts:, + created:, + currency:, + institution_id:, + network:, + report_date:, + settlement_institution_id:, + settlement_service:, + updated:, + cycle: nil + ) + end + + sig do + override + .returns( + { + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + } + ) + end + def to_hash + end + + class Amounts < Lithic::BaseModel + # Total settlement amount excluding interchange, in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :gross_settlement + + # Interchange amount, in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :interchange_fees + + # `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :net_settlement + + # Charges specific to Visa/Interlink, in currency's smallest unit. + sig { returns(T.nilable(Integer)) } + attr_reader :visa_charges + + sig { params(visa_charges: Integer).void } + attr_writer :visa_charges + + sig do + params( + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + ) + .returns(T.attached_class) + end + def self.new(gross_settlement:, interchange_fees:, net_settlement:, visa_charges: nil) + end + + sig do + override + .returns( + { + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + } + ) + end + def to_hash + end + end + + # Card network where the transaction took place. VISA, MASTERCARD, MAESTRO, or + # INTERLINK. + module Network + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol) } + + VISA = + T.let(:VISA, Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol) + MASTERCARD = + T.let( + :MASTERCARD, + Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol + ) + MAESTRO = + T.let(:MAESTRO, Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol) + INTERLINK = + T.let( + :INTERLINK, + Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/reports/settlement_list_details_params.rbi b/rbi/lib/lithic/models/reports/settlement_list_details_params.rbi new file mode 100644 index 00000000..94ebad48 --- /dev/null +++ b/rbi/lib/lithic/models/reports/settlement_list_details_params.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + module Reports + class SettlementListDetailsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + end + + sig do + override + .returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/reports/settlement_summary_params.rbi b/rbi/lib/lithic/models/reports/settlement_summary_params.rbi new file mode 100644 index 00000000..af9ffcca --- /dev/null +++ b/rbi/lib/lithic/models/reports/settlement_summary_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module Reports + class SettlementSummaryParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/required_document.rbi b/rbi/lib/lithic/models/required_document.rbi new file mode 100644 index 00000000..d26f1696 --- /dev/null +++ b/rbi/lib/lithic/models/required_document.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Lithic + module Models + class RequiredDocument < Lithic::BaseModel + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # rovides the status reasons that will be satisfied by providing one of the valid + # documents. + sig { returns(T::Array[String]) } + attr_accessor :status_reasons + + # A list of valid documents that will satisfy the KYC requirements for the + # specified entity. + sig { returns(T::Array[String]) } + attr_accessor :valid_documents + + sig do + params(entity_token: String, status_reasons: T::Array[String], valid_documents: T::Array[String]) + .returns(T.attached_class) + end + def self.new(entity_token:, status_reasons:, valid_documents:) + end + + sig do + override + .returns({ + entity_token: String, + status_reasons: T::Array[String], + valid_documents: T::Array[String] + }) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/responder_endpoint_check_status_params.rbi b/rbi/lib/lithic/models/responder_endpoint_check_status_params.rbi new file mode 100644 index 00000000..120a45d5 --- /dev/null +++ b/rbi/lib/lithic/models/responder_endpoint_check_status_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointCheckStatusParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The type of the endpoint. + sig { returns(Lithic::Models::ResponderEndpointCheckStatusParams::Type::OrSymbol) } + attr_accessor :type + + sig do + params( + type: Lithic::Models::ResponderEndpointCheckStatusParams::Type::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(type:, request_options: {}) + end + + sig do + override + .returns( + { + type: Lithic::Models::ResponderEndpointCheckStatusParams::Type::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of the endpoint. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type::TaggedSymbol) } + + AUTH_STREAM_ACCESS = + T.let(:AUTH_STREAM_ACCESS, Lithic::Models::ResponderEndpointCheckStatusParams::Type::TaggedSymbol) + THREE_DS_DECISIONING = + T.let(:THREE_DS_DECISIONING, Lithic::Models::ResponderEndpointCheckStatusParams::Type::TaggedSymbol) + TOKENIZATION_DECISIONING = + T.let(:TOKENIZATION_DECISIONING, Lithic::Models::ResponderEndpointCheckStatusParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ResponderEndpointCheckStatusParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/responder_endpoint_create_params.rbi b/rbi/lib/lithic/models/responder_endpoint_create_params.rbi new file mode 100644 index 00000000..f3c901ec --- /dev/null +++ b/rbi/lib/lithic/models/responder_endpoint_create_params.rbi @@ -0,0 +1,68 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The type of the endpoint. + sig { returns(T.nilable(Lithic::Models::ResponderEndpointCreateParams::Type::OrSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::ResponderEndpointCreateParams::Type::OrSymbol).void } + attr_writer :type + + # The URL for the responder endpoint (must be http(s)). + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + sig do + params( + type: Lithic::Models::ResponderEndpointCreateParams::Type::OrSymbol, + url: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(type: nil, url: nil, request_options: {}) + end + + sig do + override + .returns( + { + type: Lithic::Models::ResponderEndpointCreateParams::Type::OrSymbol, + url: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of the endpoint. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ResponderEndpointCreateParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ResponderEndpointCreateParams::Type::TaggedSymbol) } + + AUTH_STREAM_ACCESS = + T.let(:AUTH_STREAM_ACCESS, Lithic::Models::ResponderEndpointCreateParams::Type::TaggedSymbol) + THREE_DS_DECISIONING = + T.let(:THREE_DS_DECISIONING, Lithic::Models::ResponderEndpointCreateParams::Type::TaggedSymbol) + TOKENIZATION_DECISIONING = + T.let(:TOKENIZATION_DECISIONING, Lithic::Models::ResponderEndpointCreateParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ResponderEndpointCreateParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/responder_endpoint_create_response.rbi b/rbi/lib/lithic/models/responder_endpoint_create_response.rbi new file mode 100644 index 00000000..6d6abc9a --- /dev/null +++ b/rbi/lib/lithic/models/responder_endpoint_create_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointCreateResponse < Lithic::BaseModel + # True if the endpoint was enrolled successfully. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enrolled + + sig { params(enrolled: T::Boolean).void } + attr_writer :enrolled + + sig { params(enrolled: T::Boolean).returns(T.attached_class) } + def self.new(enrolled: nil) + end + + sig { override.returns({enrolled: T::Boolean}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/responder_endpoint_delete_params.rbi b/rbi/lib/lithic/models/responder_endpoint_delete_params.rbi new file mode 100644 index 00000000..4df894ad --- /dev/null +++ b/rbi/lib/lithic/models/responder_endpoint_delete_params.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointDeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The type of the endpoint. + sig { returns(Lithic::Models::ResponderEndpointDeleteParams::Type::OrSymbol) } + attr_accessor :type + + sig do + params( + type: Lithic::Models::ResponderEndpointDeleteParams::Type::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(type:, request_options: {}) + end + + sig do + override + .returns( + {type: Lithic::Models::ResponderEndpointDeleteParams::Type::OrSymbol, request_options: Lithic::RequestOptions} + ) + end + def to_hash + end + + # The type of the endpoint. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type::TaggedSymbol) } + + AUTH_STREAM_ACCESS = + T.let(:AUTH_STREAM_ACCESS, Lithic::Models::ResponderEndpointDeleteParams::Type::TaggedSymbol) + THREE_DS_DECISIONING = + T.let(:THREE_DS_DECISIONING, Lithic::Models::ResponderEndpointDeleteParams::Type::TaggedSymbol) + TOKENIZATION_DECISIONING = + T.let(:TOKENIZATION_DECISIONING, Lithic::Models::ResponderEndpointDeleteParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ResponderEndpointDeleteParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/responder_endpoint_status.rbi b/rbi/lib/lithic/models/responder_endpoint_status.rbi new file mode 100644 index 00000000..fff4c8e2 --- /dev/null +++ b/rbi/lib/lithic/models/responder_endpoint_status.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointStatus < Lithic::BaseModel + # True if the instance has an endpoint enrolled. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enrolled + + sig { params(enrolled: T::Boolean).void } + attr_writer :enrolled + + # The URL of the currently enrolled endpoint or null. + sig { returns(T.nilable(String)) } + attr_accessor :url + + sig { params(enrolled: T::Boolean, url: T.nilable(String)).returns(T.attached_class) } + def self.new(enrolled: nil, url: nil) + end + + sig { override.returns({enrolled: T::Boolean, url: T.nilable(String)}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/settlement_detail.rbi b/rbi/lib/lithic/models/settlement_detail.rbi new file mode 100644 index 00000000..3a367821 --- /dev/null +++ b/rbi/lib/lithic/models/settlement_detail.rbi @@ -0,0 +1,246 @@ +# typed: strong + +module Lithic + module Models + class SettlementDetail < Lithic::BaseModel + # Globally unique identifier denoting the Settlement Detail. + sig { returns(String) } + attr_accessor :token + + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + sig { returns(String) } + attr_accessor :account_token + + # Globally unique identifier denoting the card program that the associated + # Transaction occurred on. + sig { returns(String) } + attr_accessor :card_program_token + + # Globally unique identifier denoting the card that the associated Transaction + # occurred on. + sig { returns(String) } + attr_accessor :card_token + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # Three-character alphabetic ISO 4217 code. + sig { returns(String) } + attr_accessor :currency + + # The total gross amount of disputes settlements. + sig { returns(Integer) } + attr_accessor :disputes_gross_amount + + # Globally unique identifiers denoting the Events associated with this settlement. + sig { returns(T::Array[String]) } + attr_accessor :event_tokens + + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + sig { returns(String) } + attr_accessor :institution + + # The total amount of interchange in six-digit extended precision. + sig { returns(Integer) } + attr_accessor :interchange_fee_extended_precision + + # The total amount of interchange. + sig { returns(Integer) } + attr_accessor :interchange_gross_amount + + # Card network where the transaction took place. + sig { returns(Lithic::Models::SettlementDetail::Network::TaggedSymbol) } + attr_accessor :network + + # The total gross amount of other fees by type. + sig { returns(Lithic::Models::SettlementDetail::OtherFeesDetails) } + attr_reader :other_fees_details + + sig do + params( + other_fees_details: T.any(Lithic::Models::SettlementDetail::OtherFeesDetails, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :other_fees_details + + # Total amount of gross other fees outside of interchange. + sig { returns(Integer) } + attr_accessor :other_fees_gross_amount + + # Date of when the report was first generated. + sig { returns(String) } + attr_accessor :report_date + + # Date of when money movement is triggered for the transaction. + sig { returns(String) } + attr_accessor :settlement_date + + # Globally unique identifier denoting the associated Transaction object. + sig { returns(String) } + attr_accessor :transaction_token + + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + sig { returns(Integer) } + attr_accessor :transactions_gross_amount + + # The type of settlement record. + sig { returns(Lithic::Models::SettlementDetail::Type::TaggedSymbol) } + attr_accessor :type + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + # Network's description of a fee, only present on records with type `FEE`. + sig { returns(T.nilable(String)) } + attr_reader :fee_description + + sig { params(fee_description: String).void } + attr_writer :fee_description + + sig do + params( + token: String, + account_token: String, + card_program_token: String, + card_token: String, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: T::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::Network::OrSymbol, + other_fees_details: T.any(Lithic::Models::SettlementDetail::OtherFeesDetails, Lithic::Util::AnyHash), + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::Type::OrSymbol, + updated: Time, + fee_description: String + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_token:, + card_program_token:, + card_token:, + created:, + currency:, + disputes_gross_amount:, + event_tokens:, + institution:, + interchange_fee_extended_precision:, + interchange_gross_amount:, + network:, + other_fees_details:, + other_fees_gross_amount:, + report_date:, + settlement_date:, + transaction_token:, + transactions_gross_amount:, + type:, + updated:, + fee_description: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_token: String, + card_program_token: String, + card_token: String, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: T::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::Network::TaggedSymbol, + other_fees_details: Lithic::Models::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::Type::TaggedSymbol, + updated: Time, + fee_description: String + } + ) + end + def to_hash + end + + # Card network where the transaction took place. + module Network + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::SettlementDetail::Network) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::SettlementDetail::Network::TaggedSymbol) } + + INTERLINK = T.let(:INTERLINK, Lithic::Models::SettlementDetail::Network::TaggedSymbol) + MAESTRO = T.let(:MAESTRO, Lithic::Models::SettlementDetail::Network::TaggedSymbol) + MASTERCARD = T.let(:MASTERCARD, Lithic::Models::SettlementDetail::Network::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::SettlementDetail::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::Models::SettlementDetail::Network::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::SettlementDetail::Network::TaggedSymbol]) } + def self.values + end + end + + class OtherFeesDetails < Lithic::BaseModel + sig { returns(T.nilable(Integer)) } + attr_reader :isa + + sig { params(isa: Integer).void } + attr_writer :isa + + # The total gross amount of other fees by type. + sig { params(isa: Integer).returns(T.attached_class) } + def self.new(isa: nil) + end + + sig { override.returns({isa: Integer}) } + def to_hash + end + end + + # The type of settlement record. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::SettlementDetail::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::SettlementDetail::Type::TaggedSymbol) } + + ADJUSTMENT = T.let(:ADJUSTMENT, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + ARBITRATION = T.let(:ARBITRATION, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + CHARGEBACK = T.let(:CHARGEBACK, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + CLEARING = T.let(:CLEARING, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + FEE = T.let(:FEE, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + FINANCIAL = T.let(:FINANCIAL, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + NON_FINANCIAL = T.let(:"NON-FINANCIAL", Lithic::Models::SettlementDetail::Type::TaggedSymbol) + PREARBITRATION = T.let(:PREARBITRATION, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + REPRESENTMENT = T.let(:REPRESENTMENT, Lithic::Models::SettlementDetail::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::SettlementDetail::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/settlement_report.rbi b/rbi/lib/lithic/models/settlement_report.rbi new file mode 100644 index 00000000..4a61e77e --- /dev/null +++ b/rbi/lib/lithic/models/settlement_report.rbi @@ -0,0 +1,117 @@ +# typed: strong + +module Lithic + module Models + class SettlementReport < Lithic::BaseModel + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code. (This field is deprecated and will be + # removed in a future version of the API.) + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Array[Lithic::Models::SettlementSummaryDetails]) } + attr_accessor :details + + # The total gross amount of disputes settlements. (This field is deprecated and + # will be removed in a future version of the API. To compute total amounts, Lithic + # recommends that customers sum the relevant settlement amounts found within + # `details`.) + sig { returns(Integer) } + attr_accessor :disputes_gross_amount + + # The total amount of interchange. (This field is deprecated and will be removed + # in a future version of the API. To compute total amounts, Lithic recommends that + # customers sum the relevant settlement amounts found within `details`.) + sig { returns(Integer) } + attr_accessor :interchange_gross_amount + + # Indicates that all data expected on the given report date is available. + sig { returns(T::Boolean) } + attr_accessor :is_complete + + # Total amount of gross other fees outside of interchange. (This field is + # deprecated and will be removed in a future version of the API. To compute total + # amounts, Lithic recommends that customers sum the relevant settlement amounts + # found within `details`.) + sig { returns(Integer) } + attr_accessor :other_fees_gross_amount + + # Date of when the report was first generated. + sig { returns(String) } + attr_accessor :report_date + + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + sig { returns(Integer) } + attr_accessor :settled_net_amount + + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + sig { returns(Integer) } + attr_accessor :transactions_gross_amount + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig do + params( + created: Time, + currency: String, + details: T::Array[T.any(Lithic::Models::SettlementSummaryDetails, Lithic::Util::AnyHash)], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: T::Boolean, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + created:, + currency:, + details:, + disputes_gross_amount:, + interchange_gross_amount:, + is_complete:, + other_fees_gross_amount:, + report_date:, + settled_net_amount:, + transactions_gross_amount:, + updated: + ) + end + + sig do + override + .returns( + { + created: Time, + currency: String, + details: T::Array[Lithic::Models::SettlementSummaryDetails], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: T::Boolean, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/settlement_summary_details.rbi b/rbi/lib/lithic/models/settlement_summary_details.rbi new file mode 100644 index 00000000..87c00435 --- /dev/null +++ b/rbi/lib/lithic/models/settlement_summary_details.rbi @@ -0,0 +1,128 @@ +# typed: strong + +module Lithic + module Models + class SettlementSummaryDetails < Lithic::BaseModel + # 3-character alphabetic ISO 4217 code. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # The total gross amount of disputes settlements. + sig { returns(T.nilable(Integer)) } + attr_reader :disputes_gross_amount + + sig { params(disputes_gross_amount: Integer).void } + attr_writer :disputes_gross_amount + + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + sig { returns(T.nilable(String)) } + attr_reader :institution + + sig { params(institution: String).void } + attr_writer :institution + + # The total amount of interchange. + sig { returns(T.nilable(Integer)) } + attr_reader :interchange_gross_amount + + sig { params(interchange_gross_amount: Integer).void } + attr_writer :interchange_gross_amount + + # Card network where the transaction took place + sig { returns(T.nilable(Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol)) } + attr_reader :network + + sig { params(network: Lithic::Models::SettlementSummaryDetails::Network::OrSymbol).void } + attr_writer :network + + # Total amount of gross other fees outside of interchange. + sig { returns(T.nilable(Integer)) } + attr_reader :other_fees_gross_amount + + sig { params(other_fees_gross_amount: Integer).void } + attr_writer :other_fees_gross_amount + + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). + sig { returns(T.nilable(Integer)) } + attr_reader :settled_net_amount + + sig { params(settled_net_amount: Integer).void } + attr_writer :settled_net_amount + + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + sig { returns(T.nilable(Integer)) } + attr_reader :transactions_gross_amount + + sig { params(transactions_gross_amount: Integer).void } + attr_writer :transactions_gross_amount + + sig do + params( + currency: String, + disputes_gross_amount: Integer, + institution: String, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementSummaryDetails::Network::OrSymbol, + other_fees_gross_amount: Integer, + settled_net_amount: Integer, + transactions_gross_amount: Integer + ) + .returns(T.attached_class) + end + def self.new( + currency: nil, + disputes_gross_amount: nil, + institution: nil, + interchange_gross_amount: nil, + network: nil, + other_fees_gross_amount: nil, + settled_net_amount: nil, + transactions_gross_amount: nil + ) + end + + sig do + override + .returns( + { + currency: String, + disputes_gross_amount: Integer, + institution: String, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol, + other_fees_gross_amount: Integer, + settled_net_amount: Integer, + transactions_gross_amount: Integer + } + ) + end + def to_hash + end + + # Card network where the transaction took place + module Network + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::SettlementSummaryDetails::Network) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol) } + + INTERLINK = T.let(:INTERLINK, Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol) + MAESTRO = T.let(:MAESTRO, Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol) + MASTERCARD = T.let(:MASTERCARD, Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::SettlementSummaryDetails::Network::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/shipping_address.rbi b/rbi/lib/lithic/models/shipping_address.rbi new file mode 100644 index 00000000..63404786 --- /dev/null +++ b/rbi/lib/lithic/models/shipping_address.rbi @@ -0,0 +1,124 @@ +# typed: strong + +module Lithic + module Models + class ShippingAddress < Lithic::BaseModel + # Valid USPS routable address. + sig { returns(String) } + attr_accessor :address1 + + # City + sig { returns(String) } + attr_accessor :city + + # Uppercase ISO 3166-1 alpha-3 three character abbreviation. + sig { returns(String) } + attr_accessor :country + + # Customer's first name. This will be the first name printed on the physical card. + # The combined length of `first_name` and `last_name` may not exceed 25 + # characters. + sig { returns(String) } + attr_accessor :first_name + + # Customer's surname (family name). This will be the last name printed on the + # physical card. The combined length of `first_name` and `last_name` may not + # exceed 25 characters. + sig { returns(String) } + attr_accessor :last_name + + # Postal code (formerly zipcode). For US addresses, either five-digit postal code + # or nine-digit postal code (ZIP+4) using the format 12345-1234. + sig { returns(String) } + attr_accessor :postal_code + + # Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a + # limit of 24 characters for other countries. + sig { returns(String) } + attr_accessor :state + + # Unit number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Email address to be contacted for expedited shipping process purposes. Required + # if `shipping_method` is `EXPEDITED`. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Text to be printed on line two of the physical card. Use of this field requires + # additional permissions. + sig { returns(T.nilable(String)) } + attr_reader :line2_text + + sig { params(line2_text: String).void } + attr_writer :line2_text + + # Cardholder's phone number in E.164 format to be contacted for expedited shipping + # process purposes. Required if `shipping_method` is `EXPEDITED`. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address1: String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + address2: String, + email: String, + line2_text: String, + phone_number: String + ) + .returns(T.attached_class) + end + def self.new( + address1:, + city:, + country:, + first_name:, + last_name:, + postal_code:, + state:, + address2: nil, + email: nil, + line2_text: nil, + phone_number: nil + ) + end + + sig do + override + .returns( + { + address1: String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + address2: String, + email: String, + line2_text: String, + phone_number: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/spend_limit_duration.rbi b/rbi/lib/lithic/models/spend_limit_duration.rbi new file mode 100644 index 00000000..9487605b --- /dev/null +++ b/rbi/lib/lithic/models/spend_limit_duration.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + module SpendLimitDuration + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::SpendLimitDuration) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::SpendLimitDuration::TaggedSymbol) } + + ANNUALLY = T.let(:ANNUALLY, Lithic::Models::SpendLimitDuration::TaggedSymbol) + FOREVER = T.let(:FOREVER, Lithic::Models::SpendLimitDuration::TaggedSymbol) + MONTHLY = T.let(:MONTHLY, Lithic::Models::SpendLimitDuration::TaggedSymbol) + TRANSACTION = T.let(:TRANSACTION, Lithic::Models::SpendLimitDuration::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::SpendLimitDuration::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/authentication_retrieve_params.rbi b/rbi/lib/lithic/models/three_ds/authentication_retrieve_params.rbi new file mode 100644 index 00000000..8c8bf3c4 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/authentication_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/authentication_retrieve_response.rbi b/rbi/lib/lithic/models/three_ds/authentication_retrieve_response.rbi new file mode 100644 index 00000000..4a657c44 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/authentication_retrieve_response.rbi @@ -0,0 +1,1743 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationRetrieveResponse < Lithic::BaseModel + # Globally unique identifier for the 3DS authentication. + sig { returns(String) } + attr_accessor :token + + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::TaggedSymbol)) } + attr_accessor :account_type + + # Indicates the outcome of the 3DS authentication process. + sig { returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol) } + attr_accessor :authentication_result + + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + sig { returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::TaggedSymbol) } + attr_accessor :card_expiry_check + + # Globally unique identifier for the card on which the 3DS authentication has + # occurred. + sig { returns(String) } + attr_accessor :card_token + + # Object containing data about the cardholder provided during the transaction. + sig { returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder) } + attr_reader :cardholder + + sig do + params( + cardholder: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :cardholder + + # Channel in which the authentication occurs. Maps to EMV 3DS field deviceChannel. + sig { returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::TaggedSymbol) } + attr_accessor :channel + + # Date and time when the authentication was created in Lithic's system. + sig { returns(Time) } + attr_accessor :created + + # Object containing data about the merchant involved in the e-commerce + # transaction. + sig { returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant) } + attr_reader :merchant + + sig do + params( + merchant: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :merchant + + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + sig { returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory::TaggedSymbol) } + attr_accessor :message_category + + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + sig do + returns( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + end + attr_accessor :three_ds_requestor_challenge_indicator + + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData)) } + attr_reader :additional_data + + sig do + params( + additional_data: T.nilable( + T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData, Lithic::Util::AnyHash) + ) + ) + .void + end + attr_writer :additional_data + + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App)) } + attr_reader :app + + sig do + params(app: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App, Lithic::Util::AnyHash)) + .void + end + attr_writer :app + + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # threeDSRequestorAuthenticationInd. + sig do + returns( + T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + ) + end + attr_accessor :authentication_request_type + + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser)) } + attr_reader :browser + + sig do + params( + browser: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :browser + + # Metadata about the challenge method and delivery. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata)) } + attr_reader :challenge_metadata + + sig do + params( + challenge_metadata: T.nilable( + T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata, Lithic::Util::AnyHash) + ) + ) + .void + end + attr_writer :challenge_metadata + + # Entity that orchestrates the challenge. + sig do + returns( + T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::TaggedSymbol) + ) + end + attr_accessor :challenge_orchestrated_by + + # Entity that made the authentication decision. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol)) } + attr_accessor :decision_made_by + + # Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field threeRIInd. + sig do + returns( + T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol) + ) + end + attr_accessor :three_ri_request_type + + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction)) } + attr_reader :transaction + + sig do + params( + transaction: T.nilable( + T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction, Lithic::Util::AnyHash) + ) + ) + .void + end + attr_writer :transaction + + sig do + params( + token: String, + account_type: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::OrSymbol), + authentication_result: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::OrSymbol, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::OrSymbol, + card_token: String, + cardholder: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder, Lithic::Util::AnyHash), + channel: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::OrSymbol, + created: Time, + merchant: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant, Lithic::Util::AnyHash), + message_category: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory::OrSymbol, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::OrSymbol, + additional_data: T.nilable( + T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData, Lithic::Util::AnyHash) + ), + app: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App, Lithic::Util::AnyHash), + authentication_request_type: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::OrSymbol), + browser: T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser, Lithic::Util::AnyHash), + challenge_metadata: T.nilable( + T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata, Lithic::Util::AnyHash) + ), + challenge_orchestrated_by: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::OrSymbol), + decision_made_by: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::OrSymbol), + three_ri_request_type: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::OrSymbol), + transaction: T.nilable( + T.any(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction, Lithic::Util::AnyHash) + ) + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_type:, + authentication_result:, + card_expiry_check:, + card_token:, + cardholder:, + channel:, + created:, + merchant:, + message_category:, + three_ds_requestor_challenge_indicator:, + additional_data: nil, + app: nil, + authentication_request_type: nil, + browser: nil, + challenge_metadata: nil, + challenge_orchestrated_by: nil, + decision_made_by: nil, + three_ri_request_type: nil, + transaction: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_type: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::TaggedSymbol), + authentication_result: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::TaggedSymbol, + card_token: String, + cardholder: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder, + channel: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::TaggedSymbol, + created: Time, + merchant: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant, + message_category: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory::TaggedSymbol, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol, + additional_data: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData), + app: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App, + authentication_request_type: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ), + browser: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser, + challenge_metadata: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata), + challenge_orchestrated_by: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::TaggedSymbol), + decision_made_by: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol), + three_ri_request_type: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol), + transaction: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction) + } + ) + end + def to_hash + end + + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + module AccountType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::TaggedSymbol) } + + CREDIT = + T.let(:CREDIT, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::TaggedSymbol) + DEBIT = T.let(:DEBIT, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::TaggedSymbol) + NOT_APPLICABLE = + T.let(:NOT_APPLICABLE, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType::TaggedSymbol]) + end + def self.values + end + end + + # Indicates the outcome of the 3DS authentication process. + module AuthenticationResult + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol) } + + DECLINE = + T.let( + :DECLINE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol + ) + SUCCESS = + T.let( + :SUCCESS, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol + ) + PENDING_CHALLENGE = + T.let( + :PENDING_CHALLENGE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol + ) + PENDING_DECISION = + T.let( + :PENDING_DECISION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult::TaggedSymbol] + ) + end + def self.values + end + end + + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + module CardExpiryCheck + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::TaggedSymbol) } + + MATCH = + T.let(:MATCH, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::TaggedSymbol) + MISMATCH = + T.let(:MISMATCH, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::TaggedSymbol) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck::TaggedSymbol]) + end + def self.values + end + end + + class Cardholder < Lithic::BaseModel + # Indicates whether the shipping address and billing address provided by the + # cardholder are the same. This value - and assessment of whether the addresses + # match - is provided directly in the 3DS request and is not determined by Lithic. + # Maps to EMV 3DS field addrMatch. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :address_match + + # Object containing data on the billing address provided during the transaction. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress)) } + attr_reader :billing_address + + sig do + params( + billing_address: T.any( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :billing_address + + # Email address that is either provided by the cardholder or is on file with the + # merchant in a 3RI request. Maps to EMV 3DS field email. + sig { returns(T.nilable(String)) } + attr_accessor :email + + # Name of the cardholder. Maps to EMV 3DS field cardholderName. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Home phone number provided by the cardholder. Maps to EMV 3DS fields + # homePhone.cc and homePhone.subscriber. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number_home + + # Mobile/cell phone number provided by the cardholder. Maps to EMV 3DS fields + # mobilePhone.cc and mobilePhone.subscriber. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number_mobile + + # Work phone number provided by the cardholder. Maps to EMV 3DS fields + # workPhone.cc and workPhone.subscriber. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number_work + + # Object containing data on the shipping address provided during the transaction. + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress)) } + attr_reader :shipping_address + + sig do + params( + shipping_address: T.any( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :shipping_address + + # Object containing data about the cardholder provided during the transaction. + sig do + params( + address_match: T.nilable(T::Boolean), + billing_address: T.any( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress, + Lithic::Util::AnyHash + ), + email: T.nilable(String), + name: T.nilable(String), + phone_number_home: T.nilable(String), + phone_number_mobile: T.nilable(String), + phone_number_work: T.nilable(String), + shipping_address: T.any( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress, + Lithic::Util::AnyHash + ) + ) + .returns(T.attached_class) + end + def self.new( + address_match: nil, + billing_address: nil, + email: nil, + name: nil, + phone_number_home: nil, + phone_number_mobile: nil, + phone_number_work: nil, + shipping_address: nil + ) + end + + sig do + override + .returns( + { + address_match: T.nilable(T::Boolean), + billing_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress, + email: T.nilable(String), + name: T.nilable(String), + phone_number_home: T.nilable(String), + phone_number_mobile: T.nilable(String), + phone_number_work: T.nilable(String), + shipping_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress + } + ) + end + def to_hash + end + + class BillingAddress < Lithic::BaseModel + # First line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address1 + + # Second line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address2 + + # Third line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address3 + + # City of the address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code (e.g., ZIP code) of the address provided by the cardholder + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Object containing data on the billing address provided during the transaction. + sig do + params( + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(address1: nil, address2: nil, address3: nil, city: nil, country: nil, postal_code: nil) + end + + sig do + override + .returns( + { + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + } + ) + end + def to_hash + end + end + + class ShippingAddress < Lithic::BaseModel + # First line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address1 + + # Second line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address2 + + # Third line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address3 + + # City of the address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code (e.g., ZIP code) of the address provided by the cardholder + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Object containing data on the shipping address provided during the transaction. + sig do + params( + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(address1: nil, address2: nil, address3: nil, city: nil, country: nil, postal_code: nil) + end + + sig do + override + .returns( + { + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + } + ) + end + def to_hash + end + end + end + + # Channel in which the authentication occurs. Maps to EMV 3DS field deviceChannel. + module Channel + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::TaggedSymbol) } + + APP_BASED = + T.let(:APP_BASED, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::TaggedSymbol) + BROWSER = T.let(:BROWSER, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::TaggedSymbol) + THREE_DS_REQUESTOR_INITIATED = + T.let( + :THREE_DS_REQUESTOR_INITIATED, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::TaggedSymbol + ) + + sig { override.returns(T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel::TaggedSymbol]) } + def self.values + end + end + + class Merchant < Lithic::BaseModel + # Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field + # acquirerMerchantId. + sig { returns(String) } + attr_accessor :id + + # Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS + # field merchantCountryCode. + sig { returns(String) } + attr_accessor :country + + # Merchant category code assigned to the merchant that describes its business + # activity type. Maps to EMV 3DS field mcc. + sig { returns(String) } + attr_accessor :mcc + + # Name of the merchant. Maps to EMV 3DS field merchantName. + sig { returns(String) } + attr_accessor :name + + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + sig { returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator) } + attr_reader :risk_indicator + + sig do + params( + risk_indicator: T.any( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator, + Lithic::Util::AnyHash + ) + ) + .void + end + attr_writer :risk_indicator + + # Object containing data about the merchant involved in the e-commerce + # transaction. + sig do + params( + id: String, + country: String, + mcc: String, + name: String, + risk_indicator: T.any( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator, + Lithic::Util::AnyHash + ) + ) + .returns(T.attached_class) + end + def self.new(id:, country:, mcc:, name:, risk_indicator:) + end + + sig do + override + .returns( + { + id: String, + country: String, + mcc: String, + name: String, + risk_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator + } + ) + end + def to_hash + end + + class RiskIndicator < Lithic::BaseModel + # In transactions with electronic delivery, email address to which merchandise is + # delivered. Maps to EMV 3DS field deliveryEmailAddress. + sig { returns(T.nilable(String)) } + attr_accessor :delivery_email_address + + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # deliveryTimeframe. + sig do + returns( + T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + ) + end + attr_accessor :delivery_time_frame + + # In prepaid or gift card purchase transactions, purchase amount total in major + # units (e.g., a purchase of USD $205.10 would be 205). Maps to EMV 3DS field + # giftCardAmount. + sig { returns(T.nilable(Integer)) } + attr_accessor :gift_card_amount + + # In prepaid or gift card purchase transactions, count of individual prepaid or + # gift cards/codes purchased. Maps to EMV 3DS field giftCardCount. + sig { returns(T.nilable(Integer)) } + attr_accessor :gift_card_count + + # In prepaid or gift card purchase transactions, currency code of the gift card. + # Maps to EMV 3DS field giftCardCurr. + sig { returns(T.nilable(String)) } + attr_accessor :gift_card_currency + + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field preOrderPurchaseInd. + sig do + returns( + T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ) + ) + end + attr_accessor :order_availability + + # In pre-order purchase transactions, the expected date that the merchandise will + # be available. Maps to EMV 3DS field preOrderDate. + sig { returns(T.nilable(Time)) } + attr_accessor :pre_order_available_date + + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field reorderItemsInd. + sig do + returns( + T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ) + ) + end + attr_accessor :reorder_items + + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field shipIndicator. + sig do + returns( + T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + ) + end + attr_accessor :shipping_method + + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + sig do + params( + delivery_email_address: T.nilable(String), + delivery_time_frame: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::OrSymbol + ), + gift_card_amount: T.nilable(Integer), + gift_card_count: T.nilable(Integer), + gift_card_currency: T.nilable(String), + order_availability: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability::OrSymbol + ), + pre_order_available_date: T.nilable(Time), + reorder_items: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems::OrSymbol + ), + shipping_method: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::OrSymbol + ) + ) + .returns(T.attached_class) + end + def self.new( + delivery_email_address: nil, + delivery_time_frame: nil, + gift_card_amount: nil, + gift_card_count: nil, + gift_card_currency: nil, + order_availability: nil, + pre_order_available_date: nil, + reorder_items: nil, + shipping_method: nil + ) + end + + sig do + override + .returns( + { + delivery_email_address: T.nilable(String), + delivery_time_frame: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ), + gift_card_amount: T.nilable(Integer), + gift_card_count: T.nilable(Integer), + gift_card_currency: T.nilable(String), + order_availability: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ), + pre_order_available_date: T.nilable(Time), + reorder_items: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ), + shipping_method: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # deliveryTimeframe. + module DeliveryTimeFrame + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + end + + ELECTRONIC_DELIVERY = + T.let( + :ELECTRONIC_DELIVERY, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + OVERNIGHT_SHIPPING = + T.let( + :OVERNIGHT_SHIPPING, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + SAME_DAY_SHIPPING = + T.let( + :SAME_DAY_SHIPPING, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + TWO_DAY_OR_MORE_SHIPPING = + T.let( + :TWO_DAY_OR_MORE_SHIPPING, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field preOrderPurchaseInd. + module OrderAvailability + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ) + end + + FUTURE_AVAILABILITY = + T.let( + :FUTURE_AVAILABILITY, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ) + MERCHANDISE_AVAILABLE = + T.let( + :MERCHANDISE_AVAILABLE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field reorderItemsInd. + module ReorderItems + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ) + end + + FIRST_TIME_ORDERED = + T.let( + :FIRST_TIME_ORDERED, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ) + REORDERED = + T.let( + :REORDERED, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field shipIndicator. + module ShippingMethod + extend Lithic::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod) + end + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + end + + DIGITAL_GOODS = + T.let( + :DIGITAL_GOODS, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + LOCKER_DELIVERY = + T.let( + :LOCKER_DELIVERY, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + OTHER = + T.let( + :OTHER, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + PICK_UP_AND_GO_DELIVERY = + T.let( + :PICK_UP_AND_GO_DELIVERY, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_BILLING_ADDRESS = + T.let( + :SHIP_TO_BILLING_ADDRESS, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_NON_BILLING_ADDRESS = + T.let( + :SHIP_TO_NON_BILLING_ADDRESS, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_OTHER_VERIFIED_ADDRESS = + T.let( + :SHIP_TO_OTHER_VERIFIED_ADDRESS, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_STORE = + T.let( + :SHIP_TO_STORE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + TRAVEL_AND_EVENT_TICKETS = + T.let( + :TRAVEL_AND_EVENT_TICKETS, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + module MessageCategory + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory::TaggedSymbol) } + + NON_PAYMENT_AUTHENTICATION = + T.let( + :NON_PAYMENT_AUTHENTICATION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory::TaggedSymbol + ) + PAYMENT_AUTHENTICATION = + T.let( + :PAYMENT_AUTHENTICATION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory::TaggedSymbol]) + end + def self.values + end + end + + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + module ThreeDSRequestorChallengeIndicator + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + end + + NO_PREFERENCE = + T.let( + :NO_PREFERENCE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + NO_CHALLENGE_REQUESTED = + T.let( + :NO_CHALLENGE_REQUESTED, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + CHALLENGE_PREFERENCE = + T.let( + :CHALLENGE_PREFERENCE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + CHALLENGE_MANDATE = + T.let( + :CHALLENGE_MANDATE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + NO_CHALLENGE_RISK_ALREADY_ASSESSED = + T.let( + :NO_CHALLENGE_RISK_ALREADY_ASSESSED, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + DATA_SHARE_ONLY = + T.let( + :DATA_SHARE_ONLY, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + OTHER = + T.let( + :OTHER, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator::TaggedSymbol] + ) + end + def self.values + end + end + + class AdditionalData < Lithic::BaseModel + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + sig do + returns( + T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision::TaggedSymbol + ) + ) + end + attr_accessor :network_decision + + # Mastercard only: Assessment by the network of the authentication risk level, + # with a higher value indicating a higher amount of risk. + sig { returns(T.nilable(Integer)) } + attr_accessor :network_risk_score + + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + sig do + params( + network_decision: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision::OrSymbol + ), + network_risk_score: T.nilable(Integer) + ) + .returns(T.attached_class) + end + def self.new(network_decision: nil, network_risk_score: nil) + end + + sig do + override + .returns( + { + network_decision: T.nilable( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision::TaggedSymbol + ), + network_risk_score: T.nilable(Integer) + } + ) + end + def to_hash + end + + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + module NetworkDecision + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision::TaggedSymbol + ) + end + + LOW_RISK = + T.let( + :LOW_RISK, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision::TaggedSymbol + ) + NOT_LOW_RISK = + T.let( + :NOT_LOW_RISK, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::NetworkDecision::TaggedSymbol] + ) + end + def self.values + end + end + end + + class App < Lithic::BaseModel + # Device information gathered from the cardholder's device - JSON name/value pairs + # that is Base64url encoded. Maps to EMV 3DS field deviceInfo. + sig { returns(T.nilable(String)) } + attr_accessor :device_info + + # External IP address used by the app generating the 3DS authentication request. + # Maps to EMV 3DS field appIp. + sig { returns(T.nilable(String)) } + attr_reader :ip + + sig { params(ip: String).void } + attr_writer :ip + + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + sig { params(device_info: T.nilable(String), ip: String).returns(T.attached_class) } + def self.new(device_info: nil, ip: nil) + end + + sig { override.returns({device_info: T.nilable(String), ip: String}) } + def to_hash + end + end + + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # threeDSRequestorAuthenticationInd. + module AuthenticationRequestType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + end + + ADD_CARD = + T.let( + :ADD_CARD, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + BILLING_AGREEMENT = + T.let( + :BILLING_AGREEMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + DELAYED_SHIPMENT = + T.let( + :DELAYED_SHIPMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + EMV_TOKEN_CARDHOLDER_VERIFICATION = + T.let( + :EMV_TOKEN_CARDHOLDER_VERIFICATION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + INSTALLMENT_TRANSACTION = + T.let( + :INSTALLMENT_TRANSACTION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + MAINTAIN_CARD = + T.let( + :MAINTAIN_CARD, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + PAYMENT_TRANSACTION = + T.let( + :PAYMENT_TRANSACTION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + RECURRING_TRANSACTION = + T.let( + :RECURRING_TRANSACTION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + SPLIT_PAYMENT = + T.let( + :SPLIT_PAYMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + SPLIT_SHIPMENT = + T.let( + :SPLIT_SHIPMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType::TaggedSymbol] + ) + end + def self.values + end + end + + class Browser < Lithic::BaseModel + # IP address of the browser as returned by the HTTP headers to the 3DS requestor + # (e.g., merchant or digital wallet). Maps to EMV 3DS field browserIP. + sig { returns(T.nilable(String)) } + attr_accessor :ip + + # Indicates whether the cardholder's browser has the ability to execute Java. Maps + # to EMV 3DS field browserJavaEnabled. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :java_enabled + + # Indicates whether the cardholder's browser has the ability to execute + # JavaScript. Maps to EMV 3DS field browserJavascriptEnabled. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :javascript_enabled + + # Language of the cardholder's browser as defined in IETF BCP47. Maps to EMV 3DS + # field browserLanguage. + sig { returns(T.nilable(String)) } + attr_accessor :language + + # Time zone of the cardholder's browser offset in minutes between UTC and the + # cardholder browser's local time. The offset is positive if the local time is + # behind UTC and negative if it is ahead. Maps to EMV 3DS field browserTz. + sig { returns(T.nilable(String)) } + attr_accessor :time_zone + + # Content of the HTTP user-agent header. Maps to EMV 3DS field browserUserAgent. + sig { returns(T.nilable(String)) } + attr_accessor :user_agent + + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + sig do + params( + ip: T.nilable(String), + java_enabled: T.nilable(T::Boolean), + javascript_enabled: T.nilable(T::Boolean), + language: T.nilable(String), + time_zone: T.nilable(String), + user_agent: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(ip: nil, java_enabled: nil, javascript_enabled: nil, language: nil, time_zone: nil, user_agent: nil) + end + + sig do + override + .returns( + { + ip: T.nilable(String), + java_enabled: T.nilable(T::Boolean), + javascript_enabled: T.nilable(T::Boolean), + language: T.nilable(String), + time_zone: T.nilable(String), + user_agent: T.nilable(String) + } + ) + end + def to_hash + end + end + + class ChallengeMetadata < Lithic::BaseModel + # The type of challenge method used for authentication. + sig do + returns( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType::TaggedSymbol + ) + end + attr_accessor :method_type + + # The phone number used for delivering the OTP. Relevant only for SMS_OTP method. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # Metadata about the challenge method and delivery. + sig do + params( + method_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType::OrSymbol, + phone_number: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(method_type:, phone_number: nil) + end + + sig do + override + .returns( + { + method_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType::TaggedSymbol, + phone_number: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of challenge method used for authentication. + module MethodType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType::TaggedSymbol + ) + end + + SMS_OTP = + T.let( + :SMS_OTP, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType::TaggedSymbol + ) + OUT_OF_BAND = + T.let( + :OUT_OF_BAND, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::MethodType::TaggedSymbol] + ) + end + def self.values + end + end + end + + # Entity that orchestrates the challenge. + module ChallengeOrchestratedBy + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::TaggedSymbol + ) + end + + LITHIC = + T.let( + :LITHIC, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::TaggedSymbol + ) + CUSTOMER = + T.let( + :CUSTOMER, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::TaggedSymbol + ) + NO_CHALLENGE = + T.let( + :NO_CHALLENGE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy::TaggedSymbol] + ) + end + def self.values + end + end + + # Entity that made the authentication decision. + module DecisionMadeBy + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol) } + + CUSTOMER_ENDPOINT = + T.let( + :CUSTOMER_ENDPOINT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol + ) + LITHIC_DEFAULT = + T.let( + :LITHIC_DEFAULT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol + ) + LITHIC_RULES = + T.let( + :LITHIC_RULES, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol + ) + NETWORK = + T.let(:NETWORK, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol) + UNKNOWN = + T.let(:UNKNOWN, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy::TaggedSymbol]) + end + def self.values + end + end + + # Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field threeRIInd. + module ThreeRiRequestType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol) } + + ACCOUNT_VERIFICATION = + T.let( + :ACCOUNT_VERIFICATION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + ADD_CARD = + T.let( + :ADD_CARD, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + BILLING_AGREEMENT = + T.let( + :BILLING_AGREEMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + CARD_SECURITY_CODE_STATUS_CHECK = + T.let( + :CARD_SECURITY_CODE_STATUS_CHECK, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + DELAYED_SHIPMENT = + T.let( + :DELAYED_SHIPMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + DEVICE_BINDING_STATUS_CHECK = + T.let( + :DEVICE_BINDING_STATUS_CHECK, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + INSTALLMENT_TRANSACTION = + T.let( + :INSTALLMENT_TRANSACTION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + MAIL_ORDER = + T.let( + :MAIL_ORDER, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + MAINTAIN_CARD_INFO = + T.let( + :MAINTAIN_CARD_INFO, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + OTHER_PAYMENT = + T.let( + :OTHER_PAYMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + RECURRING_TRANSACTION = + T.let( + :RECURRING_TRANSACTION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + SPLIT_PAYMENT = + T.let( + :SPLIT_PAYMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + SPLIT_SHIPMENT = + T.let( + :SPLIT_SHIPMENT, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + TELEPHONE_ORDER = + T.let( + :TELEPHONE_ORDER, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + TOP_UP = + T.let(:TOP_UP, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol) + TRUST_LIST_STATUS_CHECK = + T.let( + :TRUST_LIST_STATUS_CHECK, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType::TaggedSymbol] + ) + end + def self.values + end + end + + class Transaction < Lithic::BaseModel + # Amount of the purchase in minor units of currency with all punctuation removed. + # Maps to EMV 3DS field purchaseAmount. + sig { returns(Float) } + attr_accessor :amount + + # Currency of the purchase. Maps to EMV 3DS field purchaseCurrency. + sig { returns(String) } + attr_accessor :currency + + # Minor units of currency, as specified in ISO 4217 currency exponent. Maps to EMV + # 3DS field purchaseExponent. + sig { returns(Float) } + attr_accessor :currency_exponent + + # Date and time when the authentication was generated by the merchant/acquirer's + # 3DS server. Maps to EMV 3DS field purchaseDate. + sig { returns(Time) } + attr_accessor :date_time + + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field transType. + sig do + returns( + T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol) + ) + end + attr_accessor :type + + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + sig do + params( + amount: Float, + currency: String, + currency_exponent: Float, + date_time: Time, + type: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::OrSymbol) + ) + .returns(T.attached_class) + end + def self.new(amount:, currency:, currency_exponent:, date_time:, type:) + end + + sig do + override + .returns( + { + amount: Float, + currency: String, + currency_exponent: Float, + date_time: Time, + type: T.nilable(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol) + } + ) + end + def to_hash + end + + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field transType. + module Type + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol) } + + ACCOUNT_FUNDING = + T.let( + :ACCOUNT_FUNDING, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol + ) + CHECK_ACCEPTANCE = + T.let( + :CHECK_ACCEPTANCE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol + ) + GOODS_SERVICE_PURCHASE = + T.let( + :GOODS_SERVICE_PURCHASE, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol + ) + PREPAID_ACTIVATION_AND_LOAD = + T.let( + :PREPAID_ACTIVATION_AND_LOAD, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol + ) + QUASI_CASH_TRANSACTION = + T.let( + :QUASI_CASH_TRANSACTION, + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbi b/rbi/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbi new file mode 100644 index 00000000..b1474719 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateOtpEntryParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + sig { returns(String) } + attr_accessor :token + + # The OTP entered by the cardholder + sig { returns(String) } + attr_accessor :otp + + sig do + params( + token: String, + otp: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(token:, otp:, request_options: {}) + end + + sig { override.returns({token: String, otp: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/authentication_simulate_params.rbi b/rbi/lib/lithic/models/three_ds/authentication_simulate_params.rbi new file mode 100644 index 00000000..4f870fd9 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/authentication_simulate_params.rbi @@ -0,0 +1,153 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig { returns(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant) } + attr_reader :merchant + + sig do + params( + merchant: T.any(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :merchant + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + sig { returns(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction) } + attr_reader :transaction + + sig do + params( + transaction: T.any(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :transaction + + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + sig { returns(T.nilable(Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol)) } + attr_reader :card_expiry_check + + sig do + params( + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol + ) + .void + end + attr_writer :card_expiry_check + + sig do + params( + merchant: T.any(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant, Lithic::Util::AnyHash), + pan: String, + transaction: T.any(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction, Lithic::Util::AnyHash), + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(merchant:, pan:, transaction:, card_expiry_check: nil, request_options: {}) + end + + sig do + override + .returns( + { + merchant: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + class Merchant < Lithic::BaseModel + # Unique identifier to identify the payment card acceptor. Corresponds to + # `merchant_acceptor_id` in authorization. + sig { returns(String) } + attr_accessor :id + + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + sig { returns(String) } + attr_accessor :country + + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + sig { returns(String) } + attr_accessor :mcc + + # Merchant descriptor, corresponds to `descriptor` in authorization. If CHALLENGE + # keyword is included, Lithic will trigger a challenge. + sig { returns(String) } + attr_accessor :name + + sig { params(id: String, country: String, mcc: String, name: String).returns(T.attached_class) } + def self.new(id:, country:, mcc:, name:) + end + + sig { override.returns({id: String, country: String, mcc: String, name: String}) } + def to_hash + end + end + + class Transaction < Lithic::BaseModel + # Amount (in cents) to authenticate. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency code. + sig { returns(String) } + attr_accessor :currency + + sig { params(amount: Integer, currency: String).returns(T.attached_class) } + def self.new(amount:, currency:) + end + + sig { override.returns({amount: Integer, currency: String}) } + def to_hash + end + end + + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + module CardExpiryCheck + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol) } + + MATCH = + T.let(:MATCH, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol) + MISMATCH = + T.let(:MISMATCH, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol) + NOT_PRESENT = + T.let(:NOT_PRESENT, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol]) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/authentication_simulate_response.rbi b/rbi/lib/lithic/models/three_ds/authentication_simulate_response.rbi new file mode 100644 index 00000000..e03ea700 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/authentication_simulate_response.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateResponse < Lithic::BaseModel + # A unique token to reference this transaction with later calls to void or clear + # the authorization. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { params(token: String).returns(T.attached_class) } + def self.new(token: nil) + end + + sig { override.returns({token: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/challenge_response.rbi b/rbi/lib/lithic/models/three_ds/challenge_response.rbi new file mode 100644 index 00000000..d4947aa8 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/challenge_response.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class ChallengeResponse < Lithic::BaseModel + # Globally unique identifier for the 3DS authentication. This token is sent as + # part of the initial 3DS Decisioning Request and as part of the 3DS Challenge + # Event in the [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) + # object + sig { returns(String) } + attr_accessor :token + + # Whether the Cardholder has Approved or Declined the issued Challenge + sig { returns(Lithic::Models::ThreeDS::ChallengeResult::OrSymbol) } + attr_accessor :challenge_response + + sig do + params(token: String, challenge_response: Lithic::Models::ThreeDS::ChallengeResult::OrSymbol) + .returns(T.attached_class) + end + def self.new(token:, challenge_response:) + end + + sig { override.returns({token: String, challenge_response: Lithic::Models::ThreeDS::ChallengeResult::OrSymbol}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/challenge_result.rbi b/rbi/lib/lithic/models/three_ds/challenge_result.rbi new file mode 100644 index 00000000..e96298ce --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/challenge_result.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + # Whether the Cardholder has Approved or Declined the issued Challenge + module ChallengeResult + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::ThreeDS::ChallengeResult) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::ThreeDS::ChallengeResult::TaggedSymbol) } + + APPROVE = T.let(:APPROVE, Lithic::Models::ThreeDS::ChallengeResult::TaggedSymbol) + DECLINE_BY_CUSTOMER = T.let(:DECLINE_BY_CUSTOMER, Lithic::Models::ThreeDS::ChallengeResult::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::ThreeDS::ChallengeResult::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/decisioning_challenge_response_params.rbi b/rbi/lib/lithic/models/three_ds/decisioning_challenge_response_params.rbi new file mode 100644 index 00000000..4520ae66 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/decisioning_challenge_response_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningChallengeResponseParams < Lithic::Models::ThreeDS::ChallengeResponse + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rbi b/rbi/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rbi new file mode 100644 index 00000000..fec04056 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rbi b/rbi/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rbi new file mode 100644 index 00000000..2f325974 --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningRetrieveSecretResponse < Lithic::BaseModel + # The 3DS Decisioning HMAC secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new(secret: nil) + end + + sig { override.returns({secret: String}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rbi b/rbi/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rbi new file mode 100644 index 00000000..0308703c --- /dev/null +++ b/rbi/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization.rbi b/rbi/lib/lithic/models/tokenization.rbi new file mode 100644 index 00000000..47d47503 --- /dev/null +++ b/rbi/lib/lithic/models/tokenization.rbi @@ -0,0 +1,293 @@ +# typed: strong + +module Lithic + module Models + class Tokenization < Lithic::BaseModel + # Globally unique identifier for a Tokenization + sig { returns(String) } + attr_accessor :token + + # The account token associated with the card being tokenized. + sig { returns(String) } + attr_accessor :account_token + + # The card token associated with the card being tokenized. + sig { returns(String) } + attr_accessor :card_token + + # Date and time when the tokenization first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created_at + + # The dynamic pan assigned to the token by the network. + sig { returns(T.nilable(String)) } + attr_accessor :dpan + + # The status of the tokenization request + sig { returns(Lithic::Models::Tokenization::Status::TaggedSymbol) } + attr_accessor :status + + # The entity that requested the tokenization. Represents a Digital Wallet or + # merchant. + sig { returns(Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) } + attr_accessor :token_requestor_name + + # The network's unique reference for the tokenization. + sig { returns(String) } + attr_accessor :token_unique_reference + + # The channel through which the tokenization was made. + sig { returns(Lithic::Models::Tokenization::TokenizationChannel::TaggedSymbol) } + attr_accessor :tokenization_channel + + # Latest date and time when the tokenization was updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated_at + + # Specifies the digital card art displayed in the user’s digital wallet after + # tokenization. This will be null if the tokenization was created without an + # associated digital card art. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + # A list of events related to the tokenization. + sig { returns(T.nilable(T::Array[Lithic::Models::Tokenization::Event])) } + attr_reader :events + + sig { params(events: T::Array[T.any(Lithic::Models::Tokenization::Event, Lithic::Util::AnyHash)]).void } + attr_writer :events + + # The network's unique reference for the card that is tokenized. + sig { returns(T.nilable(String)) } + attr_accessor :payment_account_reference_id + + sig do + params( + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: T.nilable(String), + status: Lithic::Models::Tokenization::Status::OrSymbol, + token_requestor_name: Lithic::Models::Tokenization::TokenRequestorName::OrSymbol, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::TokenizationChannel::OrSymbol, + updated_at: Time, + digital_card_art_token: String, + events: T::Array[T.any(Lithic::Models::Tokenization::Event, Lithic::Util::AnyHash)], + payment_account_reference_id: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_token:, + card_token:, + created_at:, + dpan:, + status:, + token_requestor_name:, + token_unique_reference:, + tokenization_channel:, + updated_at:, + digital_card_art_token: nil, + events: nil, + payment_account_reference_id: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: T.nilable(String), + status: Lithic::Models::Tokenization::Status::TaggedSymbol, + token_requestor_name: Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::TokenizationChannel::TaggedSymbol, + updated_at: Time, + digital_card_art_token: String, + events: T::Array[Lithic::Models::Tokenization::Event], + payment_account_reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The status of the tokenization request + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Tokenization::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Tokenization::Status::TaggedSymbol) } + + ACTIVE = T.let(:ACTIVE, Lithic::Models::Tokenization::Status::TaggedSymbol) + DEACTIVATED = T.let(:DEACTIVATED, Lithic::Models::Tokenization::Status::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Models::Tokenization::Status::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Models::Tokenization::Status::TaggedSymbol) + PENDING_2_FA = T.let(:PENDING_2FA, Lithic::Models::Tokenization::Status::TaggedSymbol) + PENDING_ACTIVATION = T.let(:PENDING_ACTIVATION, Lithic::Models::Tokenization::Status::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Tokenization::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Tokenization::Status::TaggedSymbol]) } + def self.values + end + end + + # The entity that requested the tokenization. Represents a Digital Wallet or + # merchant. + module TokenRequestorName + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Tokenization::TokenRequestorName) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) } + + AMAZON_ONE = T.let(:AMAZON_ONE, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + ANDROID_PAY = T.let(:ANDROID_PAY, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + APPLE_PAY = T.let(:APPLE_PAY, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + FACEBOOK = T.let(:FACEBOOK, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + FITBIT_PAY = T.let(:FITBIT_PAY, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + GARMIN_PAY = T.let(:GARMIN_PAY, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + MICROSOFT_PAY = T.let(:MICROSOFT_PAY, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + NETFLIX = T.let(:NETFLIX, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + SAMSUNG_PAY = T.let(:SAMSUNG_PAY, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + VISA_CHECKOUT = T.let(:VISA_CHECKOUT, Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Tokenization::TokenRequestorName::TaggedSymbol]) } + def self.values + end + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Tokenization::TokenizationChannel) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Tokenization::TokenizationChannel::TaggedSymbol) } + + DIGITAL_WALLET = T.let(:DIGITAL_WALLET, Lithic::Models::Tokenization::TokenizationChannel::TaggedSymbol) + MERCHANT = T.let(:MERCHANT, Lithic::Models::Tokenization::TokenizationChannel::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Tokenization::TokenizationChannel::TaggedSymbol]) } + def self.values + end + end + + class Event < Lithic::BaseModel + # Globally unique identifier for a Tokenization Event + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Date and time when the tokenization event first occurred. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Enum representing the result of the tokenization event + sig { returns(T.nilable(Lithic::Models::Tokenization::Event::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::Tokenization::Event::Result::OrSymbol).void } + attr_writer :result + + # Enum representing the type of tokenization event that occurred + sig { returns(T.nilable(Lithic::Models::Tokenization::Event::Type::TaggedSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::Tokenization::Event::Type::OrSymbol).void } + attr_writer :type + + sig do + params( + token: String, + created_at: Time, + result: Lithic::Models::Tokenization::Event::Result::OrSymbol, + type: Lithic::Models::Tokenization::Event::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(token: nil, created_at: nil, result: nil, type: nil) + end + + sig do + override + .returns( + { + token: String, + created_at: Time, + result: Lithic::Models::Tokenization::Event::Result::TaggedSymbol, + type: Lithic::Models::Tokenization::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Enum representing the result of the tokenization event + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Tokenization::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + NOTIFICATION_DELIVERED = + T.let(:NOTIFICATION_DELIVERED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let(:REQUIRE_ADDITIONAL_AUTHENTICATION, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + TOKEN_ACTIVATED = T.let(:TOKEN_ACTIVATED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + TOKEN_CREATED = T.let(:TOKEN_CREATED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + TOKEN_DEACTIVATED = T.let(:TOKEN_DEACTIVATED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + TOKEN_INACTIVE = T.let(:TOKEN_INACTIVE, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + TOKEN_STATE_UNKNOWN = + T.let(:TOKEN_STATE_UNKNOWN, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + TOKEN_SUSPENDED = T.let(:TOKEN_SUSPENDED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + TOKEN_UPDATED = T.let(:TOKEN_UPDATED, Lithic::Models::Tokenization::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Tokenization::Event::Result::TaggedSymbol]) } + def self.values + end + end + + # Enum representing the type of tokenization event that occurred + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Tokenization::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Tokenization::Event::Type::TaggedSymbol) } + + TOKENIZATION_2_FA = T.let(:TOKENIZATION_2FA, Lithic::Models::Tokenization::Event::Type::TaggedSymbol) + TOKENIZATION_AUTHORIZATION = + T.let(:TOKENIZATION_AUTHORIZATION, Lithic::Models::Tokenization::Event::Type::TaggedSymbol) + TOKENIZATION_DECISIONING = + T.let(:TOKENIZATION_DECISIONING, Lithic::Models::Tokenization::Event::Type::TaggedSymbol) + TOKENIZATION_ELIGIBILITY_CHECK = + T.let(:TOKENIZATION_ELIGIBILITY_CHECK, Lithic::Models::Tokenization::Event::Type::TaggedSymbol) + TOKENIZATION_UPDATED = + T.let(:TOKENIZATION_UPDATED, Lithic::Models::Tokenization::Event::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Tokenization::Event::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_activate_params.rbi b/rbi/lib/lithic/models/tokenization_activate_params.rbi new file mode 100644 index 00000000..9f4503ff --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_activate_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TokenizationActivateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_deactivate_params.rbi b/rbi/lib/lithic/models/tokenization_deactivate_params.rbi new file mode 100644 index 00000000..cf992c0b --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_deactivate_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDeactivateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rbi b/rbi/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rbi new file mode 100644 index 00000000..c8cf04b7 --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDecisioningRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rbi b/rbi/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rbi new file mode 100644 index 00000000..f9777da8 --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDecisioningRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rbi b/rbi/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rbi new file mode 100644 index 00000000..f0378f5b --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDecisioningRotateSecretResponse < Lithic::BaseModel + # The new Tokenization Decisioning HMAC secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new(secret: nil) + end + + sig { override.returns({secret: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_list_params.rbi b/rbi/lib/lithic/models/tokenization_list_params.rbi new file mode 100644 index 00000000..bbb02daf --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_list_params.rbi @@ -0,0 +1,135 @@ +# typed: strong + +module Lithic + module Models + class TokenizationListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Filters for tokenizations associated with a specific account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Filter for tokenizations created after this date. + sig { returns(T.nilable(Date)) } + attr_reader :begin_ + + sig { params(begin_: Date).void } + attr_writer :begin_ + + # Filters for tokenizations associated with a specific card. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # Filter for tokenizations created before this date. + sig { returns(T.nilable(Date)) } + attr_reader :end_ + + sig { params(end_: Date).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + sig { returns(T.nilable(Lithic::Models::TokenizationListParams::TokenizationChannel::OrSymbol)) } + attr_reader :tokenization_channel + + sig { params(tokenization_channel: Lithic::Models::TokenizationListParams::TokenizationChannel::OrSymbol).void } + attr_writer :tokenization_channel + + sig do + params( + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: Lithic::Models::TokenizationListParams::TokenizationChannel::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + begin_: nil, + card_token: nil, + end_: nil, + ending_before: nil, + page_size: nil, + starting_after: nil, + tokenization_channel: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: Lithic::Models::TokenizationListParams::TokenizationChannel::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + module TokenizationChannel + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel::TaggedSymbol) } + + DIGITAL_WALLET = + T.let(:DIGITAL_WALLET, Lithic::Models::TokenizationListParams::TokenizationChannel::TaggedSymbol) + MERCHANT = T.let(:MERCHANT, Lithic::Models::TokenizationListParams::TokenizationChannel::TaggedSymbol) + ALL = T.let(:ALL, Lithic::Models::TokenizationListParams::TokenizationChannel::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::TokenizationListParams::TokenizationChannel::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_pause_params.rbi b/rbi/lib/lithic/models/tokenization_pause_params.rbi new file mode 100644 index 00000000..88649ec5 --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_pause_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TokenizationPauseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_resend_activation_code_params.rbi b/rbi/lib/lithic/models/tokenization_resend_activation_code_params.rbi new file mode 100644 index 00000000..7a78c9b3 --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_resend_activation_code_params.rbi @@ -0,0 +1,78 @@ +# typed: strong + +module Lithic + module Models + class TokenizationResendActivationCodeParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig { returns(T.nilable(Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol)) } + attr_reader :activation_method_type + + sig do + params( + activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol + ) + .void + end + attr_writer :activation_method_type + + sig do + params( + activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(activation_method_type: nil, request_options: {}) + end + + sig do + override + .returns( + { + activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module ActivationMethodType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::TaggedSymbol) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_retrieve_params.rbi b/rbi/lib/lithic/models/tokenization_retrieve_params.rbi new file mode 100644 index 00000000..cac04f9d --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TokenizationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_retrieve_response.rbi b/rbi/lib/lithic/models/tokenization_retrieve_response.rbi new file mode 100644 index 00000000..e65bb02f --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_retrieve_response.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Lithic + module Models + class TokenizationRetrieveResponse < Lithic::BaseModel + sig { returns(T.nilable(Lithic::Models::Tokenization)) } + attr_reader :data + + sig { params(data: T.any(Lithic::Models::Tokenization, Lithic::Util::AnyHash)).void } + attr_writer :data + + sig { params(data: T.any(Lithic::Models::Tokenization, Lithic::Util::AnyHash)).returns(T.attached_class) } + def self.new(data: nil) + end + + sig { override.returns({data: Lithic::Models::Tokenization}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_secret.rbi b/rbi/lib/lithic/models/tokenization_secret.rbi new file mode 100644 index 00000000..f992884a --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_secret.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class TokenizationSecret < Lithic::BaseModel + # The Tokenization Decisioning HMAC secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new(secret: nil) + end + + sig { override.returns({secret: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_simulate_params.rbi b/rbi/lib/lithic/models/tokenization_simulate_params.rbi new file mode 100644 index 00000000..338d1434 --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_simulate_params.rbi @@ -0,0 +1,156 @@ +# typed: strong + +module Lithic + module Models + class TokenizationSimulateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The three digit cvv for the card. + sig { returns(String) } + attr_accessor :cvv + + # The expiration date of the card in 'MM/YY' format. + sig { returns(String) } + attr_accessor :expiration_date + + # The sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + # The source of the tokenization request. + sig { returns(Lithic::Models::TokenizationSimulateParams::TokenizationSource::OrSymbol) } + attr_accessor :tokenization_source + + # The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + sig { returns(T.nilable(Integer)) } + attr_reader :account_score + + sig { params(account_score: Integer).void } + attr_writer :account_score + + # The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + sig { returns(T.nilable(Integer)) } + attr_reader :device_score + + sig { params(device_score: Integer).void } + attr_writer :device_score + + # Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + sig { returns(T.nilable(String)) } + attr_reader :entity + + sig { params(entity: String).void } + attr_writer :entity + + # The decision that the Digital Wallet's recommend + sig { returns(T.nilable(Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol)) } + attr_reader :wallet_recommended_decision + + sig do + params( + wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol + ) + .void + end + attr_writer :wallet_recommended_decision + + sig do + params( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::TokenizationSource::OrSymbol, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + cvv:, + expiration_date:, + pan:, + tokenization_source:, + account_score: nil, + device_score: nil, + entity: nil, + wallet_recommended_decision: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::TokenizationSource::OrSymbol, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The source of the tokenization request. + module TokenizationSource + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource::TaggedSymbol) } + + APPLE_PAY = + T.let(:APPLE_PAY, Lithic::Models::TokenizationSimulateParams::TokenizationSource::TaggedSymbol) + GOOGLE = T.let(:GOOGLE, Lithic::Models::TokenizationSimulateParams::TokenizationSource::TaggedSymbol) + SAMSUNG_PAY = + T.let(:SAMSUNG_PAY, Lithic::Models::TokenizationSimulateParams::TokenizationSource::TaggedSymbol) + MERCHANT = T.let(:MERCHANT, Lithic::Models::TokenizationSimulateParams::TokenizationSource::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::TokenizationSimulateParams::TokenizationSource::TaggedSymbol]) } + def self.values + end + end + + # The decision that the Digital Wallet's recommend + module WalletRecommendedDecision + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol) } + + APPROVED = + T.let(:APPROVED, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let( + :REQUIRE_ADDITIONAL_AUTHENTICATION, + Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_simulate_response.rbi b/rbi/lib/lithic/models/tokenization_simulate_response.rbi new file mode 100644 index 00000000..044f5a8f --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_simulate_response.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Lithic + module Models + class TokenizationSimulateResponse < Lithic::BaseModel + sig { returns(T.nilable(T::Array[Lithic::Models::Tokenization])) } + attr_reader :data + + sig { params(data: T::Array[T.any(Lithic::Models::Tokenization, Lithic::Util::AnyHash)]).void } + attr_writer :data + + sig do + params(data: T::Array[T.any(Lithic::Models::Tokenization, Lithic::Util::AnyHash)]) + .returns(T.attached_class) + end + def self.new(data: nil) + end + + sig { override.returns({data: T::Array[Lithic::Models::Tokenization]}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_unpause_params.rbi b/rbi/lib/lithic/models/tokenization_unpause_params.rbi new file mode 100644 index 00000000..417d8ddf --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_unpause_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TokenizationUnpauseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_update_digital_card_art_params.rbi b/rbi/lib/lithic/models/tokenization_update_digital_card_art_params.rbi new file mode 100644 index 00000000..c96b7529 --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_update_digital_card_art_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Models + class TokenizationUpdateDigitalCardArtParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + sig do + params( + digital_card_art_token: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(digital_card_art_token: nil, request_options: {}) + end + + sig { override.returns({digital_card_art_token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/tokenization_update_digital_card_art_response.rbi b/rbi/lib/lithic/models/tokenization_update_digital_card_art_response.rbi new file mode 100644 index 00000000..cc91a06d --- /dev/null +++ b/rbi/lib/lithic/models/tokenization_update_digital_card_art_response.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Lithic + module Models + class TokenizationUpdateDigitalCardArtResponse < Lithic::BaseModel + sig { returns(T.nilable(Lithic::Models::Tokenization)) } + attr_reader :data + + sig { params(data: T.any(Lithic::Models::Tokenization, Lithic::Util::AnyHash)).void } + attr_writer :data + + sig { params(data: T.any(Lithic::Models::Tokenization, Lithic::Util::AnyHash)).returns(T.attached_class) } + def self.new(data: nil) + end + + sig { override.returns({data: Lithic::Models::Tokenization}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction.rbi b/rbi/lib/lithic/models/transaction.rbi new file mode 100644 index 00000000..46ac2793 --- /dev/null +++ b/rbi/lib/lithic/models/transaction.rbi @@ -0,0 +1,2030 @@ +# typed: strong + +module Lithic + module Models + class Transaction < Lithic::BaseModel + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # The token for the account associated with this transaction. + sig { returns(String) } + attr_accessor :account_token + + # Fee assessed by the merchant and paid for by the cardholder in the smallest unit + # of the currency. Will be zero if no fee is assessed. Rebates may be transmitted + # as a negative value to indicate credited fees. + sig { returns(T.nilable(Integer)) } + attr_accessor :acquirer_fee + + # Unique identifier assigned to a transaction by the acquirer that can be used in + # dispute and chargeback filing. + sig { returns(T.nilable(String)) } + attr_accessor :acquirer_reference_number + + # When the transaction is pending, this represents the authorization amount of the + # transaction in the anticipated settlement currency. Once the transaction has + # settled, this field represents the settled amount in the settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::Models::Transaction::Amounts) } + attr_reader :amounts + + sig { params(amounts: T.any(Lithic::Models::Transaction::Amounts, Lithic::Util::AnyHash)).void } + attr_writer :amounts + + # The authorization amount of the transaction in the anticipated settlement + # currency. + sig { returns(T.nilable(Integer)) } + attr_accessor :authorization_amount + + # A fixed-width 6-digit numeric identifier that can be used to identify a + # transaction with networks. + sig { returns(T.nilable(String)) } + attr_accessor :authorization_code + + sig { returns(T.nilable(Lithic::Models::Transaction::Avs)) } + attr_reader :avs + + sig { params(avs: T.nilable(T.any(Lithic::Models::Transaction::Avs, Lithic::Util::AnyHash))).void } + attr_writer :avs + + # Token for the card used in this transaction. + sig { returns(String) } + attr_accessor :card_token + + sig { returns(T.nilable(Lithic::Models::Transaction::CardholderAuthentication)) } + attr_reader :cardholder_authentication + + sig do + params( + cardholder_authentication: T.nilable(T.any(Lithic::Models::Transaction::CardholderAuthentication, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :cardholder_authentication + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + sig { returns(Lithic::Models::Transaction::Merchant) } + attr_reader :merchant + + sig { params(merchant: T.any(Lithic::Models::Transaction::Merchant, Lithic::Util::AnyHash)).void } + attr_writer :merchant + + # Analogous to the 'amount', but in the merchant currency. + sig { returns(T.nilable(Integer)) } + attr_accessor :merchant_amount + + # Analogous to the 'authorization_amount', but in the merchant currency. + sig { returns(T.nilable(Integer)) } + attr_accessor :merchant_authorization_amount + + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + sig { returns(String) } + attr_accessor :merchant_currency + + # Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, + # `VISA`, or `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the + # network code from the upstream provider. + sig { returns(T.nilable(Lithic::Models::Transaction::Network::TaggedSymbol)) } + attr_accessor :network + + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + sig { returns(T.nilable(Integer)) } + attr_accessor :network_risk_score + + sig { returns(Lithic::Models::Transaction::Pos) } + attr_reader :pos + + sig { params(pos: T.any(Lithic::Models::Transaction::Pos, Lithic::Util::AnyHash)).void } + attr_writer :pos + + sig { returns(Lithic::Models::Transaction::Result::TaggedSymbol) } + attr_accessor :result + + # The settled amount of the transaction in the settlement currency. + sig { returns(Integer) } + attr_accessor :settled_amount + + # Status of the transaction. + sig { returns(Lithic::Models::Transaction::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(T.nilable(Lithic::Models::Transaction::TokenInfo)) } + attr_reader :token_info + + sig { params(token_info: T.nilable(T.any(Lithic::Models::Transaction::TokenInfo, Lithic::Util::AnyHash))).void } + attr_writer :token_info + + # Date and time when the transaction last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(T::Array[Lithic::Models::Transaction::Event])) } + attr_reader :events + + sig { params(events: T::Array[T.any(Lithic::Models::Transaction::Event, Lithic::Util::AnyHash)]).void } + attr_writer :events + + sig do + params( + token: String, + account_token: String, + acquirer_fee: T.nilable(Integer), + acquirer_reference_number: T.nilable(String), + amount: Integer, + amounts: T.any(Lithic::Models::Transaction::Amounts, Lithic::Util::AnyHash), + authorization_amount: T.nilable(Integer), + authorization_code: T.nilable(String), + avs: T.nilable(T.any(Lithic::Models::Transaction::Avs, Lithic::Util::AnyHash)), + card_token: String, + cardholder_authentication: T.nilable(T.any(Lithic::Models::Transaction::CardholderAuthentication, Lithic::Util::AnyHash)), + created: Time, + merchant: T.any(Lithic::Models::Transaction::Merchant, Lithic::Util::AnyHash), + merchant_amount: T.nilable(Integer), + merchant_authorization_amount: T.nilable(Integer), + merchant_currency: String, + network: T.nilable(Lithic::Models::Transaction::Network::OrSymbol), + network_risk_score: T.nilable(Integer), + pos: T.any(Lithic::Models::Transaction::Pos, Lithic::Util::AnyHash), + result: Lithic::Models::Transaction::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::Models::Transaction::Status::OrSymbol, + token_info: T.nilable(T.any(Lithic::Models::Transaction::TokenInfo, Lithic::Util::AnyHash)), + updated: Time, + events: T::Array[T.any(Lithic::Models::Transaction::Event, Lithic::Util::AnyHash)] + ) + .returns(T.attached_class) + end + def self.new( + token:, + account_token:, + acquirer_fee:, + acquirer_reference_number:, + amount:, + amounts:, + authorization_amount:, + authorization_code:, + avs:, + card_token:, + cardholder_authentication:, + created:, + merchant:, + merchant_amount:, + merchant_authorization_amount:, + merchant_currency:, + network:, + network_risk_score:, + pos:, + result:, + settled_amount:, + status:, + token_info:, + updated:, + events: nil + ) + end + + sig do + override + .returns( + { + token: String, + account_token: String, + acquirer_fee: T.nilable(Integer), + acquirer_reference_number: T.nilable(String), + amount: Integer, + amounts: Lithic::Models::Transaction::Amounts, + authorization_amount: T.nilable(Integer), + authorization_code: T.nilable(String), + avs: T.nilable(Lithic::Models::Transaction::Avs), + card_token: String, + cardholder_authentication: T.nilable(Lithic::Models::Transaction::CardholderAuthentication), + created: Time, + merchant: Lithic::Models::Transaction::Merchant, + merchant_amount: T.nilable(Integer), + merchant_authorization_amount: T.nilable(Integer), + merchant_currency: String, + network: T.nilable(Lithic::Models::Transaction::Network::TaggedSymbol), + network_risk_score: T.nilable(Integer), + pos: Lithic::Models::Transaction::Pos, + result: Lithic::Models::Transaction::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::Models::Transaction::Status::TaggedSymbol, + token_info: T.nilable(Lithic::Models::Transaction::TokenInfo), + updated: Time, + events: T::Array[Lithic::Models::Transaction::Event] + } + ) + end + def to_hash + end + + class Amounts < Lithic::BaseModel + sig { returns(Lithic::Models::Transaction::Amounts::Cardholder) } + attr_reader :cardholder + + sig { params(cardholder: T.any(Lithic::Models::Transaction::Amounts::Cardholder, Lithic::Util::AnyHash)).void } + attr_writer :cardholder + + sig { returns(Lithic::Models::Transaction::Amounts::Hold) } + attr_reader :hold + + sig { params(hold: T.any(Lithic::Models::Transaction::Amounts::Hold, Lithic::Util::AnyHash)).void } + attr_writer :hold + + sig { returns(Lithic::Models::Transaction::Amounts::Merchant) } + attr_reader :merchant + + sig { params(merchant: T.any(Lithic::Models::Transaction::Amounts::Merchant, Lithic::Util::AnyHash)).void } + attr_writer :merchant + + sig { returns(Lithic::Models::Transaction::Amounts::Settlement) } + attr_reader :settlement + + sig { params(settlement: T.any(Lithic::Models::Transaction::Amounts::Settlement, Lithic::Util::AnyHash)).void } + attr_writer :settlement + + sig do + params( + cardholder: T.any(Lithic::Models::Transaction::Amounts::Cardholder, Lithic::Util::AnyHash), + hold: T.any(Lithic::Models::Transaction::Amounts::Hold, Lithic::Util::AnyHash), + merchant: T.any(Lithic::Models::Transaction::Amounts::Merchant, Lithic::Util::AnyHash), + settlement: T.any(Lithic::Models::Transaction::Amounts::Settlement, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(cardholder:, hold:, merchant:, settlement:) + end + + sig do + override + .returns( + { + cardholder: Lithic::Models::Transaction::Amounts::Cardholder, + hold: Lithic::Models::Transaction::Amounts::Hold, + merchant: Lithic::Models::Transaction::Amounts::Merchant, + settlement: Lithic::Models::Transaction::Amounts::Settlement + } + ) + end + def to_hash + end + + class Cardholder < Lithic::BaseModel + # The estimated settled amount of the transaction in the cardholder billing + # currency. + sig { returns(Integer) } + attr_accessor :amount + + # The exchange rate used to convert the merchant amount to the cardholder billing + # amount. + sig { returns(String) } + attr_accessor :conversion_rate + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig { params(amount: Integer, conversion_rate: String, currency: String).returns(T.attached_class) } + def self.new(amount:, conversion_rate:, currency:) + end + + sig { override.returns({amount: Integer, conversion_rate: String, currency: String}) } + def to_hash + end + end + + class Hold < Lithic::BaseModel + # The pending amount of the transaction in the anticipated settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig { params(amount: Integer, currency: String).returns(T.attached_class) } + def self.new(amount:, currency:) + end + + sig { override.returns({amount: Integer, currency: String}) } + def to_hash + end + end + + class Merchant < Lithic::BaseModel + # The settled amount of the transaction in the merchant currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig { params(amount: Integer, currency: String).returns(T.attached_class) } + def self.new(amount:, currency:) + end + + sig { override.returns({amount: Integer, currency: String}) } + def to_hash + end + end + + class Settlement < Lithic::BaseModel + # The settled amount of the transaction in the settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig { params(amount: Integer, currency: String).returns(T.attached_class) } + def self.new(amount:, currency:) + end + + sig { override.returns({amount: Integer, currency: String}) } + def to_hash + end + end + end + + class Avs < Lithic::BaseModel + # Cardholder address + sig { returns(String) } + attr_accessor :address + + # Cardholder ZIP code + sig { returns(String) } + attr_accessor :zipcode + + sig { params(address: String, zipcode: String).returns(T.attached_class) } + def self.new(address:, zipcode:) + end + + sig { override.returns({address: String, zipcode: String}) } + def to_hash + end + end + + class CardholderAuthentication < Lithic::BaseModel + # The 3DS version used for the authentication + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_version + + # Whether an acquirer exemption applied to the transaction. + sig { returns(Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol) } + attr_accessor :acquirer_exemption + + # Indicates what the outcome of the 3DS authentication process is. + sig { returns(Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol) } + attr_accessor :authentication_result + + # Indicates which party made the 3DS authentication decision. + sig { returns(Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol) } + attr_accessor :decision_made_by + + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # * `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D Secure flow, chargeback liability shift applies. + # + # * `ACQUIRER_EXEMPTION`: The acquirer utilised an exemption to bypass Strong Customer Authentication (`transStatus = N`, or `transStatus = I`). Liability remains with the acquirer and in this case the `acquirer_exemption` field is expected to be not `NONE`. + # + # * `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the merchant is liable. + # + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + sig { returns(Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol) } + attr_accessor :liability_shift + + # Unique identifier you can use to match a given 3DS authentication (available via + # the three_ds_authentication.created event webhook) and the transaction. Note + # that in cases where liability shift does not occur, this token is matched to the + # transaction on a best-effort basis. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_authentication_token + + # Indicates whether a 3DS challenge flow was used, and if so, what the + # verification method was. (deprecated, use `authentication_result`) + sig { returns(Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted::TaggedSymbol) } + attr_accessor :verification_attempted + + # Indicates whether a transaction is considered 3DS authenticated. (deprecated, + # use `authentication_result`) + sig { returns(Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol) } + attr_accessor :verification_result + + sig do + params( + three_ds_version: T.nilable(String), + acquirer_exemption: Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::OrSymbol, + authentication_result: Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::OrSymbol, + decision_made_by: Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::OrSymbol, + liability_shift: Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::OrSymbol, + three_ds_authentication_token: T.nilable(String), + verification_attempted: Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted::OrSymbol, + verification_result: Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::OrSymbol + ) + .returns(T.attached_class) + end + def self.new( + three_ds_version:, + acquirer_exemption:, + authentication_result:, + decision_made_by:, + liability_shift:, + three_ds_authentication_token:, + verification_attempted:, + verification_result: + ) + end + + sig do + override + .returns( + { + three_ds_version: T.nilable(String), + acquirer_exemption: Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol, + authentication_result: Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol, + decision_made_by: Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol, + liability_shift: Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol, + three_ds_authentication_token: T.nilable(String), + verification_attempted: Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted::TaggedSymbol, + verification_result: Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol + } + ) + end + def to_hash + end + + # Whether an acquirer exemption applied to the transaction. + module AcquirerExemption + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol) } + + AUTHENTICATION_OUTAGE_EXCEPTION = + T.let( + :AUTHENTICATION_OUTAGE_EXCEPTION, + Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol + ) + LOW_VALUE = + T.let(:LOW_VALUE, Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol) + MERCHANT_INITIATED_TRANSACTION = + T.let( + :MERCHANT_INITIATED_TRANSACTION, + Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol + ) + NONE = + T.let(:NONE, Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol) + RECURRING_PAYMENT = + T.let( + :RECURRING_PAYMENT, + Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol + ) + SECURE_CORPORATE_PAYMENT = + T.let( + :SECURE_CORPORATE_PAYMENT, + Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol + ) + STRONG_CUSTOMER_AUTHENTICATION_DELEGATION = + T.let( + :STRONG_CUSTOMER_AUTHENTICATION_DELEGATION, + Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol + ) + TRANSACTION_RISK_ANALYSIS = + T.let( + :TRANSACTION_RISK_ANALYSIS, + Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::Transaction::CardholderAuthentication::AcquirerExemption::TaggedSymbol]) + end + def self.values + end + end + + # Indicates what the outcome of the 3DS authentication process is. + module AuthenticationResult + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol) } + + ATTEMPTS = + T.let( + :ATTEMPTS, + Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol + ) + DECLINE = + T.let(:DECLINE, Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol) + NONE = + T.let(:NONE, Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol) + SUCCESS = + T.let(:SUCCESS, Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol) + + sig do + override + .returns( + T::Array[Lithic::Models::Transaction::CardholderAuthentication::AuthenticationResult::TaggedSymbol] + ) + end + def self.values + end + end + + # Indicates which party made the 3DS authentication decision. + module DecisionMadeBy + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol) } + + CUSTOMER_ENDPOINT = + T.let( + :CUSTOMER_ENDPOINT, + Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + LITHIC_DEFAULT = + T.let( + :LITHIC_DEFAULT, + Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + LITHIC_RULES = + T.let(:LITHIC_RULES, Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol) + NETWORK = + T.let(:NETWORK, Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol) + UNKNOWN = + T.let(:UNKNOWN, Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::Transaction::CardholderAuthentication::DecisionMadeBy::TaggedSymbol]) + end + def self.values + end + end + + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # * `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D Secure flow, chargeback liability shift applies. + # + # * `ACQUIRER_EXEMPTION`: The acquirer utilised an exemption to bypass Strong Customer Authentication (`transStatus = N`, or `transStatus = I`). Liability remains with the acquirer and in this case the `acquirer_exemption` field is expected to be not `NONE`. + # + # * `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the merchant is liable. + # + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + module LiabilityShift + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol) } + + NUMBER_3DS_AUTHENTICATED = + T.let( + :"3DS_AUTHENTICATED", + Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol + ) + ACQUIRER_EXEMPTION = + T.let( + :ACQUIRER_EXEMPTION, + Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol + ) + NONE = T.let(:NONE, Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol) + TOKEN_AUTHENTICATED = + T.let( + :TOKEN_AUTHENTICATED, + Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::Transaction::CardholderAuthentication::LiabilityShift::TaggedSymbol]) + end + def self.values + end + end + + # Indicates whether a 3DS challenge flow was used, and if so, what the + # verification method was. (deprecated, use `authentication_result`) + module VerificationAttempted + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted::TaggedSymbol) } + + NONE = + T.let(:NONE, Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted::TaggedSymbol) + OTHER = + T.let(:OTHER, Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted::TaggedSymbol) + + sig do + override + .returns( + T::Array[Lithic::Models::Transaction::CardholderAuthentication::VerificationAttempted::TaggedSymbol] + ) + end + def self.values + end + end + + # Indicates whether a transaction is considered 3DS authenticated. (deprecated, + # use `authentication_result`) + module VerificationResult + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol) } + + CANCELLED = + T.let(:CANCELLED, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol) + FAILED = + T.let(:FAILED, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol) + FRICTIONLESS = + T.let( + :FRICTIONLESS, + Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol + ) + NOT_ATTEMPTED = + T.let( + :NOT_ATTEMPTED, + Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol + ) + REJECTED = + T.let(:REJECTED, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol) + SUCCESS = + T.let(:SUCCESS, Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol) + + sig do + override + .returns(T::Array[Lithic::Models::Transaction::CardholderAuthentication::VerificationResult::TaggedSymbol]) + end + def self.values + end + end + end + + class Merchant < Lithic::BaseModel + # Unique alphanumeric identifier for the payment card acceptor (merchant). + sig { returns(String) } + attr_accessor :acceptor_id + + # Unique numeric identifier of the acquiring institution. + sig { returns(String) } + attr_accessor :acquiring_institution_id + + # City of card acceptor. Note that in many cases, particularly in card-not-present + # transactions, merchants may send through a phone number or URL in this field. + sig { returns(String) } + attr_accessor :city + + # Country or entity of card acceptor. Possible values are: (1) all ISO 3166-1 + # alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles. + sig { returns(String) } + attr_accessor :country + + # Short description of card acceptor. + sig { returns(String) } + attr_accessor :descriptor + + # Merchant category code (MCC). A four-digit number listed in ISO 18245. An MCC is + # used to classify a business by the types of goods or services it provides. + sig { returns(String) } + attr_accessor :mcc + + # Geographic state of card acceptor. + sig { returns(String) } + attr_accessor :state + + sig do + params( + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + ) + .returns(T.attached_class) + end + def self.new(acceptor_id:, acquiring_institution_id:, city:, country:, descriptor:, mcc:, state:) + end + + sig do + override + .returns( + { + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + } + ) + end + def to_hash + end + end + + # Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, + # `VISA`, or `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the + # network code from the upstream provider. + module Network + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Network) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Network::TaggedSymbol) } + + INTERLINK = T.let(:INTERLINK, Lithic::Models::Transaction::Network::TaggedSymbol) + MAESTRO = T.let(:MAESTRO, Lithic::Models::Transaction::Network::TaggedSymbol) + MASTERCARD = T.let(:MASTERCARD, Lithic::Models::Transaction::Network::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Transaction::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::Models::Transaction::Network::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Network::TaggedSymbol]) } + def self.values + end + end + + class Pos < Lithic::BaseModel + sig { returns(Lithic::Models::Transaction::Pos::EntryMode) } + attr_reader :entry_mode + + sig { params(entry_mode: T.any(Lithic::Models::Transaction::Pos::EntryMode, Lithic::Util::AnyHash)).void } + attr_writer :entry_mode + + sig { returns(Lithic::Models::Transaction::Pos::Terminal) } + attr_reader :terminal + + sig { params(terminal: T.any(Lithic::Models::Transaction::Pos::Terminal, Lithic::Util::AnyHash)).void } + attr_writer :terminal + + sig do + params( + entry_mode: T.any(Lithic::Models::Transaction::Pos::EntryMode, Lithic::Util::AnyHash), + terminal: T.any(Lithic::Models::Transaction::Pos::Terminal, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(entry_mode:, terminal:) + end + + sig do + override + .returns( + { + entry_mode: Lithic::Models::Transaction::Pos::EntryMode, + terminal: Lithic::Models::Transaction::Pos::Terminal + } + ) + end + def to_hash + end + + class EntryMode < Lithic::BaseModel + # Card presence indicator + sig { returns(Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol) } + attr_accessor :card + + # Cardholder presence indicator + sig { returns(Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) } + attr_accessor :cardholder + + # Method of entry for the PAN + sig { returns(Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) } + attr_accessor :pan + + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + sig { returns(T::Boolean) } + attr_accessor :pin_entered + + sig do + params( + card: Lithic::Models::Transaction::Pos::EntryMode::Card::OrSymbol, + cardholder: Lithic::Models::Transaction::Pos::EntryMode::Cardholder::OrSymbol, + pan: Lithic::Models::Transaction::Pos::EntryMode::Pan::OrSymbol, + pin_entered: T::Boolean + ) + .returns(T.attached_class) + end + def self.new(card:, cardholder:, pan:, pin_entered:) + end + + sig do + override + .returns( + { + card: Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol, + cardholder: Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol, + pan: Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol, + pin_entered: T::Boolean + } + ) + end + def to_hash + end + + # Card presence indicator + module Card + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Pos::EntryMode::Card) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol) } + + NOT_PRESENT = T.let(:NOT_PRESENT, Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol) + PREAUTHORIZED = T.let(:PREAUTHORIZED, Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol) + PRESENT = T.let(:PRESENT, Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Pos::EntryMode::Card::TaggedSymbol]) } + def self.values + end + end + + # Cardholder presence indicator + module Cardholder + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Pos::EntryMode::Cardholder) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) } + + DEFERRED_BILLING = + T.let(:DEFERRED_BILLING, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + ELECTRONIC_ORDER = + T.let(:ELECTRONIC_ORDER, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + INSTALLMENT = T.let(:INSTALLMENT, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + MAIL_ORDER = T.let(:MAIL_ORDER, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + NOT_PRESENT = T.let(:NOT_PRESENT, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + PREAUTHORIZED = + T.let(:PREAUTHORIZED, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + PRESENT = T.let(:PRESENT, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + REOCCURRING = T.let(:REOCCURRING, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + TELEPHONE_ORDER = + T.let(:TELEPHONE_ORDER, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol]) } + def self.values + end + end + + # Method of entry for the PAN + module Pan + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Pos::EntryMode::Pan) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) } + + AUTO_ENTRY = T.let(:AUTO_ENTRY, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + BAR_CODE = T.let(:BAR_CODE, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + CONTACTLESS = T.let(:CONTACTLESS, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + CREDENTIAL_ON_FILE = + T.let(:CREDENTIAL_ON_FILE, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + ECOMMERCE = T.let(:ECOMMERCE, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + ERROR_KEYED = T.let(:ERROR_KEYED, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + ERROR_MAGNETIC_STRIPE = + T.let(:ERROR_MAGNETIC_STRIPE, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + ICC = T.let(:ICC, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + KEY_ENTERED = T.let(:KEY_ENTERED, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + MAGNETIC_STRIPE = T.let(:MAGNETIC_STRIPE, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + MANUAL = T.let(:MANUAL, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + OCR = T.let(:OCR, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + SECURE_CARDLESS = T.let(:SECURE_CARDLESS, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + UNSPECIFIED = T.let(:UNSPECIFIED, Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Pos::EntryMode::Pan::TaggedSymbol]) } + def self.values + end + end + end + + class Terminal < Lithic::BaseModel + # True if a clerk is present at the sale. + sig { returns(T::Boolean) } + attr_accessor :attended + + # True if the terminal is capable of retaining the card. + sig { returns(T::Boolean) } + attr_accessor :card_retention_capable + + # True if the sale was made at the place of business (vs. mobile). + sig { returns(T::Boolean) } + attr_accessor :on_premise + + # The person that is designated to swipe the card + sig { returns(Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol) } + attr_accessor :operator + + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + sig { returns(T::Boolean) } + attr_accessor :partial_approval_capable + + # Status of whether the POS is able to accept PINs + sig { returns(Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol) } + attr_accessor :pin_capability + + # POS Type + sig { returns(Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) } + attr_accessor :type + + sig do + params( + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: Lithic::Models::Transaction::Pos::Terminal::Operator::OrSymbol, + partial_approval_capable: T::Boolean, + pin_capability: Lithic::Models::Transaction::Pos::Terminal::PinCapability::OrSymbol, + type: Lithic::Models::Transaction::Pos::Terminal::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new( + attended:, + card_retention_capable:, + on_premise:, + operator:, + partial_approval_capable:, + pin_capability:, + type: + ) + end + + sig do + override + .returns( + { + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol, + partial_approval_capable: T::Boolean, + pin_capability: Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol, + type: Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The person that is designated to swipe the card + module Operator + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Pos::Terminal::Operator) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol) } + + ADMINISTRATIVE = + T.let(:ADMINISTRATIVE, Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol) + CARDHOLDER = T.let(:CARDHOLDER, Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol) + CARD_ACCEPTOR = T.let(:CARD_ACCEPTOR, Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Pos::Terminal::Operator::TaggedSymbol]) } + def self.values + end + end + + # Status of whether the POS is able to accept PINs + module PinCapability + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Pos::Terminal::PinCapability) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol) } + + CAPABLE = T.let(:CAPABLE, Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol) + INOPERATIVE = + T.let(:INOPERATIVE, Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol) + NOT_CAPABLE = + T.let(:NOT_CAPABLE, Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol) + UNSPECIFIED = + T.let(:UNSPECIFIED, Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Pos::Terminal::PinCapability::TaggedSymbol]) } + def self.values + end + end + + # POS Type + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Pos::Terminal::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) } + + ADMINISTRATIVE = T.let(:ADMINISTRATIVE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + ATM = T.let(:ATM, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + AUTHORIZATION = T.let(:AUTHORIZATION, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + COUPON_MACHINE = T.let(:COUPON_MACHINE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + DIAL_TERMINAL = T.let(:DIAL_TERMINAL, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + ECOMMERCE = T.let(:ECOMMERCE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + ECR = T.let(:ECR, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + FUEL_MACHINE = T.let(:FUEL_MACHINE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + HOME_TERMINAL = T.let(:HOME_TERMINAL, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + MICR = T.let(:MICR, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + OFF_PREMISE = T.let(:OFF_PREMISE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + PAYMENT = T.let(:PAYMENT, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + PDA = T.let(:PDA, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + PHONE = T.let(:PHONE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + POINT = T.let(:POINT, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + POS_TERMINAL = T.let(:POS_TERMINAL, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + PUBLIC_UTILITY = T.let(:PUBLIC_UTILITY, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + SELF_SERVICE = T.let(:SELF_SERVICE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + TELEVISION = T.let(:TELEVISION, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + TELLER = T.let(:TELLER, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + TRAVELERS_CHECK_MACHINE = + T.let(:TRAVELERS_CHECK_MACHINE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + VENDING = T.let(:VENDING, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + VOICE = T.let(:VOICE, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Pos::Terminal::Type::TaggedSymbol]) } + def self.values + end + end + end + end + + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Result::TaggedSymbol) } + + ACCOUNT_STATE_TRANSACTION_FAIL = + T.let(:ACCOUNT_STATE_TRANSACTION_FAIL, Lithic::Models::Transaction::Result::TaggedSymbol) + APPROVED = T.let(:APPROVED, Lithic::Models::Transaction::Result::TaggedSymbol) + BANK_CONNECTION_ERROR = T.let(:BANK_CONNECTION_ERROR, Lithic::Models::Transaction::Result::TaggedSymbol) + BANK_NOT_VERIFIED = T.let(:BANK_NOT_VERIFIED, Lithic::Models::Transaction::Result::TaggedSymbol) + CARD_CLOSED = T.let(:CARD_CLOSED, Lithic::Models::Transaction::Result::TaggedSymbol) + CARD_PAUSED = T.let(:CARD_PAUSED, Lithic::Models::Transaction::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Transaction::Result::TaggedSymbol) + FRAUD_ADVICE = T.let(:FRAUD_ADVICE, Lithic::Models::Transaction::Result::TaggedSymbol) + IGNORED_TTL_EXPIRY = T.let(:IGNORED_TTL_EXPIRY, Lithic::Models::Transaction::Result::TaggedSymbol) + INACTIVE_ACCOUNT = T.let(:INACTIVE_ACCOUNT, Lithic::Models::Transaction::Result::TaggedSymbol) + INCORRECT_PIN = T.let(:INCORRECT_PIN, Lithic::Models::Transaction::Result::TaggedSymbol) + INVALID_CARD_DETAILS = T.let(:INVALID_CARD_DETAILS, Lithic::Models::Transaction::Result::TaggedSymbol) + INSUFFICIENT_FUNDS = T.let(:INSUFFICIENT_FUNDS, Lithic::Models::Transaction::Result::TaggedSymbol) + INSUFFICIENT_FUNDS_PRELOAD = + T.let(:INSUFFICIENT_FUNDS_PRELOAD, Lithic::Models::Transaction::Result::TaggedSymbol) + INVALID_TRANSACTION = T.let(:INVALID_TRANSACTION, Lithic::Models::Transaction::Result::TaggedSymbol) + MERCHANT_BLACKLIST = T.let(:MERCHANT_BLACKLIST, Lithic::Models::Transaction::Result::TaggedSymbol) + ORIGINAL_NOT_FOUND = T.let(:ORIGINAL_NOT_FOUND, Lithic::Models::Transaction::Result::TaggedSymbol) + PREVIOUSLY_COMPLETED = T.let(:PREVIOUSLY_COMPLETED, Lithic::Models::Transaction::Result::TaggedSymbol) + SINGLE_USE_RECHARGED = T.let(:SINGLE_USE_RECHARGED, Lithic::Models::Transaction::Result::TaggedSymbol) + SWITCH_INOPERATIVE_ADVICE = + T.let(:SWITCH_INOPERATIVE_ADVICE, Lithic::Models::Transaction::Result::TaggedSymbol) + UNAUTHORIZED_MERCHANT = T.let(:UNAUTHORIZED_MERCHANT, Lithic::Models::Transaction::Result::TaggedSymbol) + UNKNOWN_HOST_TIMEOUT = T.let(:UNKNOWN_HOST_TIMEOUT, Lithic::Models::Transaction::Result::TaggedSymbol) + USER_TRANSACTION_LIMIT = + T.let(:USER_TRANSACTION_LIMIT, Lithic::Models::Transaction::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Result::TaggedSymbol]) } + def self.values + end + end + + # Status of the transaction. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::Transaction::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Models::Transaction::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::Transaction::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::Transaction::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Models::Transaction::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Status::TaggedSymbol]) } + def self.values + end + end + + class TokenInfo < Lithic::BaseModel + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + sig { returns(Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) } + attr_accessor :wallet_type + + sig do + params(wallet_type: Lithic::Models::Transaction::TokenInfo::WalletType::OrSymbol).returns(T.attached_class) + end + def self.new(wallet_type:) + end + + sig { override.returns({wallet_type: Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol}) } + def to_hash + end + + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + module WalletType + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::TokenInfo::WalletType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) } + + APPLE_PAY = T.let(:APPLE_PAY, Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) + GOOGLE_PAY = T.let(:GOOGLE_PAY, Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) + MASTERPASS = T.let(:MASTERPASS, Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) + MERCHANT = T.let(:MERCHANT, Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) + SAMSUNG_PAY = T.let(:SAMSUNG_PAY, Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::TokenInfo::WalletType::TaggedSymbol]) } + def self.values + end + end + end + + class Event < Lithic::BaseModel + # Transaction event identifier. + sig { returns(String) } + attr_accessor :token + + # Amount of the event in the settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::Models::Transaction::Event::Amounts) } + attr_reader :amounts + + sig { params(amounts: T.any(Lithic::Models::Transaction::Event::Amounts, Lithic::Util::AnyHash)).void } + attr_writer :amounts + + # RFC 3339 date and time this event entered the system. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + sig { returns(T::Array[Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol]) } + attr_accessor :detailed_results + + # Indicates whether the transaction event is a credit or debit to the account. + sig { returns(Lithic::Models::Transaction::Event::EffectivePolarity::TaggedSymbol) } + attr_accessor :effective_polarity + + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + sig { returns(T.nilable(Lithic::Models::Transaction::Event::NetworkInfo)) } + attr_reader :network_info + + sig do + params( + network_info: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :network_info + + sig { returns(Lithic::Models::Transaction::Event::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(T::Array[Lithic::Models::Transaction::Event::RuleResult]) } + attr_accessor :rule_results + + # Type of transaction event + sig { returns(Lithic::Models::Transaction::Event::Type::TaggedSymbol) } + attr_accessor :type + + sig do + params( + token: String, + amount: Integer, + amounts: T.any(Lithic::Models::Transaction::Event::Amounts, Lithic::Util::AnyHash), + created: Time, + detailed_results: T::Array[Lithic::Models::Transaction::Event::DetailedResult::OrSymbol], + effective_polarity: Lithic::Models::Transaction::Event::EffectivePolarity::OrSymbol, + network_info: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo, Lithic::Util::AnyHash)), + result: Lithic::Models::Transaction::Event::Result::OrSymbol, + rule_results: T::Array[T.any(Lithic::Models::Transaction::Event::RuleResult, Lithic::Util::AnyHash)], + type: Lithic::Models::Transaction::Event::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new( + token:, + amount:, + amounts:, + created:, + detailed_results:, + effective_polarity:, + network_info:, + result:, + rule_results:, + type: + ) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + amounts: Lithic::Models::Transaction::Event::Amounts, + created: Time, + detailed_results: T::Array[Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol], + effective_polarity: Lithic::Models::Transaction::Event::EffectivePolarity::TaggedSymbol, + network_info: T.nilable(Lithic::Models::Transaction::Event::NetworkInfo), + result: Lithic::Models::Transaction::Event::Result::TaggedSymbol, + rule_results: T::Array[Lithic::Models::Transaction::Event::RuleResult], + type: Lithic::Models::Transaction::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + class Amounts < Lithic::BaseModel + sig { returns(Lithic::Models::Transaction::Event::Amounts::Cardholder) } + attr_reader :cardholder + + sig do + params(cardholder: T.any(Lithic::Models::Transaction::Event::Amounts::Cardholder, Lithic::Util::AnyHash)) + .void + end + attr_writer :cardholder + + sig { returns(Lithic::Models::Transaction::Event::Amounts::Merchant) } + attr_reader :merchant + + sig { params(merchant: T.any(Lithic::Models::Transaction::Event::Amounts::Merchant, Lithic::Util::AnyHash)).void } + attr_writer :merchant + + sig { returns(T.nilable(Lithic::Models::Transaction::Event::Amounts::Settlement)) } + attr_reader :settlement + + sig do + params( + settlement: T.nilable(T.any(Lithic::Models::Transaction::Event::Amounts::Settlement, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :settlement + + sig do + params( + cardholder: T.any(Lithic::Models::Transaction::Event::Amounts::Cardholder, Lithic::Util::AnyHash), + merchant: T.any(Lithic::Models::Transaction::Event::Amounts::Merchant, Lithic::Util::AnyHash), + settlement: T.nilable(T.any(Lithic::Models::Transaction::Event::Amounts::Settlement, Lithic::Util::AnyHash)) + ) + .returns(T.attached_class) + end + def self.new(cardholder:, merchant:, settlement:) + end + + sig do + override + .returns( + { + cardholder: Lithic::Models::Transaction::Event::Amounts::Cardholder, + merchant: Lithic::Models::Transaction::Event::Amounts::Merchant, + settlement: T.nilable(Lithic::Models::Transaction::Event::Amounts::Settlement) + } + ) + end + def to_hash + end + + class Cardholder < Lithic::BaseModel + # Amount of the event in the cardholder billing currency. + sig { returns(Integer) } + attr_accessor :amount + + # Exchange rate used to convert the merchant amount to the cardholder billing + # amount. + sig { returns(String) } + attr_accessor :conversion_rate + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, conversion_rate: String, currency: String).returns(T.attached_class) + end + def self.new(amount:, conversion_rate:, currency:) + end + + sig { override.returns({amount: Integer, conversion_rate: String, currency: String}) } + def to_hash + end + end + + class Merchant < Lithic::BaseModel + # Amount of the event in the merchant currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig { params(amount: Integer, currency: String).returns(T.attached_class) } + def self.new(amount:, currency:) + end + + sig { override.returns({amount: Integer, currency: String}) } + def to_hash + end + end + + class Settlement < Lithic::BaseModel + # Amount of the event, if it is financial, in the settlement currency. + # Non-financial events do not contain this amount because they do not move funds. + sig { returns(Integer) } + attr_accessor :amount + + # Exchange rate used to convert the merchant amount to the settlement amount. + sig { returns(String) } + attr_accessor :conversion_rate + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, conversion_rate: String, currency: String).returns(T.attached_class) + end + def self.new(amount:, conversion_rate:, currency:) + end + + sig { override.returns({amount: Integer, conversion_rate: String, currency: String}) } + def to_hash + end + end + end + + module DetailedResult + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Event::DetailedResult) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) } + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_DELINQUENT = + T.let(:ACCOUNT_DELINQUENT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + ACCOUNT_INACTIVE = + T.let(:ACCOUNT_INACTIVE, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_UNDER_REVIEW = + T.let(:ACCOUNT_UNDER_REVIEW, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + ADDRESS_INCORRECT = + T.let(:ADDRESS_INCORRECT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + APPROVED = T.let(:APPROVED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + AUTH_RULE_ALLOWED_COUNTRY = + T.let(:AUTH_RULE_ALLOWED_COUNTRY, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + AUTH_RULE_ALLOWED_MCC = + T.let(:AUTH_RULE_ALLOWED_MCC, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + AUTH_RULE_BLOCKED_COUNTRY = + T.let(:AUTH_RULE_BLOCKED_COUNTRY, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + AUTH_RULE_BLOCKED_MCC = + T.let(:AUTH_RULE_BLOCKED_MCC, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_CLOSED = T.let(:CARD_CLOSED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_CRYPTOGRAM_VALIDATION_FAILURE = + T.let( + :CARD_CRYPTOGRAM_VALIDATION_FAILURE, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_EXPIRED = T.let(:CARD_EXPIRED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_EXPIRY_DATE_INCORRECT = + T.let(:CARD_EXPIRY_DATE_INCORRECT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_INVALID = T.let(:CARD_INVALID, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_NOT_ACTIVATED = + T.let(:CARD_NOT_ACTIVATED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_PAUSED = T.let(:CARD_PAUSED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_PIN_INCORRECT = + T.let(:CARD_PIN_INCORRECT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_RESTRICTED = + T.let(:CARD_RESTRICTED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_SECURITY_CODE_INCORRECT = + T.let(:CARD_SECURITY_CODE_INCORRECT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CARD_SPEND_LIMIT_EXCEEDED = + T.let(:CARD_SPEND_LIMIT_EXCEEDED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CONTACT_CARD_ISSUER = + T.let(:CONTACT_CARD_ISSUER, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CUSTOMER_ASA_TIMEOUT = + T.let(:CUSTOMER_ASA_TIMEOUT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + CUSTOM_ASA_RESULT = + T.let(:CUSTOM_ASA_RESULT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + DO_NOT_HONOR = T.let(:DO_NOT_HONOR, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + DRIVER_NUMBER_INVALID = + T.let(:DRIVER_NUMBER_INVALID, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + FORMAT_ERROR = T.let(:FORMAT_ERROR, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + INSUFFICIENT_FUNDING_SOURCE_BALANCE = + T.let( + :INSUFFICIENT_FUNDING_SOURCE_BALANCE, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let(:INSUFFICIENT_FUNDS, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + LITHIC_SYSTEM_ERROR = + T.let(:LITHIC_SYSTEM_ERROR, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + LITHIC_SYSTEM_RATE_LIMIT = + T.let(:LITHIC_SYSTEM_RATE_LIMIT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + MALFORMED_ASA_RESPONSE = + T.let(:MALFORMED_ASA_RESPONSE, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + MERCHANT_INVALID = + T.let(:MERCHANT_INVALID, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = + T.let( + :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + MERCHANT_NOT_PERMITTED = + T.let(:MERCHANT_NOT_PERMITTED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + OVER_REVERSAL_ATTEMPTED = + T.let(:OVER_REVERSAL_ATTEMPTED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + PIN_BLOCKED = T.let(:PIN_BLOCKED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + PROGRAM_SUSPENDED = + T.let(:PROGRAM_SUSPENDED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + PROGRAM_USAGE_RESTRICTION = + T.let(:PROGRAM_USAGE_RESTRICTION, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + REVERSAL_UNMATCHED = + T.let(:REVERSAL_UNMATCHED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + SECURITY_VIOLATION = + T.let(:SECURITY_VIOLATION, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + SINGLE_USE_CARD_REATTEMPTED = + T.let(:SINGLE_USE_CARD_REATTEMPTED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + TRANSACTION_INVALID = + T.let(:TRANSACTION_INVALID, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol + ) + TRANSACTION_PREVIOUSLY_COMPLETED = + T.let(:TRANSACTION_PREVIOUSLY_COMPLETED, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + UNAUTHORIZED_MERCHANT = + T.let(:UNAUTHORIZED_MERCHANT, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + VEHICLE_NUMBER_INVALID = + T.let(:VEHICLE_NUMBER_INVALID, Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Event::DetailedResult::TaggedSymbol]) } + def self.values + end + end + + # Indicates whether the transaction event is a credit or debit to the account. + module EffectivePolarity + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Event::EffectivePolarity) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Event::EffectivePolarity::TaggedSymbol) } + + CREDIT = T.let(:CREDIT, Lithic::Models::Transaction::Event::EffectivePolarity::TaggedSymbol) + DEBIT = T.let(:DEBIT, Lithic::Models::Transaction::Event::EffectivePolarity::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Event::EffectivePolarity::TaggedSymbol]) } + def self.values + end + end + + class NetworkInfo < Lithic::BaseModel + sig { returns(T.nilable(Lithic::Models::Transaction::Event::NetworkInfo::Acquirer)) } + attr_reader :acquirer + + sig do + params( + acquirer: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo::Acquirer, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :acquirer + + sig { returns(T.nilable(Lithic::Models::Transaction::Event::NetworkInfo::Mastercard)) } + attr_reader :mastercard + + sig do + params( + mastercard: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo::Mastercard, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :mastercard + + sig { returns(T.nilable(Lithic::Models::Transaction::Event::NetworkInfo::Visa)) } + attr_reader :visa + + sig do + params( + visa: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo::Visa, Lithic::Util::AnyHash)) + ) + .void + end + attr_writer :visa + + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + sig do + params( + acquirer: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo::Acquirer, Lithic::Util::AnyHash)), + mastercard: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo::Mastercard, Lithic::Util::AnyHash)), + visa: T.nilable(T.any(Lithic::Models::Transaction::Event::NetworkInfo::Visa, Lithic::Util::AnyHash)) + ) + .returns(T.attached_class) + end + def self.new(acquirer:, mastercard:, visa:) + end + + sig do + override + .returns( + { + acquirer: T.nilable(Lithic::Models::Transaction::Event::NetworkInfo::Acquirer), + mastercard: T.nilable(Lithic::Models::Transaction::Event::NetworkInfo::Mastercard), + visa: T.nilable(Lithic::Models::Transaction::Event::NetworkInfo::Visa) + } + ) + end + def to_hash + end + + class Acquirer < Lithic::BaseModel + # Identifier assigned by the acquirer, applicable to dual-message transactions + # only. The acquirer reference number (ARN) is only populated once a transaction + # has been cleared, and it is not available in all transactions (such as automated + # fuel dispenser transactions). A single transaction can contain multiple ARNs if + # the merchant sends multiple clearings. + sig { returns(T.nilable(String)) } + attr_accessor :acquirer_reference_number + + # Identifier assigned by the acquirer. + sig { returns(T.nilable(String)) } + attr_accessor :retrieval_reference_number + + sig do + params( + acquirer_reference_number: T.nilable(String), + retrieval_reference_number: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(acquirer_reference_number:, retrieval_reference_number:) + end + + sig do + override + .returns({ + acquirer_reference_number: T.nilable(String), + retrieval_reference_number: T.nilable(String) + }) + end + def to_hash + end + end + + class Mastercard < Lithic::BaseModel + # Identifier assigned by Mastercard. Guaranteed by Mastercard to be unique for any + # transaction within a specific financial network on any processing day. + sig { returns(T.nilable(String)) } + attr_accessor :banknet_reference_number + + # Identifier assigned by Mastercard. Matches the `banknet_reference_number` of a + # prior related event. May be populated in authorization reversals, incremental + # authorizations (authorization requests that augment a previously authorized + # amount), automated fuel dispenser authorization advices and clearings, and + # financial authorizations. If the original banknet reference number contains all + # zeroes, then no actual reference number could be found by the network or + # acquirer. If Mastercard converts a transaction from dual-message to + # single-message, such as for certain ATM transactions, it will populate the + # original banknet reference number in the resulting financial authorization with + # the banknet reference number of the initial authorization, which Lithic does not + # receive. + sig { returns(T.nilable(String)) } + attr_accessor :original_banknet_reference_number + + # Identifier assigned by Mastercard. Matches the `switch_serial_number` of a prior + # related event. May be populated in returns and return reversals. Applicable to + # single-message transactions only. + sig { returns(T.nilable(String)) } + attr_accessor :original_switch_serial_number + + # Identifier assigned by Mastercard, applicable to single-message transactions + # only. + sig { returns(T.nilable(String)) } + attr_accessor :switch_serial_number + + sig do + params( + banknet_reference_number: T.nilable(String), + original_banknet_reference_number: T.nilable(String), + original_switch_serial_number: T.nilable(String), + switch_serial_number: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new( + banknet_reference_number:, + original_banknet_reference_number:, + original_switch_serial_number:, + switch_serial_number: + ) + end + + sig do + override + .returns( + { + banknet_reference_number: T.nilable(String), + original_banknet_reference_number: T.nilable(String), + original_switch_serial_number: T.nilable(String), + switch_serial_number: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Visa < Lithic::BaseModel + # Identifier assigned by Visa. Matches the `transaction_id` of a prior related + # event. May be populated in incremental authorizations (authorization requests + # that augment a previously authorized amount), authorization advices, financial + # authorizations, and clearings. + sig { returns(T.nilable(String)) } + attr_accessor :original_transaction_id + + # Identifier assigned by Visa to link original messages to subsequent messages. + # Guaranteed by Visa to be unique for each original authorization and financial + # authorization. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_id + + sig do + params(original_transaction_id: T.nilable(String), transaction_id: T.nilable(String)) + .returns(T.attached_class) + end + def self.new(original_transaction_id:, transaction_id:) + end + + sig do + override.returns( + { + original_transaction_id: T.nilable(String), + transaction_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end + + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Event::Result::TaggedSymbol) } + + ACCOUNT_STATE_TRANSACTION_FAIL = + T.let(:ACCOUNT_STATE_TRANSACTION_FAIL, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + APPROVED = T.let(:APPROVED, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + BANK_CONNECTION_ERROR = + T.let(:BANK_CONNECTION_ERROR, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + BANK_NOT_VERIFIED = T.let(:BANK_NOT_VERIFIED, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + CARD_CLOSED = T.let(:CARD_CLOSED, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + CARD_PAUSED = T.let(:CARD_PAUSED, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + FRAUD_ADVICE = T.let(:FRAUD_ADVICE, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + IGNORED_TTL_EXPIRY = T.let(:IGNORED_TTL_EXPIRY, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + INACTIVE_ACCOUNT = T.let(:INACTIVE_ACCOUNT, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + INCORRECT_PIN = T.let(:INCORRECT_PIN, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + INVALID_CARD_DETAILS = + T.let(:INVALID_CARD_DETAILS, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + INSUFFICIENT_FUNDS = T.let(:INSUFFICIENT_FUNDS, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + INSUFFICIENT_FUNDS_PRELOAD = + T.let(:INSUFFICIENT_FUNDS_PRELOAD, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + INVALID_TRANSACTION = + T.let(:INVALID_TRANSACTION, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + MERCHANT_BLACKLIST = T.let(:MERCHANT_BLACKLIST, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + ORIGINAL_NOT_FOUND = T.let(:ORIGINAL_NOT_FOUND, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + PREVIOUSLY_COMPLETED = + T.let(:PREVIOUSLY_COMPLETED, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + SINGLE_USE_RECHARGED = + T.let(:SINGLE_USE_RECHARGED, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + SWITCH_INOPERATIVE_ADVICE = + T.let(:SWITCH_INOPERATIVE_ADVICE, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + UNAUTHORIZED_MERCHANT = + T.let(:UNAUTHORIZED_MERCHANT, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + UNKNOWN_HOST_TIMEOUT = + T.let(:UNKNOWN_HOST_TIMEOUT, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + USER_TRANSACTION_LIMIT = + T.let(:USER_TRANSACTION_LIMIT, Lithic::Models::Transaction::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Event::Result::TaggedSymbol]) } + def self.values + end + end + + class RuleResult < Lithic::BaseModel + # The Auth Rule Token associated with the rule from which the decline originated. + # If this is set to null, then the decline was not associated with a + # customer-configured Auth Rule. This may happen in cases where a transaction is + # declined due to a Lithic-configured security or compliance rule, for example. + sig { returns(T.nilable(String)) } + attr_accessor :auth_rule_token + + # A human-readable explanation outlining the motivation for the rule's decline. + sig { returns(T.nilable(String)) } + attr_accessor :explanation + + # The name for the rule, if any was configured. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The detailed_result associated with this rule's decline. + sig { returns(Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) } + attr_accessor :result + + sig do + params( + auth_rule_token: T.nilable(String), + explanation: T.nilable(String), + name: T.nilable(String), + result: Lithic::Models::Transaction::Event::RuleResult::Result::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(auth_rule_token:, explanation:, name:, result:) + end + + sig do + override + .returns( + { + auth_rule_token: T.nilable(String), + explanation: T.nilable(String), + name: T.nilable(String), + result: Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + } + ) + end + def to_hash + end + + # The detailed_result associated with this rule's decline. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Event::RuleResult::Result) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) } + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_DELINQUENT = + T.let(:ACCOUNT_DELINQUENT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + ACCOUNT_INACTIVE = + T.let(:ACCOUNT_INACTIVE, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_UNDER_REVIEW = + T.let(:ACCOUNT_UNDER_REVIEW, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + ADDRESS_INCORRECT = + T.let(:ADDRESS_INCORRECT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + APPROVED = T.let(:APPROVED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + AUTH_RULE_ALLOWED_COUNTRY = + T.let(:AUTH_RULE_ALLOWED_COUNTRY, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + AUTH_RULE_ALLOWED_MCC = + T.let(:AUTH_RULE_ALLOWED_MCC, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + AUTH_RULE_BLOCKED_COUNTRY = + T.let(:AUTH_RULE_BLOCKED_COUNTRY, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + AUTH_RULE_BLOCKED_MCC = + T.let(:AUTH_RULE_BLOCKED_MCC, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_CLOSED = T.let(:CARD_CLOSED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_CRYPTOGRAM_VALIDATION_FAILURE = + T.let( + :CARD_CRYPTOGRAM_VALIDATION_FAILURE, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_EXPIRED = T.let(:CARD_EXPIRED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_EXPIRY_DATE_INCORRECT = + T.let(:CARD_EXPIRY_DATE_INCORRECT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_INVALID = T.let(:CARD_INVALID, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_NOT_ACTIVATED = + T.let(:CARD_NOT_ACTIVATED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_PAUSED = T.let(:CARD_PAUSED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_PIN_INCORRECT = + T.let(:CARD_PIN_INCORRECT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_RESTRICTED = + T.let(:CARD_RESTRICTED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_SECURITY_CODE_INCORRECT = + T.let(:CARD_SECURITY_CODE_INCORRECT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CARD_SPEND_LIMIT_EXCEEDED = + T.let(:CARD_SPEND_LIMIT_EXCEEDED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CONTACT_CARD_ISSUER = + T.let(:CONTACT_CARD_ISSUER, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CUSTOMER_ASA_TIMEOUT = + T.let(:CUSTOMER_ASA_TIMEOUT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + CUSTOM_ASA_RESULT = + T.let(:CUSTOM_ASA_RESULT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + DO_NOT_HONOR = T.let(:DO_NOT_HONOR, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + DRIVER_NUMBER_INVALID = + T.let(:DRIVER_NUMBER_INVALID, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + FORMAT_ERROR = T.let(:FORMAT_ERROR, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + INSUFFICIENT_FUNDING_SOURCE_BALANCE = + T.let( + :INSUFFICIENT_FUNDING_SOURCE_BALANCE, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let(:INSUFFICIENT_FUNDS, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + LITHIC_SYSTEM_ERROR = + T.let(:LITHIC_SYSTEM_ERROR, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + LITHIC_SYSTEM_RATE_LIMIT = + T.let(:LITHIC_SYSTEM_RATE_LIMIT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + MALFORMED_ASA_RESPONSE = + T.let(:MALFORMED_ASA_RESPONSE, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + MERCHANT_INVALID = + T.let(:MERCHANT_INVALID, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = + T.let( + :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + MERCHANT_NOT_PERMITTED = + T.let(:MERCHANT_NOT_PERMITTED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + OVER_REVERSAL_ATTEMPTED = + T.let(:OVER_REVERSAL_ATTEMPTED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + PIN_BLOCKED = T.let(:PIN_BLOCKED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + PROGRAM_SUSPENDED = + T.let(:PROGRAM_SUSPENDED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + PROGRAM_USAGE_RESTRICTION = + T.let(:PROGRAM_USAGE_RESTRICTION, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + REVERSAL_UNMATCHED = + T.let(:REVERSAL_UNMATCHED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + SECURITY_VIOLATION = + T.let(:SECURITY_VIOLATION, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + SINGLE_USE_CARD_REATTEMPTED = + T.let(:SINGLE_USE_CARD_REATTEMPTED, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + TRANSACTION_INVALID = + T.let(:TRANSACTION_INVALID, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + TRANSACTION_PREVIOUSLY_COMPLETED = + T.let( + :TRANSACTION_PREVIOUSLY_COMPLETED, + Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + UNAUTHORIZED_MERCHANT = + T.let(:UNAUTHORIZED_MERCHANT, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + VEHICLE_NUMBER_INVALID = + T.let(:VEHICLE_NUMBER_INVALID, Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Event::RuleResult::Result::TaggedSymbol]) } + def self.values + end + end + end + + # Type of transaction event + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transaction::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transaction::Event::Type::TaggedSymbol) } + + AUTHORIZATION = T.let(:AUTHORIZATION, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + AUTHORIZATION_ADVICE = + T.let(:AUTHORIZATION_ADVICE, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + AUTHORIZATION_EXPIRY = + T.let(:AUTHORIZATION_EXPIRY, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + AUTHORIZATION_REVERSAL = + T.let(:AUTHORIZATION_REVERSAL, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + BALANCE_INQUIRY = T.let(:BALANCE_INQUIRY, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + CLEARING = T.let(:CLEARING, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + CORRECTION_CREDIT = T.let(:CORRECTION_CREDIT, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + CORRECTION_DEBIT = T.let(:CORRECTION_DEBIT, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + CREDIT_AUTHORIZATION = + T.let(:CREDIT_AUTHORIZATION, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + CREDIT_AUTHORIZATION_ADVICE = + T.let(:CREDIT_AUTHORIZATION_ADVICE, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + FINANCIAL_AUTHORIZATION = + T.let(:FINANCIAL_AUTHORIZATION, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let(:FINANCIAL_CREDIT_AUTHORIZATION, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + RETURN = T.let(:RETURN, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + RETURN_REVERSAL = T.let(:RETURN_REVERSAL, Lithic::Models::Transaction::Event::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transaction::Event::Type::TaggedSymbol]) } + def self.values + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_expire_authorization_params.rbi b/rbi/lib/lithic/models/transaction_expire_authorization_params.rbi new file mode 100644 index 00000000..4641a5f2 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_expire_authorization_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TransactionExpireAuthorizationParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_list_params.rbi b/rbi/lib/lithic/models/transaction_list_params.rbi new file mode 100644 index 00000000..5f36c320 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_list_params.rbi @@ -0,0 +1,161 @@ +# typed: strong + +module Lithic + module Models + class TransactionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Filters for transactions associated with a specific account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Filters for transactions associated with a specific card. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + sig { returns(T.nilable(Lithic::Models::TransactionListParams::Result::OrSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::TransactionListParams::Result::OrSymbol).void } + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Filters for transactions using transaction status field. + sig { returns(T.nilable(Lithic::Models::TransactionListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::TransactionListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::Models::TransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::TransactionListParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + account_token: nil, + begin_: nil, + card_token: nil, + end_: nil, + ending_before: nil, + page_size: nil, + result: nil, + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::Models::TransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::TransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::TransactionListParams::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::TransactionListParams::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::TransactionListParams::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::TransactionListParams::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::TransactionListParams::Result::TaggedSymbol]) } + def self.values + end + end + + # Filters for transactions using transaction status field. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::TransactionListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::TransactionListParams::Status::TaggedSymbol) } + + PENDING = T.let(:PENDING, Lithic::Models::TransactionListParams::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Models::TransactionListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::TransactionListParams::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::TransactionListParams::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Models::TransactionListParams::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::TransactionListParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_retrieve_params.rbi b/rbi/lib/lithic/models/transaction_retrieve_params.rbi new file mode 100644 index 00000000..a88d6489 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_retrieve_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TransactionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_authorization_advice_params.rbi b/rbi/lib/lithic/models/transaction_simulate_authorization_advice_params.rbi new file mode 100644 index 00000000..2230d44d --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_authorization_advice_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationAdviceParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The transaction token returned from the /v1/simulate/authorize. response. + sig { returns(String) } + attr_accessor :token + + # Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + sig { returns(Integer) } + attr_accessor :amount + + sig do + params( + token: String, + amount: Integer, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(token:, amount:, request_options: {}) + end + + sig { override.returns({token: String, amount: Integer, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_authorization_advice_response.rbi b/rbi/lib/lithic/models/transaction_simulate_authorization_advice_response.rbi new file mode 100644 index 00000000..05b4cd57 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_authorization_advice_response.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationAdviceResponse < Lithic::BaseModel + # A unique token to reference this transaction. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(token: String, debugging_request_id: String).returns(T.attached_class) } + def self.new(token: nil, debugging_request_id: nil) + end + + sig { override.returns({token: String, debugging_request_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_authorization_params.rbi b/rbi/lib/lithic/models/transaction_simulate_authorization_params.rbi new file mode 100644 index 00000000..309c3203 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_authorization_params.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + sig { returns(Integer) } + attr_accessor :amount + + # Merchant descriptor. + sig { returns(String) } + attr_accessor :descriptor + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + sig { returns(T.nilable(String)) } + attr_reader :mcc + + sig { params(mcc: String).void } + attr_writer :mcc + + # Unique identifier to identify the payment card acceptor. + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_id + + sig { params(merchant_acceptor_id: String).void } + attr_writer :merchant_acceptor_id + + # Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + sig { returns(T.nilable(Integer)) } + attr_reader :merchant_amount + + sig { params(merchant_amount: Integer).void } + attr_writer :merchant_amount + + # 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + sig { returns(T.nilable(String)) } + attr_reader :merchant_currency + + sig { params(merchant_currency: String).void } + attr_writer :merchant_currency + + # Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :partial_approval_capable + + sig { params(partial_approval_capable: T::Boolean).void } + attr_writer :partial_approval_capable + + # Simulate entering a PIN. If omitted, PIN check will not be performed. + sig { returns(T.nilable(String)) } + attr_reader :pin + + sig { params(pin: String).void } + attr_writer :pin + + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + sig { returns(T.nilable(Lithic::Models::TransactionSimulateAuthorizationParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::TransactionSimulateAuthorizationParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: T::Boolean, + pin: String, + status: Lithic::Models::TransactionSimulateAuthorizationParams::Status::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new( + amount:, + descriptor:, + pan:, + mcc: nil, + merchant_acceptor_id: nil, + merchant_amount: nil, + merchant_currency: nil, + partial_approval_capable: nil, + pin: nil, + status: nil, + request_options: {} + ) + end + + sig do + override + .returns( + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: T::Boolean, + pin: String, + status: Lithic::Models::TransactionSimulateAuthorizationParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + module Status + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status::TaggedSymbol) } + + AUTHORIZATION = + T.let(:AUTHORIZATION, Lithic::Models::TransactionSimulateAuthorizationParams::Status::TaggedSymbol) + BALANCE_INQUIRY = + T.let(:BALANCE_INQUIRY, Lithic::Models::TransactionSimulateAuthorizationParams::Status::TaggedSymbol) + CREDIT_AUTHORIZATION = + T.let(:CREDIT_AUTHORIZATION, Lithic::Models::TransactionSimulateAuthorizationParams::Status::TaggedSymbol) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::Models::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::Models::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ) + + sig { override.returns(T::Array[Lithic::Models::TransactionSimulateAuthorizationParams::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_authorization_response.rbi b/rbi/lib/lithic/models/transaction_simulate_authorization_response.rbi new file mode 100644 index 00000000..e0bf2669 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_authorization_response.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationResponse < Lithic::BaseModel + # A unique token to reference this transaction with later calls to void or clear + # the authorization. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(token: String, debugging_request_id: String).returns(T.attached_class) } + def self.new(token: nil, debugging_request_id: nil) + end + + sig { override.returns({token: String, debugging_request_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_clearing_params.rbi b/rbi/lib/lithic/models/transaction_simulate_clearing_params.rbi new file mode 100644 index 00000000..da54a7e8 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_clearing_params.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateClearingParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The transaction token returned from the /v1/simulate/authorize response. + sig { returns(String) } + attr_accessor :token + + # Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + sig do + params( + token: String, + amount: Integer, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(token:, amount: nil, request_options: {}) + end + + sig { override.returns({token: String, amount: Integer, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_clearing_response.rbi b/rbi/lib/lithic/models/transaction_simulate_clearing_response.rbi new file mode 100644 index 00000000..85893011 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_clearing_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateClearingResponse < Lithic::BaseModel + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(debugging_request_id: String).returns(T.attached_class) } + def self.new(debugging_request_id: nil) + end + + sig { override.returns({debugging_request_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_credit_authorization_params.rbi b/rbi/lib/lithic/models/transaction_simulate_credit_authorization_params.rbi new file mode 100644 index 00000000..48bbeda4 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_credit_authorization_params.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateCreditAuthorizationParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + sig { returns(Integer) } + attr_accessor :amount + + # Merchant descriptor. + sig { returns(String) } + attr_accessor :descriptor + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + sig { returns(T.nilable(String)) } + attr_reader :mcc + + sig { params(mcc: String).void } + attr_writer :mcc + + # Unique identifier to identify the payment card acceptor. + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_id + + sig { params(merchant_acceptor_id: String).void } + attr_writer :merchant_acceptor_id + + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {}) + end + + sig do + override + .returns( + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_credit_authorization_response.rbi b/rbi/lib/lithic/models/transaction_simulate_credit_authorization_response.rbi new file mode 100644 index 00000000..aa3151bc --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_credit_authorization_response.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateCreditAuthorizationResponse < Lithic::BaseModel + # A unique token to reference this transaction. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(token: String, debugging_request_id: String).returns(T.attached_class) } + def self.new(token: nil, debugging_request_id: nil) + end + + sig { override.returns({token: String, debugging_request_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_return_params.rbi b/rbi/lib/lithic/models/transaction_simulate_return_params.rbi new file mode 100644 index 00000000..907dcf2f --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_return_params.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount (in cents) to authorize. + sig { returns(Integer) } + attr_accessor :amount + + # Merchant descriptor. + sig { returns(String) } + attr_accessor :descriptor + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(amount:, descriptor:, pan:, request_options: {}) + end + + sig do + override + .returns({ + amount: Integer, + descriptor: String, + pan: String, + request_options: Lithic::RequestOptions + }) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_return_response.rbi b/rbi/lib/lithic/models/transaction_simulate_return_response.rbi new file mode 100644 index 00000000..20340a85 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_return_response.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnResponse < Lithic::BaseModel + # A unique token to reference this transaction. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(token: String, debugging_request_id: String).returns(T.attached_class) } + def self.new(token: nil, debugging_request_id: nil) + end + + sig { override.returns({token: String, debugging_request_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_return_reversal_params.rbi b/rbi/lib/lithic/models/transaction_simulate_return_reversal_params.rbi new file mode 100644 index 00000000..feccc334 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_return_reversal_params.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnReversalParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The transaction token returned from the /v1/simulate/authorize response. + sig { returns(String) } + attr_accessor :token + + sig do + params(token: String, request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + .returns(T.attached_class) + end + def self.new(token:, request_options: {}) + end + + sig { override.returns({token: String, request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_return_reversal_response.rbi b/rbi/lib/lithic/models/transaction_simulate_return_reversal_response.rbi new file mode 100644 index 00000000..4eda72d8 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_return_reversal_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnReversalResponse < Lithic::BaseModel + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(debugging_request_id: String).returns(T.attached_class) } + def self.new(debugging_request_id: nil) + end + + sig { override.returns({debugging_request_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_void_params.rbi b/rbi/lib/lithic/models/transaction_simulate_void_params.rbi new file mode 100644 index 00000000..9ed97f01 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_void_params.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateVoidParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # The transaction token returned from the /v1/simulate/authorize response. + sig { returns(String) } + attr_accessor :token + + # Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + sig { returns(T.nilable(Lithic::Models::TransactionSimulateVoidParams::Type::OrSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::TransactionSimulateVoidParams::Type::OrSymbol).void } + attr_writer :type + + sig do + params( + token: String, + amount: Integer, + type: Lithic::Models::TransactionSimulateVoidParams::Type::OrSymbol, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(token:, amount: nil, type: nil, request_options: {}) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + type: Lithic::Models::TransactionSimulateVoidParams::Type::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::TransactionSimulateVoidParams::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::TransactionSimulateVoidParams::Type::TaggedSymbol) } + + AUTHORIZATION_EXPIRY = + T.let(:AUTHORIZATION_EXPIRY, Lithic::Models::TransactionSimulateVoidParams::Type::TaggedSymbol) + AUTHORIZATION_REVERSAL = + T.let(:AUTHORIZATION_REVERSAL, Lithic::Models::TransactionSimulateVoidParams::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::TransactionSimulateVoidParams::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transaction_simulate_void_response.rbi b/rbi/lib/lithic/models/transaction_simulate_void_response.rbi new file mode 100644 index 00000000..cfea2502 --- /dev/null +++ b/rbi/lib/lithic/models/transaction_simulate_void_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateVoidResponse < Lithic::BaseModel + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(debugging_request_id: String).returns(T.attached_class) } + def self.new(debugging_request_id: nil) + end + + sig { override.returns({debugging_request_id: String}) } + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbi b/rbi/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbi new file mode 100644 index 00000000..b3e8e05e --- /dev/null +++ b/rbi/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + module Transactions + class EnhancedCommercialDataRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbi b/rbi/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbi new file mode 100644 index 00000000..71c3146d --- /dev/null +++ b/rbi/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Lithic + module Models + module Transactions + class EnhancedCommercialDataRetrieveResponse < Lithic::BaseModel + sig { returns(T::Array[Lithic::Models::Transactions::Events::EnhancedData]) } + attr_accessor :data + + sig do + params(data: T::Array[T.any(Lithic::Models::Transactions::Events::EnhancedData, Lithic::Util::AnyHash)]) + .returns(T.attached_class) + end + def self.new(data:) + end + + sig { override.returns({data: T::Array[Lithic::Models::Transactions::Events::EnhancedData]}) } + def to_hash + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbi b/rbi/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbi new file mode 100644 index 00000000..d03dd015 --- /dev/null +++ b/rbi/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + module Transactions + module Events + class EnhancedCommercialDataRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + sig do + params( + request_options: T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ).returns(T.attached_class) + end + def self.new(request_options: {}) + end + + sig { override.returns({request_options: Lithic::RequestOptions}) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transactions/events/enhanced_data.rbi b/rbi/lib/lithic/models/transactions/events/enhanced_data.rbi new file mode 100644 index 00000000..bc57e6f8 --- /dev/null +++ b/rbi/lib/lithic/models/transactions/events/enhanced_data.rbi @@ -0,0 +1,1069 @@ +# typed: strong + +module Lithic + module Models + module Transactions + module Events + class EnhancedData < Lithic::BaseModel + # A unique identifier for the enhanced commercial data. + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Models::Transactions::Events::EnhancedData::Common) } + attr_reader :common + + sig do + params(common: T.any(Lithic::Models::Transactions::Events::EnhancedData::Common, Lithic::Util::AnyHash)) + .void + end + attr_writer :common + + # The token of the event that the enhanced data is associated with. + sig { returns(String) } + attr_accessor :event_token + + sig { returns(T::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet]) } + attr_accessor :fleet + + # The token of the transaction that the enhanced data is associated with. + sig { returns(String) } + attr_accessor :transaction_token + + sig do + params( + token: String, + common: T.any(Lithic::Models::Transactions::Events::EnhancedData::Common, Lithic::Util::AnyHash), + event_token: String, + fleet: T::Array[T.any(Lithic::Models::Transactions::Events::EnhancedData::Fleet, Lithic::Util::AnyHash)], + transaction_token: String + ) + .returns(T.attached_class) + end + def self.new(token:, common:, event_token:, fleet:, transaction_token:) + end + + sig do + override + .returns( + { + token: String, + common: Lithic::Models::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: T::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet], + transaction_token: String + } + ) + end + def to_hash + end + + class Common < Lithic::BaseModel + sig { returns(T::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::LineItem]) } + attr_accessor :line_items + + sig { returns(Lithic::Models::Transactions::Events::EnhancedData::Common::Tax) } + attr_reader :tax + + sig do + params(tax: T.any(Lithic::Models::Transactions::Events::EnhancedData::Common::Tax, Lithic::Util::AnyHash)) + .void + end + attr_writer :tax + + # A customer identifier. + sig { returns(T.nilable(String)) } + attr_reader :customer_reference_number + + sig { params(customer_reference_number: String).void } + attr_writer :customer_reference_number + + # A merchant identifier. + sig { returns(T.nilable(String)) } + attr_reader :merchant_reference_number + + sig { params(merchant_reference_number: String).void } + attr_writer :merchant_reference_number + + # The date of the order. + sig { returns(T.nilable(Date)) } + attr_reader :order_date + + sig { params(order_date: Date).void } + attr_writer :order_date + + sig do + params( + line_items: T::Array[T.any(Lithic::Models::Transactions::Events::EnhancedData::Common::LineItem, Lithic::Util::AnyHash)], + tax: T.any(Lithic::Models::Transactions::Events::EnhancedData::Common::Tax, Lithic::Util::AnyHash), + customer_reference_number: String, + merchant_reference_number: String, + order_date: Date + ) + .returns(T.attached_class) + end + def self.new(line_items:, tax:, customer_reference_number: nil, merchant_reference_number: nil, order_date: nil) + end + + sig do + override + .returns( + { + line_items: T::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::LineItem], + tax: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax, + customer_reference_number: String, + merchant_reference_number: String, + order_date: Date + } + ) + end + def to_hash + end + + class LineItem < Lithic::BaseModel + # The price of the item purchased in merchant currency. + sig { returns(T.nilable(Float)) } + attr_reader :amount + + sig { params(amount: Float).void } + attr_writer :amount + + # A human-readable description of the item. + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + # An identifier for the item purchased. + sig { returns(T.nilable(String)) } + attr_reader :product_code + + sig { params(product_code: String).void } + attr_writer :product_code + + # The quantity of the item purchased. + sig { returns(T.nilable(Float)) } + attr_reader :quantity + + sig { params(quantity: Float).void } + attr_writer :quantity + + # An L2/L3 enhanced commercial data line item. + sig do + params( + amount: Float, + description: String, + product_code: String, + quantity: Float + ).returns(T.attached_class) + end + def self.new(amount: nil, description: nil, product_code: nil, quantity: nil) + end + + sig do + override.returns({amount: Float, description: String, product_code: String, quantity: Float}) + end + def to_hash + end + end + + class Tax < Lithic::BaseModel + # The amount of tax collected. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # A flag indicating whether the transaction is tax exempt or not. + sig { returns(T.nilable(Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol)) } + attr_reader :exempt + + sig { params(exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::OrSymbol).void } + attr_writer :exempt + + # The tax ID of the merchant. + sig { returns(T.nilable(String)) } + attr_reader :merchant_tax_id + + sig { params(merchant_tax_id: String).void } + attr_writer :merchant_tax_id + + sig do + params( + amount: Integer, + exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::OrSymbol, + merchant_tax_id: String + ) + .returns(T.attached_class) + end + def self.new(amount: nil, exempt: nil, merchant_tax_id: nil) + end + + sig do + override + .returns( + { + amount: Integer, + exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol, + merchant_tax_id: String + } + ) + end + def to_hash + end + + # A flag indicating whether the transaction is tax exempt or not. + module Exempt + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol) } + + TAX_INCLUDED = + T.let( + :TAX_INCLUDED, + Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ) + TAX_NOT_INCLUDED = + T.let( + :TAX_NOT_INCLUDED, + Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ) + NOT_SUPPORTED = + T.let( + :NOT_SUPPORTED, + Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol]) + end + def self.values + end + end + end + end + + class Fleet < Lithic::BaseModel + sig { returns(Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals) } + attr_reader :amount_totals + + sig do + params( + amount_totals: T.any(Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :amount_totals + + sig { returns(Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel) } + attr_reader :fuel + + sig do + params( + fuel: T.any(Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel, Lithic::Util::AnyHash) + ) + .void + end + attr_writer :fuel + + # The driver number entered into the terminal at the time of sale, with leading + # zeros stripped. + sig { returns(T.nilable(String)) } + attr_reader :driver_number + + sig { params(driver_number: String).void } + attr_writer :driver_number + + # The odometer reading entered into the terminal at the time of sale. + sig { returns(T.nilable(Integer)) } + attr_reader :odometer + + sig { params(odometer: Integer).void } + attr_writer :odometer + + # The type of fuel service. + sig { returns(T.nilable(Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol)) } + attr_reader :service_type + + sig { params(service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::OrSymbol).void } + attr_writer :service_type + + # The vehicle number entered into the terminal at the time of sale, with leading + # zeros stripped. + sig { returns(T.nilable(String)) } + attr_reader :vehicle_number + + sig { params(vehicle_number: String).void } + attr_writer :vehicle_number + + sig do + params( + amount_totals: T.any(Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals, Lithic::Util::AnyHash), + fuel: T.any(Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel, Lithic::Util::AnyHash), + driver_number: String, + odometer: Integer, + service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::OrSymbol, + vehicle_number: String + ) + .returns(T.attached_class) + end + def self.new(amount_totals:, fuel:, driver_number: nil, odometer: nil, service_type: nil, vehicle_number: nil) + end + + sig do + override + .returns( + { + amount_totals: Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals, + fuel: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel, + driver_number: String, + odometer: Integer, + service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol, + vehicle_number: String + } + ) + end + def to_hash + end + + class AmountTotals < Lithic::BaseModel + # The discount applied to the gross sale amount. + sig { returns(T.nilable(Integer)) } + attr_reader :discount + + sig { params(discount: Integer).void } + attr_writer :discount + + # The gross sale amount. + sig { returns(T.nilable(Integer)) } + attr_reader :gross_sale + + sig { params(gross_sale: Integer).void } + attr_writer :gross_sale + + # The amount after discount. + sig { returns(T.nilable(Integer)) } + attr_reader :net_sale + + sig { params(net_sale: Integer).void } + attr_writer :net_sale + + sig do + params(discount: Integer, gross_sale: Integer, net_sale: Integer).returns(T.attached_class) + end + def self.new(discount: nil, gross_sale: nil, net_sale: nil) + end + + sig { override.returns({discount: Integer, gross_sale: Integer, net_sale: Integer}) } + def to_hash + end + end + + class Fuel < Lithic::BaseModel + # The quantity of fuel purchased. + sig { returns(T.nilable(Float)) } + attr_reader :quantity + + sig { params(quantity: Float).void } + attr_writer :quantity + + # The type of fuel purchased. + sig { returns(T.nilable(Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::OrSymbol).void } + attr_writer :type + + # Unit of measure for fuel disbursement. + sig do + returns( + T.nilable(Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol) + ) + end + attr_reader :unit_of_measure + + sig do + params( + unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::OrSymbol + ) + .void + end + attr_writer :unit_of_measure + + # The price per unit of fuel. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_price + + sig { params(unit_price: Integer).void } + attr_writer :unit_price + + sig do + params( + quantity: Float, + type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::OrSymbol, + unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::OrSymbol, + unit_price: Integer + ) + .returns(T.attached_class) + end + def self.new(quantity: nil, type: nil, unit_of_measure: nil, unit_price: nil) + end + + sig do + override + .returns( + { + quantity: Float, + type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol, + unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol, + unit_price: Integer + } + ) + end + def to_hash + end + + # The type of fuel purchased. + module Type + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) } + + UNKNOWN = + T.let(:UNKNOWN, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + REGULAR = + T.let(:REGULAR, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MID_PLUS = + T.let(:MID_PLUS, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + PREMIUM_SUPER = + T.let(:PREMIUM_SUPER, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MID_PLUS_2 = + T.let(:MID_PLUS_2, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + PREMIUM_SUPER_2 = + T.let( + :PREMIUM_SUPER_2, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ETHANOL_5_7_BLEND = + T.let( + :ETHANOL_5_7_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_5_7_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ETHANOL_7_7_PERCENT_BLEND = + T.let( + :ETHANOL_7_7_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_7_7_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + GREEN_GASOLINE_REGULAR = + T.let( + :GREEN_GASOLINE_REGULAR, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + GREEN_GASOLINE_MID_PLUS = + T.let( + :GREEN_GASOLINE_MID_PLUS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + GREEN_GASOLINE_PREMIUM_SUPER = + T.let( + :GREEN_GASOLINE_PREMIUM_SUPER, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_DIESEL_2 = + T.let( + :REGULAR_DIESEL_2, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_2 = + T.let( + :PREMIUM_DIESEL_2, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_DIESEL_1 = + T.let( + :REGULAR_DIESEL_1, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + COMPRESSED_NATURAL_GAS = + T.let( + :COMPRESSED_NATURAL_GAS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + LIQUID_PROPANE_GAS = + T.let( + :LIQUID_PROPANE_GAS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + LIQUID_NATURAL_GAS = + T.let( + :LIQUID_NATURAL_GAS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + E_85 = T.let(:E_85, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + REFORMULATED_1 = + T.let( + :REFORMULATED_1, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_2 = + T.let( + :REFORMULATED_2, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_3 = + T.let( + :REFORMULATED_3, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_4 = + T.let( + :REFORMULATED_4, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_5 = + T.let( + :REFORMULATED_5, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE = + T.let( + :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + UNDEFINED_FUEL = + T.let( + :UNDEFINED_FUEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RACING_FUEL = + T.let(:RACING_FUEL, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MID_PLUS_2_10_PERCENT_BLEND = + T.let( + :MID_PLUS_2_10_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_2_10_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_2_10_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_2_15_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_ETHANOL_10_PERCENT_BLEND = + T.let( + :REGULAR_ETHANOL_10_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_10_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_10_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B2_DIESEL_BLEND_2_PERCENT_BIODIESEL = + T.let( + :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B5_DIESEL_BLEND_5_PERCENT_BIODIESEL = + T.let( + :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B10_DIESEL_BLEND_10_PERCENT_BIODIESEL = + T.let( + :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B11_DIESEL_BLEND_11_PERCENT_BIODIESEL = + T.let( + :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B15_DIESEL_BLEND_15_PERCENT_BIODIESEL = + T.let( + :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B20_DIESEL_BLEND_20_PERCENT_BIODIESEL = + T.let( + :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B100_DIESEL_BLEND_100_PERCENT_BIODIESEL = + T.let( + :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B1_DIESEL_BLEND_1_PERCENT_BIODIESEL = + T.let( + :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ADDITIZED_DIESEL_2 = + T.let( + :ADDITIZED_DIESEL_2, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ADDITIZED_DIESEL_3 = + T.let( + :ADDITIZED_DIESEL_3, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RENEWABLE_DIESEL_R95 = + T.let( + :RENEWABLE_DIESEL_R95, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT = + T.let( + :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_EXHAUST_FLUID = + T.let( + :DIESEL_EXHAUST_FLUID, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_1 = + T.let( + :PREMIUM_DIESEL_1, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_ETHANOL_15_PERCENT_BLEND = + T.let( + :REGULAR_ETHANOL_15_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_15_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_15_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL = + T.let( + :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL = + T.let( + :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B75_DIESEL_BLEND_75_PERCENT_BIODIESEL = + T.let( + :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B99_DIESEL_BLEND_99_PERCENT_BIODIESEL = + T.let( + :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MISCELLANEOUS_FUEL = + T.let( + :MISCELLANEOUS_FUEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + JET_FUEL = + T.let(:JET_FUEL, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + AVIATION_FUEL_REGULAR = + T.let( + :AVIATION_FUEL_REGULAR, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_PREMIUM = + T.let( + :AVIATION_FUEL_PREMIUM, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_JP8 = + T.let( + :AVIATION_FUEL_JP8, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_4 = + T.let( + :AVIATION_FUEL_4, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_5 = + T.let( + :AVIATION_FUEL_5, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIOJET_DIESEL = + T.let(:BIOJET_DIESEL, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + AVIATION_BIOFUEL_GASOLINE = + T.let( + :AVIATION_BIOFUEL_GASOLINE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MISCELLANEOUS_AVIATION_FUEL = + T.let( + :MISCELLANEOUS_AVIATION_FUEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_FUEL_1 = + T.let(:MARINE_FUEL_1, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MARINE_FUEL_2 = + T.let(:MARINE_FUEL_2, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MARINE_FUEL_3 = + T.let(:MARINE_FUEL_3, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MARINE_FUEL_4 = + T.let(:MARINE_FUEL_4, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MARINE_FUEL_5 = + T.let(:MARINE_FUEL_5, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MARINE_OTHER = + T.let(:MARINE_OTHER, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MARINE_DIESEL = + T.let(:MARINE_DIESEL, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + MISCELLANEOUS_MARINE_FUEL = + T.let( + :MISCELLANEOUS_MARINE_FUEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_LOW_SULFUR = + T.let( + :KEROSENE_LOW_SULFUR, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + WHITE_GAS = + T.let(:WHITE_GAS, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + HEATING_OIL = + T.let(:HEATING_OIL, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + OTHER_FUEL_NON_TAXABLE = + T.let( + :OTHER_FUEL_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_ULTRA_LOW_SULFUR = + T.let( + :KEROSENE_ULTRA_LOW_SULFUR, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_LOW_SULFUR_NON_TAXABLE = + T.let( + :KEROSENE_LOW_SULFUR_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE = + T.let( + :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + EVC_1_LEVEL_1_CHARGE_110_V_15_AMP = + T.let( + :EVC_1_LEVEL_1_CHARGE_110V_15_AMP, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + EVC_2_LEVEL_2_CHARGE_240_V_15_40_AMP = + T.let( + :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + EVC_3_LEVEL_3_CHARGE_480_V_3_PHASE_CHARGE = + T.let( + :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_1_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_1_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_2_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_2_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ADDITIVE_DOSAGE = + T.let( + :ADDITIVE_DOSAGE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ETHANOL_BLENDS_E16_E84 = + T.let( + :ETHANOL_BLENDS_E16_E84, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + LOW_OCTANE_UNL = + T.let( + :LOW_OCTANE_UNL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BLENDED_DIESEL_1_AND_2 = + T.let( + :BLENDED_DIESEL_1_AND_2, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_REGULAR_NON_TAXABLE = + T.let( + :OFF_ROAD_REGULAR_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_MID_PLUS_NON_TAXABLE = + T.let( + :OFF_ROAD_MID_PLUS_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE = + T.let( + :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_MID_PLUS_2_NON_TAXABLE = + T.let( + :OFF_ROAD_MID_PLUS_2_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE = + T.let( + :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RECREATIONAL_FUEL_90_OCTANE = + T.let( + :RECREATIONAL_FUEL_90_OCTANE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + HYDROGEN_H35 = + T.let(:HYDROGEN_H35, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + HYDROGEN_H70 = + T.let(:HYDROGEN_H70, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol) + RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE = + T.let( + :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MISCELLANEOUS_OTHER_FUEL = + T.let( + :MISCELLANEOUS_OTHER_FUEL, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol]) + end + def self.values + end + end + + # Unit of measure for fuel disbursement. + module UnitOfMeasure + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure) } + OrSymbol = + T.type_alias do + T.any( + Symbol, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + end + + GALLONS = + T.let( + :GALLONS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + LITERS = + T.let( + :LITERS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + POUNDS = + T.let( + :POUNDS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + KILOGRAMS = + T.let( + :KILOGRAMS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + IMPERIAL_GALLONS = + T.let( + :IMPERIAL_GALLONS, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + NOT_APPLICABLE = + T.let( + :NOT_APPLICABLE, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol] + ) + end + def self.values + end + end + end + + # The type of fuel service. + module ServiceType + extend Lithic::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType) } + OrSymbol = + T.type_alias { T.any(Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol) } + + UNKNOWN = + T.let(:UNKNOWN, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol) + UNDEFINED = + T.let(:UNDEFINED, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol) + SELF_SERVICE = + T.let(:SELF_SERVICE, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol) + FULL_SERVICE = + T.let(:FULL_SERVICE, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol) + NON_FUEL_ONLY = + T.let( + :NON_FUEL_ONLY, + Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ) + + sig do + override + .returns(T::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol]) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transfer.rbi b/rbi/lib/lithic/models/transfer.rbi new file mode 100644 index 00000000..b22a6c7c --- /dev/null +++ b/rbi/lib/lithic/models/transfer.rbi @@ -0,0 +1,422 @@ +# typed: strong + +module Lithic + module Models + class Transfer < Lithic::BaseModel + # Globally unique identifier for the transfer event. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + sig { returns(T.nilable(Lithic::Models::Transfer::Category::TaggedSymbol)) } + attr_reader :category + + sig { params(category: Lithic::Models::Transfer::Category::OrSymbol).void } + attr_writer :category + + # Date and time when the transfer occurred. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # A string that provides a description of the transfer; may be useful to display + # to users. + sig { returns(T.nilable(String)) } + attr_reader :descriptor + + sig { params(descriptor: String).void } + attr_writer :descriptor + + # A list of all financial events that have modified this trasnfer. + sig { returns(T.nilable(T::Array[Lithic::Models::Transfer::Event])) } + attr_reader :events + + sig { params(events: T::Array[T.any(Lithic::Models::Transfer::Event, Lithic::Util::AnyHash)]).void } + attr_writer :events + + # The updated balance of the sending financial account. + sig { returns(T.nilable(T::Array[Lithic::Models::Balance])) } + attr_reader :from_balance + + sig { params(from_balance: T::Array[T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)]).void } + attr_writer :from_balance + + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + sig { returns(T.nilable(Integer)) } + attr_reader :pending_amount + + sig { params(pending_amount: Integer).void } + attr_writer :pending_amount + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + sig { returns(T.nilable(Lithic::Models::Transfer::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::Transfer::Result::OrSymbol).void } + attr_writer :result + + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents). + sig { returns(T.nilable(Integer)) } + attr_reader :settled_amount + + sig { params(settled_amount: Integer).void } + attr_writer :settled_amount + + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + sig { returns(T.nilable(Lithic::Models::Transfer::Status::TaggedSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Models::Transfer::Status::OrSymbol).void } + attr_writer :status + + # The updated balance of the receiving financial account. + sig { returns(T.nilable(T::Array[Lithic::Models::Balance])) } + attr_reader :to_balance + + sig { params(to_balance: T::Array[T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)]).void } + attr_writer :to_balance + + # Date and time when the financial transaction was last updated. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :updated + + sig { params(updated: Time).void } + attr_writer :updated + + sig do + params( + token: String, + category: Lithic::Models::Transfer::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[T.any(Lithic::Models::Transfer::Event, Lithic::Util::AnyHash)], + from_balance: T::Array[T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)], + pending_amount: Integer, + result: Lithic::Models::Transfer::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::Models::Transfer::Status::OrSymbol, + to_balance: T::Array[T.any(Lithic::Models::Balance, Lithic::Util::AnyHash)], + updated: Time + ) + .returns(T.attached_class) + end + def self.new( + token: nil, + category: nil, + created: nil, + currency: nil, + descriptor: nil, + events: nil, + from_balance: nil, + pending_amount: nil, + result: nil, + settled_amount: nil, + status: nil, + to_balance: nil, + updated: nil + ) + end + + sig do + override + .returns( + { + token: String, + category: Lithic::Models::Transfer::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::Models::Transfer::Event], + from_balance: T::Array[Lithic::Models::Balance], + pending_amount: Integer, + result: Lithic::Models::Transfer::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::Models::Transfer::Status::TaggedSymbol, + to_balance: T::Array[Lithic::Models::Balance], + updated: Time + } + ) + end + def to_hash + end + + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + module Category + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transfer::Category) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transfer::Category::TaggedSymbol) } + + TRANSFER = T.let(:TRANSFER, Lithic::Models::Transfer::Category::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transfer::Category::TaggedSymbol]) } + def self.values + end + end + + class Event < Lithic::BaseModel + # Globally unique identifier. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # Date and time when the financial event occurred. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + sig { returns(T.nilable(Lithic::Models::Transfer::Event::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Models::Transfer::Event::Result::OrSymbol).void } + attr_writer :result + + sig { returns(T.nilable(Lithic::Models::Transfer::Event::Type::TaggedSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Models::Transfer::Event::Type::OrSymbol).void } + attr_writer :type + + sig do + params( + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Transfer::Event::Result::OrSymbol, + type: Lithic::Models::Transfer::Event::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(token: nil, amount: nil, created: nil, result: nil, type: nil) + end + + sig do + override + .returns( + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Transfer::Event::Result::TaggedSymbol, + type: Lithic::Models::Transfer::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transfer::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transfer::Event::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::Transfer::Event::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Transfer::Event::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transfer::Event::Result::TaggedSymbol]) } + def self.values + end + end + + module Type + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transfer::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transfer::Event::Type::TaggedSymbol) } + + ACH_ORIGINATION_CANCELLED = + T.let(:ACH_ORIGINATION_CANCELLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_ORIGINATION_INITIATED = + T.let(:ACH_ORIGINATION_INITIATED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_ORIGINATION_PROCESSED = + T.let(:ACH_ORIGINATION_PROCESSED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_ORIGINATION_RELEASED = + T.let(:ACH_ORIGINATION_RELEASED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_ORIGINATION_REVIEWED = + T.let(:ACH_ORIGINATION_REVIEWED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_ORIGINATION_SETTLED = + T.let(:ACH_ORIGINATION_SETTLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_RECEIPT_PROCESSED = + T.let(:ACH_RECEIPT_PROCESSED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_RECEIPT_SETTLED = T.let(:ACH_RECEIPT_SETTLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_RETURN_INITIATED = T.let(:ACH_RETURN_INITIATED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_RETURN_PROCESSED = T.let(:ACH_RETURN_PROCESSED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + ACH_RETURN_SETTLED = T.let(:ACH_RETURN_SETTLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + AUTHORIZATION = T.let(:AUTHORIZATION, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + AUTHORIZATION_ADVICE = T.let(:AUTHORIZATION_ADVICE, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + AUTHORIZATION_EXPIRY = T.let(:AUTHORIZATION_EXPIRY, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + AUTHORIZATION_REVERSAL = + T.let(:AUTHORIZATION_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + BALANCE_INQUIRY = T.let(:BALANCE_INQUIRY, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + BILLING_ERROR = T.let(:BILLING_ERROR, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + BILLING_ERROR_REVERSAL = + T.let(:BILLING_ERROR_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CARD_TO_CARD = T.let(:CARD_TO_CARD, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CASH_BACK = T.let(:CASH_BACK, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CASH_BACK_REVERSAL = T.let(:CASH_BACK_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CLEARING = T.let(:CLEARING, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CORRECTION_CREDIT = T.let(:CORRECTION_CREDIT, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CORRECTION_DEBIT = T.let(:CORRECTION_DEBIT, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CREDIT_AUTHORIZATION = T.let(:CREDIT_AUTHORIZATION, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CREDIT_AUTHORIZATION_ADVICE = + T.let(:CREDIT_AUTHORIZATION_ADVICE, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CURRENCY_CONVERSION = T.let(:CURRENCY_CONVERSION, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + CURRENCY_CONVERSION_REVERSAL = + T.let(:CURRENCY_CONVERSION_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + DISPUTE_WON = T.let(:DISPUTE_WON, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_ACH_CANCELED = + T.let(:EXTERNAL_ACH_CANCELED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_ACH_INITIATED = + T.let(:EXTERNAL_ACH_INITIATED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_ACH_RELEASED = + T.let(:EXTERNAL_ACH_RELEASED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_ACH_REVERSED = + T.let(:EXTERNAL_ACH_REVERSED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_ACH_SETTLED = T.let(:EXTERNAL_ACH_SETTLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_CANCELED = + T.let(:EXTERNAL_CHECK_CANCELED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_INITIATED = + T.let(:EXTERNAL_CHECK_INITIATED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_RELEASED = + T.let(:EXTERNAL_CHECK_RELEASED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_REVERSED = + T.let(:EXTERNAL_CHECK_REVERSED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_CHECK_SETTLED = + T.let(:EXTERNAL_CHECK_SETTLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_CANCELED = + T.let(:EXTERNAL_TRANSFER_CANCELED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_INITIATED = + T.let(:EXTERNAL_TRANSFER_INITIATED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_RELEASED = + T.let(:EXTERNAL_TRANSFER_RELEASED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_REVERSED = + T.let(:EXTERNAL_TRANSFER_REVERSED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_TRANSFER_SETTLED = + T.let(:EXTERNAL_TRANSFER_SETTLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_CANCELED = + T.let(:EXTERNAL_WIRE_CANCELED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_INITIATED = + T.let(:EXTERNAL_WIRE_INITIATED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_RELEASED = + T.let(:EXTERNAL_WIRE_RELEASED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_REVERSED = + T.let(:EXTERNAL_WIRE_REVERSED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + EXTERNAL_WIRE_SETTLED = + T.let(:EXTERNAL_WIRE_SETTLED, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + FINANCIAL_AUTHORIZATION = + T.let(:FINANCIAL_AUTHORIZATION, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let(:FINANCIAL_CREDIT_AUTHORIZATION, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + INTEREST = T.let(:INTEREST, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + INTEREST_REVERSAL = T.let(:INTEREST_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + INTERNAL_ADJUSTMENT = T.let(:INTERNAL_ADJUSTMENT, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + LATE_PAYMENT = T.let(:LATE_PAYMENT, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + LATE_PAYMENT_REVERSAL = + T.let(:LATE_PAYMENT_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + PROVISIONAL_CREDIT = T.let(:PROVISIONAL_CREDIT, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + PROVISIONAL_CREDIT_REVERSAL = + T.let(:PROVISIONAL_CREDIT_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + RETURN = T.let(:RETURN, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + RETURN_REVERSAL = T.let(:RETURN_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + TRANSFER_INSUFFICIENT_FUNDS = + T.let(:TRANSFER_INSUFFICIENT_FUNDS, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + RETURNED_PAYMENT = T.let(:RETURNED_PAYMENT, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + RETURNED_PAYMENT_REVERSAL = + T.let(:RETURNED_PAYMENT_REVERSAL, Lithic::Models::Transfer::Event::Type::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transfer::Event::Type::TaggedSymbol]) } + def self.values + end + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transfer::Result) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transfer::Result::TaggedSymbol) } + + APPROVED = T.let(:APPROVED, Lithic::Models::Transfer::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Models::Transfer::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transfer::Result::TaggedSymbol]) } + def self.values + end + end + + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + module Status + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::Transfer::Status) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::Transfer::Status::TaggedSymbol) } + + DECLINED = T.let(:DECLINED, Lithic::Models::Transfer::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Models::Transfer::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Models::Transfer::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Models::Transfer::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Models::Transfer::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::Transfer::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lib/lithic/models/transfer_create_params.rbi b/rbi/lib/lithic/models/transfer_create_params.rbi new file mode 100644 index 00000000..f4660e4e --- /dev/null +++ b/rbi/lib/lithic/models/transfer_create_params.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Lithic + module Models + class TransferCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + sig { returns(Integer) } + attr_accessor :amount + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :from + + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :to + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Optional descriptor for the transfer. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + amount: Integer, + from: String, + to: String, + token: String, + memo: String, + request_options: T.any(Lithic::RequestOptions, Lithic::Util::AnyHash) + ) + .returns(T.attached_class) + end + def self.new(amount:, from:, to:, token: nil, memo: nil, request_options: {}) + end + + sig do + override + .returns( + { + amount: Integer, + from: String, + to: String, + token: String, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lib/lithic/models/verification_method.rbi b/rbi/lib/lithic/models/verification_method.rbi new file mode 100644 index 00000000..f8db2dca --- /dev/null +++ b/rbi/lib/lithic/models/verification_method.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Models + module VerificationMethod + extend Lithic::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Models::VerificationMethod) } + OrSymbol = T.type_alias { T.any(Symbol, Lithic::Models::VerificationMethod::TaggedSymbol) } + + MANUAL = T.let(:MANUAL, Lithic::Models::VerificationMethod::TaggedSymbol) + MICRO_DEPOSIT = T.let(:MICRO_DEPOSIT, Lithic::Models::VerificationMethod::TaggedSymbol) + PLAID = T.let(:PLAID, Lithic::Models::VerificationMethod::TaggedSymbol) + PRENOTE = T.let(:PRENOTE, Lithic::Models::VerificationMethod::TaggedSymbol) + EXTERNALLY_VERIFIED = T.let(:EXTERNALLY_VERIFIED, Lithic::Models::VerificationMethod::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Models::VerificationMethod::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/lib/lithic/pooled_net_requester.rbi b/rbi/lib/lithic/pooled_net_requester.rbi new file mode 100644 index 00000000..8140ea08 --- /dev/null +++ b/rbi/lib/lithic/pooled_net_requester.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + # @api private + class PooledNetRequester + RequestShape = + T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + deadline: Float + } + end + + # from the golang stdlib + # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 + KEEP_ALIVE_TIMEOUT = 30 + + class << self + # @api private + sig { params(url: URI::Generic).returns(Net::HTTP) } + def connect(url) + end + + # @api private + sig { params(conn: Net::HTTP, deadline: Float).void } + def calibrate_socket_timeout(conn, deadline) + end + + # @api private + sig do + params(request: Lithic::PooledNetRequester::RequestShape, blk: T.proc.params(arg0: String).void) + .returns(Net::HTTPGenericRequest) + end + def build_request(request, &blk) + end + end + + # @api private + sig { params(url: URI::Generic, deadline: Float, blk: T.proc.params(arg0: Net::HTTP).void).void } + private def with_pool(url, deadline:, &blk) + end + + # @api private + sig do + params(request: Lithic::PooledNetRequester::RequestShape) + .returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + def execute(request) + end + + # @api private + sig { params(size: Integer).returns(T.attached_class) } + def self.new(size: Etc.nprocessors) + end + end +end diff --git a/rbi/lib/lithic/request_options.rbi b/rbi/lib/lithic/request_options.rbi new file mode 100644 index 00000000..18a65736 --- /dev/null +++ b/rbi/lib/lithic/request_options.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Lithic + # @api private + module RequestParameters + # Options to specify HTTP behaviour for this request. + sig { returns(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) } + attr_accessor :request_options + + # @api private + module Converter + # @api private + sig { params(params: T.anything).returns([T.anything, Lithic::Util::AnyHash]) } + def dump_request(params) + end + end + end + + # Specify HTTP behaviour to use for a specific request. These options supplement + # or override those provided at the client level. + # + # When making a request, you can pass an actual {RequestOptions} instance, or + # simply pass a Hash with symbol keys matching the attributes on this class. + class RequestOptions < Lithic::BaseModel + # @api private + sig { params(opts: T.any(T.self_type, T::Hash[Symbol, T.anything])).void } + def self.validate!(opts) + end + + # Idempotency key to send with request and all associated retries. Will only be + # sent for write requests. + sig { returns(T.nilable(String)) } + attr_accessor :idempotency_key + + # Extra query params to send with the request. These are `.merge`’d into any + # `query` given at the client level. + sig { returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) } + attr_accessor :extra_query + + # Extra headers to send with the request. These are `.merged`’d into any + # `extra_headers` given at the client level. + sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) } + attr_accessor :extra_headers + + # Extra data to send with the request. These are deep merged into any data + # generated as part of the normal request. + sig { returns(T.nilable(T.anything)) } + attr_accessor :extra_body + + # Maximum number of retries to attempt after a failed initial request. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_retries + + # Request timeout in seconds. + sig { returns(T.nilable(Float)) } + attr_accessor :timeout + + # Returns a new instance of RequestOptions. + sig { params(values: Lithic::Util::AnyHash).returns(T.attached_class) } + def self.new(values = {}) + end + end +end diff --git a/rbi/lib/lithic/resources/account_holders.rbi b/rbi/lib/lithic/resources/account_holders.rbi new file mode 100644 index 00000000..7f2cea4c --- /dev/null +++ b/rbi/lib/lithic/resources/account_holders.rbi @@ -0,0 +1,437 @@ +# typed: strong + +module Lithic + module Resources + class AccountHolders + # Create an account holder and initiate the appropriate onboarding workflow. + # Account holders and accounts have a 1:1 relationship. When an account holder is + # successfully created an associated account is also created. All calls to this + # endpoint will return an immediate response - though in some cases, the response + # may indicate the enrollment is under review or further action will be needed to + # complete the account enrollment process. This endpoint can only be used on + # accounts that are part of the program that the calling API key manages. + sig do + params( + beneficial_owner_entities: T::Array[T.any(Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual, Lithic::Util::AnyHash)], + business_entity: T.any(Lithic::Models::AccountHolderCreateParams::BusinessEntity, Lithic::Util::AnyHash), + control_person: T.any(Lithic::Models::AccountHolderCreateParams::ControlPerson, Lithic::Util::AnyHash), + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::AccountHolderCreateParams::Workflow::OrSymbol, + individual: T.any(Lithic::Models::AccountHolderCreateParams::Individual, Lithic::Util::AnyHash), + address: T.any(Lithic::Models::Address, Lithic::Util::AnyHash), + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::AccountHolderCreateParams::KYCExemptionType::OrSymbol, + last_name: String, + phone_number: String, + external_id: String, + kyb_passed_timestamp: String, + website_url: String, + kyc_passed_timestamp: String, + business_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AccountHolderCreateResponse) + end + def create( + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background. If no business owner is an entity, pass in an + # empty list. However, either this parameter or `beneficial_owner_individuals` + # must be populated. on entities that should be included. + beneficial_owner_entities:, + # List of all direct and indirect individuals with >25% ownership in the company. + # If no entity or individual owns >25% of the company, and the largest shareholder + # is an individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. If no + # individual is an entity, pass in an empty list. However, either this parameter + # or `beneficial_owner_entities` must be populated. + beneficial_owner_individuals:, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity:, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person:, + # Short description of the company's line of business (i.e., what does the company + # do?). + nature_of_business:, + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + tos_timestamp:, + # Specifies the workflow type. This must be 'KYC_EXEMPT' + workflow:, + # Information on individual for whom the account is being opened and KYC is being + # run. + individual:, + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + address:, + # The KYC Exempt user's email + email:, + # The KYC Exempt user's first name + first_name:, + # Specifies the type of KYC Exempt user + kyc_exemption_type:, + # The KYC Exempt user's last name + last_name:, + # The KYC Exempt user's phone number, entered in E.164 format. + phone_number:, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + kyb_passed_timestamp: nil, + # Company website URL. + website_url: nil, + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + kyc_passed_timestamp: nil, + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + business_account_token: nil, + request_options: {} + ) + end + + # Get an Individual or Business Account Holder and/or their KYC or KYB evaluation + # status. + sig do + params( + account_holder_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AccountHolder) + end + def retrieve( + # Globally unique identifier for the account holder. + account_holder_token, + request_options: {} + ) + end + + # Update the information associated with a particular account holder (including + # business owners and control persons associated to a business account). If Lithic + # is performing KYB or KYC and additional verification is required we will run the + # individual's or business's updated information again and return whether the + # status is accepted or pending (i.e., further action required). All calls to this + # endpoint will return an immediate response - though in some cases, the response + # may indicate the workflow is under review or further action will be needed to + # complete the evaluation process. This endpoint can only be used on existing + # accounts that are part of the program that the calling API key manages. + sig do + params( + account_holder_token: String, + beneficial_owner_entities: T::Array[T.any(Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity, Lithic::Util::AnyHash)], + beneficial_owner_individuals: T::Array[T.any(Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual, Lithic::Util::AnyHash)], + business_entity: T.any(Lithic::Models::AccountHolderUpdateParams::BusinessEntity, Lithic::Util::AnyHash), + control_person: T.any(Lithic::Models::AccountHolderUpdateParams::ControlPerson, Lithic::Util::AnyHash), + external_id: String, + nature_of_business: String, + website_url: String, + individual: T.any(Lithic::Models::AccountHolderUpdateParams::Individual, Lithic::Util::AnyHash), + address: T.any(Lithic::Models::AddressUpdate, Lithic::Util::AnyHash), + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns( + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, + Lithic::Models::AccountHolderUpdateResponse::PatchResponse + ) + ) + end + def update( + # Globally unique identifier for the account holder. + account_holder_token, + # List of all entities with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an entity, + # please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background. If no business owner is an entity, pass in an empty + # list. However, either this parameter or `beneficial_owner_individuals` must be + # populated. on entities that should be included. + beneficial_owner_entities: nil, + # List of all individuals with >25% ownership in the company. If no entity or + # individual owns >25% of the company, and the largest shareholder is an + # individual, please identify them in this field. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf)(Section + # I) for more background on individuals that should be included. If no individual + # is an entity, pass in an empty list. However, either this parameter or + # `beneficial_owner_entities` must be populated. + beneficial_owner_individuals: nil, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity: nil, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # Short description of the company's line of business (i.e., what does the company + # do?). + nature_of_business: nil, + # Company website URL. + website_url: nil, + # Information on the individual for whom the account is being opened and KYC is + # being run. + individual: nil, + # Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + address: nil, + # Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # account holder is associated. + business_account_token: nil, + # Allowed for all Account Holders. Account holder's email address. The primary + # purpose of this field is for cardholder identification and verification during + # the digital wallet tokenization process. + email: nil, + # Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + first_name: nil, + # Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + last_name: nil, + # Allowed for BYO-KYB. Legal business name of the account holder. + legal_business_name: nil, + # Allowed for all Account Holders. Account holder's phone number, entered in E.164 + # format. The primary purpose of this field is for cardholder identification and + # verification during the digital wallet tokenization process. + phone_number: nil, + request_options: {} + ) + end + + # Get a list of individual or business account holders and their KYC or KYB + # evaluation status. + sig do + params( + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::AccountHolder]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Email address of the account holder. The query must be an exact match, case + # insensitive. + email: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # If applicable, represents the external_id associated with the account_holder. + external_id: nil, + # (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + first_name: nil, + # (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + last_name: nil, + # (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + legal_business_name: nil, + # The number of account_holders to limit the response to. + limit: nil, + # Phone number of the account holder. The query must be an exact match. + phone_number: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Retrieve the status of account holder document uploads, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a previous account holder document upload has + # failed, you can use this endpoint to get a new upload URL for the failed image + # upload. + # + # When a new document upload is generated for a failed attempt, the response will + # show an additional entry in the `required_document_uploads` list in a `PENDING` + # state for the corresponding `image_type`. + sig do + params( + account_holder_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AccountHolderListDocumentsResponse) + end + def list_documents( + # Globally unique identifier for the account holder. + account_holder_token, + request_options: {} + ) + end + + # Check the status of an account holder document upload, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a document upload has failed, you can use this + # endpoint to get a new upload URL for the failed image upload. + # + # When a new account holder document upload is generated for a failed attempt, the + # response will show an additional entry in the `required_document_uploads` array + # in a `PENDING` state for the corresponding `image_type`. + sig do + params( + document_token: String, + account_holder_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Document) + end + def retrieve_document( + # Globally unique identifier for the document. + document_token, + # Globally unique identifier for the account holder. + account_holder_token:, + request_options: {} + ) + end + + # Simulates a review for an account holder document upload. + sig do + params( + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol, + accepted_entity_status_reasons: T::Array[String], + status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Document) + end + def simulate_enrollment_document_review( + # The account holder document upload which to perform the simulation upon. + document_upload_token:, + # An account holder document's upload status for use within the simulation. + status:, + # A list of status reasons associated with a KYB account holder in PENDING_REVIEW + accepted_entity_status_reasons: nil, + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + status_reason: nil, + request_options: {} + ) + end + + # Simulates an enrollment review for an account holder. This endpoint is only + # applicable for workflows that may required intervention such as `KYB_BASIC`. + sig do + params( + account_holder_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol, + status_reasons: T::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse) + end + def simulate_enrollment_review( + # The account holder which to perform the simulation upon. + account_holder_token: nil, + # An account holder's status for use within the simulation. + status: nil, + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + status_reasons: nil, + request_options: {} + ) + end + + # Use this endpoint to identify which type of supported government-issued + # documentation you will upload for further verification. It will return two URLs + # to upload your document images to - one for the front image and one for the back + # image. + # + # This endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state. + # + # Uploaded images must either be a `jpg` or `png` file, and each must be less than + # 15 MiB. Once both required uploads have been successfully completed, your + # document will be run through KYC verification. + # + # If you have registered a webhook, you will receive evaluation updates for any + # document submission evaluations, as well as for any failed document uploads. + # + # Two document submission attempts are permitted via this endpoint before a + # `REJECTED` status is returned and the account creation process is ended. + # Currently only one type of account holder document is supported per KYC + # verification. + sig do + params( + account_holder_token: String, + document_type: Lithic::Models::AccountHolderUploadDocumentParams::DocumentType::OrSymbol, + entity_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Document) + end + def upload_document( + # Globally unique identifier for the account holder. + account_holder_token, + # The type of document to upload + document_type:, + # Globally unique identifier for the entity. + entity_token:, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/accounts.rbi b/rbi/lib/lithic/resources/accounts.rbi new file mode 100644 index 00000000..ae2d5b10 --- /dev/null +++ b/rbi/lib/lithic/resources/accounts.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Lithic + module Resources + class Accounts + # Get account configuration such as spend limits. + sig do + params( + account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Account) + end + def retrieve( + # Globally unique identifier for account. + account_token, + request_options: {} + ) + end + + # Update account configuration such as state or spend limits. Can only be run on + # accounts that are part of the program managed by this API key. Accounts that are + # in the `PAUSED` state will not be able to transact or create new cards. + sig do + params( + account_token: String, + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::Models::AccountUpdateParams::State::OrSymbol, + verification_address: T.any(Lithic::Models::AccountUpdateParams::VerificationAddress, Lithic::Util::AnyHash), + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Account) + end + def update( + # Globally unique identifier for account. + account_token, + # Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + daily_spend_limit: nil, + # Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + lifetime_spend_limit: nil, + # Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + monthly_spend_limit: nil, + # Account states. + state: nil, + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Authorization Rules. The field will be removed from + # the schema in a future release. + verification_address: nil, + request_options: {} + ) + end + + # List account configurations. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Account]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Get an Account's available spend limits, which is based on the spend limit + # configured on the Account and the amount already spent over the spend limit's + # duration. For example, if the Account has a daily spend limit of $1000 + # configured, and has spent $600 in the last 24 hours, the available spend limit + # returned would be $400. + sig do + params( + account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AccountSpendLimits) + end + def retrieve_spend_limits( + # Globally unique identifier for account. + account_token, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/aggregate_balances.rbi b/rbi/lib/lithic/resources/aggregate_balances.rbi new file mode 100644 index 00000000..08aea7ad --- /dev/null +++ b/rbi/lib/lithic/resources/aggregate_balances.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Resources + class AggregateBalances + # Get the aggregated balance across all end-user accounts by financial account + # type + sig do + params( + financial_account_type: Lithic::Models::AggregateBalanceListParams::FinancialAccountType::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::AggregateBalance]) + end + def list( + # Get the aggregate balance for a given Financial Account type. + financial_account_type: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/auth_rules.rbi b/rbi/lib/lithic/resources/auth_rules.rbi new file mode 100644 index 00000000..9e63a158 --- /dev/null +++ b/rbi/lib/lithic/resources/auth_rules.rbi @@ -0,0 +1,14 @@ +# typed: strong + +module Lithic + module Resources + class AuthRules + sig { returns(Lithic::Resources::AuthRules::V2) } + attr_reader :v2 + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/auth_rules/v2.rbi b/rbi/lib/lithic/resources/auth_rules/v2.rbi new file mode 100644 index 00000000..77ab7d52 --- /dev/null +++ b/rbi/lib/lithic/resources/auth_rules/v2.rbi @@ -0,0 +1,291 @@ +# typed: strong + +module Lithic + module Resources + class AuthRules + class V2 + sig { returns(Lithic::Resources::AuthRules::V2::Backtests) } + attr_reader :backtests + + # Creates a new V2 authorization rule in draft mode + sig do + params( + account_tokens: T::Array[String], + card_tokens: T::Array[String], + program_level: T::Boolean, + name: T.nilable(String), + parameters: T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ), + type: Lithic::Models::AuthRules::V2CreateParams::Type::OrSymbol, + excluded_card_tokens: T::Array[String], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2CreateResponse) + end + def create( + # Account tokens to which the Auth Rule applies. + account_tokens:, + # Card tokens to which the Auth Rule applies. + card_tokens:, + # Whether the Auth Rule applies to all authorizations on the card program. + program_level:, + # Auth Rule Name + name: nil, + # Parameters for the Auth Rule + parameters: nil, + # The type of Auth Rule + type: nil, + # Card tokens to which the Auth Rule does not apply. + excluded_card_tokens: nil, + request_options: {} + ) + end + + # Fetches a V2 authorization rule by its token + sig do + params( + auth_rule_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2RetrieveResponse) + end + def retrieve( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + request_options: {} + ) + end + + # Updates a V2 authorization rule's properties + # + # If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` + # is provided, this will replace existing associations with the provided list of + # entities. + sig do + params( + auth_rule_token: String, + account_tokens: T::Array[String], + name: T.nilable(String), + state: Lithic::Models::AuthRules::V2UpdateParams::State::OrSymbol, + card_tokens: T::Array[String], + excluded_card_tokens: T::Array[String], + program_level: T::Boolean, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2UpdateResponse) + end + def update( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + # Account tokens to which the Auth Rule applies. + account_tokens: nil, + # Auth Rule Name + name: nil, + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + state: nil, + # Card tokens to which the Auth Rule applies. + card_tokens: nil, + # Card tokens to which the Auth Rule does not apply. + excluded_card_tokens: nil, + # Whether the Auth Rule applies to all authorizations on the card program. + program_level: nil, + request_options: {} + ) + end + + # Lists V2 authorization rules + sig do + params( + account_token: String, + card_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::AuthRules::V2ListResponse]) + end + def list( + # Only return Authorization Rules that are bound to the provided account token. + account_token: nil, + # Only return Authorization Rules that are bound to the provided card token. + card_token: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Deletes a V2 authorization rule + sig do + params( + auth_rule_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def delete( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + request_options: {} + ) + end + + # Associates a V2 authorization rule with a card program, the provided account(s) + # or card(s). + # + # Prefer using the `PATCH` method for this operation. + sig do + params( + auth_rule_token: String, + account_tokens: T::Array[String], + card_tokens: T::Array[String], + program_level: T::Boolean, + excluded_card_tokens: T::Array[String], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2ApplyResponse) + end + def apply( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + # Account tokens to which the Auth Rule applies. + account_tokens:, + # Card tokens to which the Auth Rule applies. + card_tokens:, + # Whether the Auth Rule applies to all authorizations on the card program. + program_level:, + # Card tokens to which the Auth Rule does not apply. + excluded_card_tokens: nil, + request_options: {} + ) + end + + # Creates a new draft version of a rule that will be ran in shadow mode. + # + # This can also be utilized to reset the draft parameters, causing a draft version + # to no longer be ran in shadow mode. + sig do + params( + auth_rule_token: String, + parameters: T.nilable( + T.any( + Lithic::Models::AuthRules::ConditionalBlockParameters, + Lithic::Util::AnyHash, + Lithic::Models::AuthRules::VelocityLimitParams + ) + ), + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2DraftResponse) + end + def draft( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + # Parameters for the Auth Rule + parameters: nil, + request_options: {} + ) + end + + # Promotes the draft version of an authorization rule to the currently active + # version such that it is enforced in the authorization stream. + sig do + params( + auth_rule_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2PromoteResponse) + end + def promote( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + request_options: {} + ) + end + + # Requests a performance report of an authorization rule to be asynchronously + # generated. Reports can only be run on rules in draft or active mode and will + # included approved and declined statistics as well as examples. The generated + # report will be delivered asynchronously through a webhook with `event_type` = + # `auth_rules.performance_report.created`. See the docs on setting up + # [webhook subscriptions](https://docs.lithic.com/docs/events-api). + # + # Reports are generated based on data collected by Lithic's authorization + # processing system in the trailing week. The performance of the auth rule will be + # assessed on the configuration of the auth rule at the time the report is + # requested. This implies that if a performance report is requested, right after + # updating an auth rule, depending on the number of authorizations processed for a + # card program, it may be the case that no data is available for the report. + # Therefore Lithic recommends to decouple making updates to an Auth Rule, and + # requesting performance reports. + # + # To make this concrete, consider the following example: + # + # 1. At time `t`, a new Auth Rule is created, and applies to all authorizations on + # a card program. The Auth Rule has not yet been promoted, causing the draft + # version of the rule to be applied in shadow mode. + # 2. At time `t + 1 hour` a performance report is requested for the Auth Rule. + # This performance report will _only_ contain data for the Auth Rule being + # executed in the window between `t` and `t + 1 hour`. This is because Lithic's + # transaction processing system will only start capturing data for the Auth + # Rule at the time it is created. + # 3. At time `t + 2 hours` the draft version of the Auth Rule is promoted to the + # active version of the Auth Rule by calling the + # `/v2/auth_rules/{auth_rule_token}/promote` endpoint. If a performance report + # is requested at this moment it will still only contain data for this version + # of the rule, but the window of available data will now span from `t` to + # `t + 2 hours`. + # 4. At time `t + 3 hours` a new version of the rule is drafted by calling the + # `/v2/auth_rules/{auth_rule_token}/draft` endpoint. If a performance report is + # requested right at this moment, it will only contain data for authorizations + # to which both the active version and the draft version is applied. Lithic + # does this to ensure that performance reports represent a fair comparison + # between rules. Because there may be no authorizations in this window, and + # because there may be some lag before data is available in a performance + # report, the requested performance report could contain no to little data. + # 5. At time `t + 4 hours` another performance report is requested: this time the + # performance report will contain data from the window between `t + 3 hours` + # and `t + 4 hours`, for any authorizations to which both the current version + # of the authorization rule (in enforcing mode) and the draft version of the + # authorization rule (in shadow mode) applied. + # + # Note that generating a report may take up to 15 minutes and that delivery is not + # guaranteed. Customers are required to have created an event subscription to + # receive the webhook. Additionally, there is a delay of approximately 15 minutes + # between when Lithic's transaction processing systems have processed the + # transaction, and when a transaction will be included in the report. + sig do + params( + auth_rule_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2ReportResponse) + end + def report( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/auth_rules/v2/backtests.rbi b/rbi/lib/lithic/resources/auth_rules/v2/backtests.rbi new file mode 100644 index 00000000..dc7074f3 --- /dev/null +++ b/rbi/lib/lithic/resources/auth_rules/v2/backtests.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Lithic + module Resources + class AuthRules + class V2 + class Backtests + # Initiates a request to asynchronously generate a backtest for an authorization + # rule. During backtesting, both the active version (if one exists) and the draft + # version of the Authorization Rule are evaluated by replaying historical + # transaction data against the rule's conditions. This process allows customers to + # simulate and understand the effects of proposed rule changes before deployment. + # The generated backtest report provides detailed results showing whether the + # draft version of the Auth Rule would have approved or declined historical + # transactions which were processed during the backtest period. These reports help + # evaluate how changes to rule configurations might affect overall transaction + # approval rates. + # + # The generated backtest report will be delivered asynchronously through a webhook + # with `event_type` = `auth_rules.backtest_report.created`. See the docs on + # setting up [webhook subscriptions](https://docs.lithic.com/docs/events-api). It + # is also possible to request backtest reports on-demand through the + # `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}` + # endpoint. + # + # Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting + # for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e. + # where Lithic has pre-calculated the requested velocity metrics for historical + # transactions), a backtest may be feasible. However, such cases are uncommon and + # customers should not anticipate support for velocity backtests under most + # configurations. If a historical transaction does not feature the required inputs + # to evaluate the rule, then it will not be included in the final backtest report. + sig do + params( + auth_rule_token: String, + end_: Time, + start: Time, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2::BacktestCreateResponse) + end + def create( + # Globally unique identifier for the Auth Rule. + auth_rule_token, + # The end time of the backtest. + end_: nil, + # The start time of the backtest. + start: nil, + request_options: {} + ) + end + + # Returns the backtest results of an authorization rule (if available). + # + # Backtesting is an asynchronous process that requires time to complete. If a + # customer retrieves the backtest results using this endpoint before the report is + # fully generated, the response will return null for `results.current_version` and + # `results.draft_version`. Customers are advised to wait for the backtest creation + # process to complete (as indicated by the webhook event + # auth_rules.backtest_report.created) before retrieving results from this + # endpoint. + # + # Backtesting is an asynchronous process, while the backtest is being processed, + # results will not be available which will cause `results.current_version` and + # `results.draft_version` objects to contain `null`. The entries in `results` will + # also always represent the configuration of the rule at the time requests are + # made to this endpoint. For example, the results for `current_version` in the + # served backtest report will be consistent with which version of the rule is + # currently activated in the Auth Stream, regardless of which version of the rule + # was active in the Auth Stream at the time a backtest is requested. + sig do + params( + auth_rule_backtest_token: String, + auth_rule_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::AuthRules::V2::BacktestResults) + end + def retrieve( + # Globally unique identifier for an Auth Rule backtest. + auth_rule_backtest_token, + # Globally unique identifier for the Auth Rule. + auth_rule_token:, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/auth_stream_enrollment.rbi b/rbi/lib/lithic/resources/auth_stream_enrollment.rbi new file mode 100644 index 00000000..81f867f5 --- /dev/null +++ b/rbi/lib/lithic/resources/auth_stream_enrollment.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Lithic + module Resources + class AuthStreamEnrollment + # Retrieve the ASA HMAC secret key. If one does not exist for your program yet, + # calling this endpoint will create one for you. The headers (which you can use to + # verify webhooks) will begin appearing shortly after calling this endpoint for + # the first time. See + # [this page](https://docs.lithic.com/docs/auth-stream-access-asa#asa-webhook-verification) + # for more detail about verifying ASA webhooks. + sig do + params(request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))) + .returns(Lithic::Models::AuthStreamSecret) + end + def retrieve_secret(request_options: {}) + end + + # Generate a new ASA HMAC secret key. The old ASA HMAC secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /auth_stream/secret`](https://docs.lithic.com/reference/getauthstreamsecret) + # request to retrieve the new secret key. + sig { params(request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))).void } + def rotate_secret(request_options: {}) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/balances.rbi b/rbi/lib/lithic/resources/balances.rbi new file mode 100644 index 00000000..1efaec8c --- /dev/null +++ b/rbi/lib/lithic/resources/balances.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Lithic + module Resources + class Balances + # Get the balances for a program, business, or a given end-user account + sig do + params( + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: Lithic::Models::BalanceListParams::FinancialAccountType::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::Balance]) + end + def list( + # List balances for all financial accounts of a given account_token. + account_token: nil, + # UTC date and time of the balances to retrieve. Defaults to latest available + # balances + balance_date: nil, + # List balances for all financial accounts of a given business_account_token. + business_account_token: nil, + # List balances for a given Financial Account type. + financial_account_type: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/book_transfers.rbi b/rbi/lib/lithic/resources/book_transfers.rbi new file mode 100644 index 00000000..e71153a9 --- /dev/null +++ b/rbi/lib/lithic/resources/book_transfers.rbi @@ -0,0 +1,133 @@ +# typed: strong + +module Lithic + module Resources + class BookTransfers + # Book transfer funds between two financial accounts or between a financial + # account and card + sig do + params( + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::Category::OrSymbol, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::Type::OrSymbol, + token: String, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::BookTransferResponse) + end + def create( + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + amount:, + # Category of the book transfer + category:, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + from_financial_account_token:, + # The program specific subtype code for the specified category/type. + subtype:, + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + to_financial_account_token:, + # Type of book_transfer + type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # Optional descriptor for the transfer. + memo: nil, + request_options: {} + ) + end + + # Get book transfer by token + sig do + params( + book_transfer_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::BookTransferResponse) + end + def retrieve( + # Id of the book transfer to retrieve + book_transfer_token, + request_options: {} + ) + end + + # List book transfers + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::BookTransferListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::BookTransferListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::BookTransferListParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::BookTransferResponse]) + end + def list( + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # Book Transfer category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # Book transfer result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Book transfer status to be returned. + status: nil, + request_options: {} + ) + end + + # Reverse a book transfer + sig do + params( + book_transfer_token: String, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::BookTransferResponse) + end + def reverse( + # Id of the book transfer to retrieve + book_transfer_token, + # Optional descriptor for the reversal. + memo: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/card_programs.rbi b/rbi/lib/lithic/resources/card_programs.rbi new file mode 100644 index 00000000..e4734f8d --- /dev/null +++ b/rbi/lib/lithic/resources/card_programs.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Lithic + module Resources + class CardPrograms + # Get card program. + sig do + params( + card_program_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::CardProgram) + end + def retrieve( + # Globally unique identifier for the card program. + card_program_token, + request_options: {} + ) + end + + # List card programs. + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::CardProgram]) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/cards.rbi b/rbi/lib/lithic/resources/cards.rbi new file mode 100644 index 00000000..29f3f7c7 --- /dev/null +++ b/rbi/lib/lithic/resources/cards.rbi @@ -0,0 +1,532 @@ +# typed: strong + +module Lithic + module Resources + class Cards + sig { returns(Lithic::Resources::Cards::AggregateBalances) } + attr_reader :aggregate_balances + + sig { returns(Lithic::Resources::Cards::Balances) } + attr_reader :balances + + sig { returns(Lithic::Resources::Cards::FinancialTransactions) } + attr_reader :financial_transactions + + # Create a new virtual or physical card. Parameters `shipping_address` and + # `product_id` only apply to physical cards. + sig do + params( + type: Lithic::Models::CardCreateParams::Type::OrSymbol, + account_token: String, + card_program_token: String, + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_for: String, + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + shipping_method: Lithic::Models::CardCreateParams::ShippingMethod::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol, + state: Lithic::Models::CardCreateParams::State::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Card) + end + def create( + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + # successfully authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + type:, + # Globally unique identifier for the account that the card will be associated + # with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + account_token: nil, + # For card programs with more than one BIN range. This must be configured with + # Lithic before use. Identifies the card program/BIN range under which to create + # the card. If omitted, will utilize the program's default `card_program_token`. + # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + card_program_token: nil, + carrier: nil, + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date will be generated. + exp_month: nil, + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date will be generated. + exp_year: nil, + # Friendly name to identify the card. + memo: nil, + # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and + # `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + pin: nil, + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + product_id: nil, + # Restricted field limited to select use cases. Lithic will reach out directly if + # this field should be used. Globally unique identifier for the replacement card's + # account. If this field is specified, `replacement_for` must also be specified. + # If `replacement_for` is specified and this field is omitted, the replacement + # card's account will be inferred from the card being replaced. + replacement_account_token: nil, + # Globally unique identifier for the card that this card will replace. If the card + # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is + # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + replacement_for: nil, + shipping_address: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + shipping_method: nil, + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + spend_limit: nil, + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + spend_limit_duration: nil, + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + state: nil, + request_options: {} + ) + end + + # Get card configuration such as spend limit and state. + sig do + params( + card_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Card) + end + def retrieve(card_token, request_options: {}) + end + + # Update the specified properties of the card. Unsupplied properties will remain + # unchanged. + # + # _Note: setting a card to a `CLOSED` state is a final action that cannot be + # undone._ + sig do + params( + card_token: String, + digital_card_art_token: String, + memo: String, + pin: String, + pin_status: Lithic::Models::CardUpdateParams::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration::OrSymbol, + state: Lithic::Models::CardUpdateParams::State::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Card) + end + def update( + card_token, + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + # Friendly name to identify the card. + memo: nil, + # Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + pin: nil, + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + pin_status: nil, + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + spend_limit: nil, + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + spend_limit_duration: nil, + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + state: nil, + request_options: {} + ) + end + + # List cards. + sig do + params( + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + state: Lithic::Models::CardListParams::State::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Card]) + end + def list( + # Returns cards associated with the specified account. + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Returns cards with the specified state. + state: nil, + request_options: {} + ) + end + + # Convert a virtual card into a physical card and manufacture it. Customer must + # supply relevant fields for physical card creation including `product_id`, + # `carrier`, `shipping_method`, and `shipping_address`. The card token will be + # unchanged. The card's type will be altered to `PHYSICAL`. The card will be set + # to state `PENDING_FULFILLMENT` and fulfilled at next fulfillment cycle. Virtual + # cards created on card programs which do not support physical cards cannot be + # converted. The card program cannot be changed as part of the conversion. Cards + # must be in an `OPEN` state to be converted. Only applies to cards of type + # `VIRTUAL` (or existing cards with deprecated types of `DIGITAL_WALLET` and + # `UNLOCKED`). + sig do + params( + card_token: String, + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + product_id: String, + shipping_method: Lithic::Models::CardConvertPhysicalParams::ShippingMethod::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Card) + end + def convert_physical( + card_token, + # The shipping address this card will be sent to. + shipping_address:, + # If omitted, the previous carrier will be used. + carrier: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + shipping_method: nil, + request_options: {} + ) + end + + # Handling full card PANs and CVV codes requires that you comply with the Payment + # Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce + # their compliance obligations by leveraging our embedded card UI solution + # documented below. + # + # In this setup, PANs and CVV codes are presented to the end-user via a card UI + # that we provide, optionally styled in the customer's branding using a specified + # css stylesheet. A user's browser makes the request directly to api.lithic.com, + # so card PANs and CVVs never touch the API customer's servers while full card + # data is displayed to their end-users. The response contains an HTML document + # (see Embedded Card UI or Changelog for upcoming changes in January). This means + # that the url for the request can be inserted straight into the `src` attribute + # of an iframe. + # + # ```html + # + # ``` + # + # You should compute the request payload on the server side. You can render it (or + # the whole iframe) on the server or make an ajax call from your front end code, + # but **do not ever embed your API key into front end code, as doing so introduces + # a serious security vulnerability**. + sig do + params( + embed_request: String, + hmac: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(String) + end + def embed( + # A base64 encoded JSON string of an EmbedRequest to specify which card to load. + embed_request:, + # SHA256 HMAC of the embed_request JSON string with base64 digest. + hmac:, + request_options: {} + ) + end + + # Allow your cardholders to directly add payment cards to the device's digital + # wallet (e.g. Apple Pay) with one touch from your app. + # + # This requires some additional setup and configuration. Please + # [Contact Us](https://lithic.com/contact) or your Customer Success representative + # for more information. + sig do + params( + card_token: String, + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardProvisionParams::DigitalWallet::OrSymbol, + nonce: String, + nonce_signature: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::CardProvisionResponse) + end + def provision( + # The unique token of the card to add to the device's digital wallet. + card_token, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + certificate: nil, + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + client_device_id: nil, + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + client_wallet_account_id: nil, + # Name of digital wallet provider. + digital_wallet: nil, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + nonce: nil, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + nonce_signature: nil, + request_options: {} + ) + end + + # Initiate print and shipment of a duplicate physical card (e.g. card is + # physically damaged). The PAN, expiry, and CVC2 will remain the same and the + # original card can continue to be used until the new card is activated. Only + # applies to cards of type `PHYSICAL`. A card can be replaced or renewed a total + # of 8 times. + sig do + params( + card_token: String, + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + product_id: String, + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + shipping_method: Lithic::Models::CardReissueParams::ShippingMethod::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Card) + end + def reissue( + card_token, + # If omitted, the previous carrier will be used. + carrier: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # If omitted, the previous shipping address will be used. + shipping_address: nil, + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + shipping_method: nil, + request_options: {} + ) + end + + # Creates a new card with the same card token and PAN, but updated expiry and CVC2 + # code. The original card will keep working for card-present transactions until + # the new card is activated. For card-not-present transactions, the original card + # details (expiry, CVC2) will also keep working until the new card is activated. + # Applies to card types `PHYSICAL` and `VIRTUAL`. A card can be replaced or + # renewed a total of 8 times. + sig do + params( + card_token: String, + shipping_address: T.any(Lithic::Models::ShippingAddress, Lithic::Util::AnyHash), + carrier: T.any(Lithic::Models::Carrier, Lithic::Util::AnyHash), + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::Models::CardRenewParams::ShippingMethod::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Card) + end + def renew( + card_token, + # The shipping address this card will be sent to. + shipping_address:, + # If omitted, the previous carrier will be used. + carrier: nil, + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date six years in the future will be generated. + exp_month: nil, + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date six years in the future will be generated. + exp_year: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # Shipping method for the card. Use of options besides `STANDARD` require + # additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + # - `2_DAY` - FedEx 2-day shipping, with tracking + # - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + # tracking + shipping_method: nil, + request_options: {} + ) + end + + # Get a Card's available spend limit, which is based on the spend limit configured + # on the Card and the amount already spent over the spend limit's duration. For + # example, if the Card has a monthly spend limit of $1000 configured, and has + # spent $600 in the last month, the available spend limit returned would be $400. + sig do + params( + card_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::CardSpendLimits) + end + def retrieve_spend_limits(card_token, request_options: {}) + end + + # Get card configuration such as spend limit and state. Customers must be PCI + # compliant to use this endpoint. Please contact + # [support@lithic.com](mailto:support@lithic.com) for questions. _Note: this is a + # `POST` endpoint because it is more secure to send sensitive data in a request + # body than in a URL._ + sig do + params(pan: String, request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))) + .returns(Lithic::Models::Card) + end + def search_by_pan( + # The PAN for the card being retrieved. + pan:, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/cards/aggregate_balances.rbi b/rbi/lib/lithic/resources/cards/aggregate_balances.rbi new file mode 100644 index 00000000..24bc6e09 --- /dev/null +++ b/rbi/lib/lithic/resources/cards/aggregate_balances.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Resources + class Cards + class AggregateBalances + # Get the aggregated card balance across all end-user accounts. + sig do + params( + account_token: String, + business_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::Cards::AggregateBalanceListResponse]) + end + def list( + # Cardholder to retrieve aggregate balances for. + account_token: nil, + # Business to retrieve aggregate balances for. + business_account_token: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/cards/balances.rbi b/rbi/lib/lithic/resources/cards/balances.rbi new file mode 100644 index 00000000..66d29c52 --- /dev/null +++ b/rbi/lib/lithic/resources/cards/balances.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Resources + class Cards + class Balances + # Get the balances for a given card. + sig do + params( + card_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::Cards::BalanceListResponse]) + end + def list( + card_token, + # UTC date of the balance to retrieve. Defaults to latest available balance + balance_date: nil, + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + last_transaction_event_token: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/cards/financial_transactions.rbi b/rbi/lib/lithic/resources/cards/financial_transactions.rbi new file mode 100644 index 00000000..a3536e2a --- /dev/null +++ b/rbi/lib/lithic/resources/cards/financial_transactions.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Lithic + module Resources + class Cards + class FinancialTransactions + # Get the card financial transaction for the provided token. + sig do + params( + financial_transaction_token: String, + card_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialTransaction) + end + def retrieve( + # Globally unique identifier for financial transaction token. + financial_transaction_token, + card_token:, + request_options: {} + ) + end + + # List the financial transactions for a given card. + sig do + params( + card_token: String, + begin_: Time, + category: Lithic::Models::Cards::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: Lithic::Models::Cards::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::Cards::FinancialTransactionListParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::FinancialTransaction]) + end + def list( + card_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Financial Transaction category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Financial Transaction result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Financial Transaction status to be returned. + status: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/credit_products.rbi b/rbi/lib/lithic/resources/credit_products.rbi new file mode 100644 index 00000000..15c7794c --- /dev/null +++ b/rbi/lib/lithic/resources/credit_products.rbi @@ -0,0 +1,17 @@ +# typed: strong + +module Lithic + module Resources + class CreditProducts + sig { returns(Lithic::Resources::CreditProducts::ExtendedCredit) } + attr_reader :extended_credit + + sig { returns(Lithic::Resources::CreditProducts::PrimeRates) } + attr_reader :prime_rates + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/credit_products/extended_credit.rbi b/rbi/lib/lithic/resources/credit_products/extended_credit.rbi new file mode 100644 index 00000000..b9dfed4d --- /dev/null +++ b/rbi/lib/lithic/resources/credit_products/extended_credit.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Resources + class CreditProducts + class ExtendedCredit + # Get the extended credit for a given credit product under a program + sig do + params( + credit_product_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::CreditProducts::CreditProductsExtendedCredit) + end + def retrieve( + # Credit Product Token + credit_product_token, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/credit_products/prime_rates.rbi b/rbi/lib/lithic/resources/credit_products/prime_rates.rbi new file mode 100644 index 00000000..71ccc5ee --- /dev/null +++ b/rbi/lib/lithic/resources/credit_products/prime_rates.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Lithic + module Resources + class CreditProducts + class PrimeRates + # Post Credit Product Prime Rate + sig do + params( + credit_product_token: String, + effective_date: Date, + rate: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def create( + # Globally unique identifier for credit products. + credit_product_token, + # Date the rate goes into effect + effective_date:, + # The rate in decimal format + rate:, + request_options: {} + ) + end + + # Get Credit Product Prime Rates + sig do + params( + credit_product_token: String, + ending_before: Date, + starting_after: Date, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::CreditProducts::PrimeRateRetrieveResponse) + end + def retrieve( + # Globally unique identifier for credit products. + credit_product_token, + # The effective date that the prime rates ends before + ending_before: nil, + # The effective date that the prime rate starts after + starting_after: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/digital_card_art.rbi b/rbi/lib/lithic/resources/digital_card_art.rbi new file mode 100644 index 00000000..57630704 --- /dev/null +++ b/rbi/lib/lithic/resources/digital_card_art.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Resources + class DigitalCardArt + # Get digital card art by token. + sig do + params( + digital_card_art_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::DigitalCardArtAPI) + end + def retrieve( + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token, + request_options: {} + ) + end + + # List digital card art. + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::DigitalCardArtAPI]) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/disputes.rbi b/rbi/lib/lithic/resources/disputes.rbi new file mode 100644 index 00000000..dd7f9c62 --- /dev/null +++ b/rbi/lib/lithic/resources/disputes.rbi @@ -0,0 +1,202 @@ +# typed: strong + +module Lithic + module Resources + class Disputes + # Initiate a dispute. + sig do + params( + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::Reason::OrSymbol, + transaction_token: String, + customer_filed_date: Time, + customer_note: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Dispute) + end + def create( + # Amount to dispute + amount:, + # Reason for dispute + reason:, + # Transaction to dispute + transaction_token:, + # Date the customer filed the dispute + customer_filed_date: nil, + # Customer description of dispute + customer_note: nil, + request_options: {} + ) + end + + # Get dispute. + sig do + params( + dispute_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Dispute) + end + def retrieve(dispute_token, request_options: {}) + end + + # Update dispute. Can only be modified if status is `NEW`. + sig do + params( + dispute_token: String, + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::Models::DisputeUpdateParams::Reason::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Dispute) + end + def update( + dispute_token, + # Amount to dispute + amount: nil, + # Date the customer filed the dispute + customer_filed_date: nil, + # Customer description of dispute + customer_note: nil, + # Reason for dispute + reason: nil, + request_options: {} + ) + end + + # List disputes. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::DisputeListParams::Status::OrSymbol, + transaction_tokens: T::Array[String], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Dispute]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # List disputes of a specific status. + status: nil, + # Transaction tokens to filter by. + transaction_tokens: nil, + request_options: {} + ) + end + + # Withdraw dispute. + sig do + params( + dispute_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Dispute) + end + def delete(dispute_token, request_options: {}) + end + + # Soft delete evidence for a dispute. Evidence will not be reviewed or submitted + # by Lithic after it is withdrawn. + sig do + params( + evidence_token: String, + dispute_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::DisputeEvidence) + end + def delete_evidence(evidence_token, dispute_token:, request_options: {}) + end + + # Use this endpoint to upload evidences for the dispute. It will return a URL to + # upload your documents to. The URL will expire in 30 minutes. + # + # Uploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be + # less than 5 GiB. + sig do + params( + dispute_token: String, + filename: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::DisputeEvidence) + end + def initiate_evidence_upload( + dispute_token, + # Filename of the evidence. + filename: nil, + request_options: {} + ) + end + + # List evidence metadata for a dispute. + sig do + params( + dispute_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::DisputeEvidence]) + end + def list_evidences( + dispute_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Get a dispute's evidence metadata. + sig do + params( + evidence_token: String, + dispute_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::DisputeEvidence) + end + def retrieve_evidence(evidence_token, dispute_token:, request_options: {}) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/events.rbi b/rbi/lib/lithic/resources/events.rbi new file mode 100644 index 00000000..09c0b607 --- /dev/null +++ b/rbi/lib/lithic/resources/events.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Lithic + module Resources + class Events + sig { returns(Lithic::Resources::Events::Subscriptions) } + attr_reader :subscriptions + + # Get an event. + sig do + params( + event_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Event) + end + def retrieve(event_token, request_options: {}) + end + + # List all events. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + event_types: T::Array[Lithic::Models::EventListParams::EventType::OrSymbol], + page_size: Integer, + starting_after: String, + with_content: T::Boolean, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Event]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Event types to filter events by. + event_types: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Whether to include the event payload content in the response. + with_content: nil, + request_options: {} + ) + end + + # List all the message attempts for a given event. + sig do + params( + event_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::EventListAttemptsParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::MessageAttempt]) + end + def list_attempts( + event_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/events/subscriptions.rbi b/rbi/lib/lithic/resources/events/subscriptions.rbi new file mode 100644 index 00000000..749807b9 --- /dev/null +++ b/rbi/lib/lithic/resources/events/subscriptions.rbi @@ -0,0 +1,233 @@ +# typed: strong + +module Lithic + module Resources + class Events + class Subscriptions + # Create a new event subscription. + sig do + params( + url: String, + description: String, + disabled: T::Boolean, + event_types: T::Array[Lithic::Models::Events::SubscriptionCreateParams::EventType::OrSymbol], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::EventSubscription) + end + def create( + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + url:, + # Event subscription description. + description: nil, + # Whether the event subscription is active (false) or inactive (true). + disabled: nil, + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + event_types: nil, + request_options: {} + ) + end + + # Get an event subscription. + sig do + params( + event_subscription_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::EventSubscription) + end + def retrieve(event_subscription_token, request_options: {}) + end + + # Update an event subscription. + sig do + params( + event_subscription_token: String, + url: String, + description: String, + disabled: T::Boolean, + event_types: T::Array[Lithic::Models::Events::SubscriptionUpdateParams::EventType::OrSymbol], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::EventSubscription) + end + def update( + event_subscription_token, + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + url:, + # Event subscription description. + description: nil, + # Whether the event subscription is active (false) or inactive (true). + disabled: nil, + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + event_types: nil, + request_options: {} + ) + end + + # List all the event subscriptions. + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::EventSubscription]) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Delete an event subscription. + sig do + params( + event_subscription_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def delete(event_subscription_token, request_options: {}) + end + + # List all the message attempts for a given event subscription. + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::Events::SubscriptionListAttemptsParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::MessageAttempt]) + end + def list_attempts( + event_subscription_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + # Resend all failed messages since a given time. + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def recover( + event_subscription_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + request_options: {} + ) + end + + # Replays messages to the endpoint. Only messages that were created after `begin` + # will be sent. Messages that were previously sent to the endpoint are not resent. + # Message will be retried if endpoint responds with a non-2xx status code. See + # [Retry Schedule](https://docs.lithic.com/docs/events-api#retry-schedule) for + # details. + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def replay_missing( + event_subscription_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + request_options: {} + ) + end + + # Get the secret for an event subscription. + sig do + params( + event_subscription_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Events::SubscriptionRetrieveSecretResponse) + end + def retrieve_secret(event_subscription_token, request_options: {}) + end + + # Rotate the secret for an event subscription. The previous secret will be valid + # for the next 24 hours. + sig do + params( + event_subscription_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def rotate_secret(event_subscription_token, request_options: {}) + end + + # Send an example message for event. + sig do + params( + event_subscription_token: String, + event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def send_simulated_example( + event_subscription_token, + # Event type to send example message for. + event_type: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/external_bank_accounts.rbi b/rbi/lib/lithic/resources/external_bank_accounts.rbi new file mode 100644 index 00000000..9a8aea7f --- /dev/null +++ b/rbi/lib/lithic/resources/external_bank_accounts.rbi @@ -0,0 +1,193 @@ +# typed: strong + +module Lithic + module Resources + class ExternalBankAccounts + sig { returns(Lithic::Resources::ExternalBankAccounts::MicroDeposits) } + attr_reader :micro_deposits + + # Creates an external bank account within a program or Lithic account. + sig do + params( + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::OwnerType::OrSymbol, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Type::OrSymbol, + verification_method: Lithic::Models::ExternalBankAccountCreateParams::VerificationMethod::OrSymbol, + processor_token: String, + account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: T::Boolean, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalBankAccountCreateResponse) + end + def create( + # Account Number + account_number:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The financial account token of the operating account to fund the micro deposits + financial_account_token:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account Type + type:, + # Verification Method + verification_method:, + processor_token:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + verification_enforcement: nil, + request_options: {} + ) + end + + # Get the external bank account by token. + sig do + params( + external_bank_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalBankAccountRetrieveResponse) + end + def retrieve(external_bank_account_token, request_options: {}) + end + + # Update the external bank account by token. + sig do + params( + external_bank_account_token: String, + address: T.any(Lithic::Models::ExternalBankAccountAddress, Lithic::Util::AnyHash), + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::Models::OwnerType::OrSymbol, + type: Lithic::Models::ExternalBankAccountUpdateParams::Type::OrSymbol, + user_defined_id: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalBankAccountUpdateResponse) + end + def update( + external_bank_account_token, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The nickname for this External Bank Account + name: nil, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner: nil, + # Owner Type + owner_type: nil, + type: nil, + # User Defined ID + user_defined_id: nil, + request_options: {} + ) + end + + # List all the external bank accounts for the provided search criteria. + sig do + params( + account_token: String, + account_types: T::Array[Lithic::Models::ExternalBankAccountListParams::AccountType::OrSymbol], + countries: T::Array[String], + ending_before: String, + owner_types: T::Array[Lithic::Models::OwnerType::OrSymbol], + page_size: Integer, + starting_after: String, + states: T::Array[Lithic::Models::ExternalBankAccountListParams::State::OrSymbol], + verification_states: T::Array[Lithic::Models::ExternalBankAccountListParams::VerificationState::OrSymbol], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::ExternalBankAccountListResponse]) + end + def list( + account_token: nil, + account_types: nil, + countries: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + owner_types: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + states: nil, + verification_states: nil, + request_options: {} + ) + end + + # Retry external bank account micro deposit verification. + sig do + params( + external_bank_account_token: String, + financial_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse) + end + def retry_micro_deposits(external_bank_account_token, financial_account_token: nil, request_options: {}) + end + + # Retry external bank account prenote verification. + sig do + params( + external_bank_account_token: String, + financial_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalBankAccountRetryPrenoteResponse) + end + def retry_prenote(external_bank_account_token, financial_account_token: nil, request_options: {}) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/external_bank_accounts/micro_deposits.rbi b/rbi/lib/lithic/resources/external_bank_accounts/micro_deposits.rbi new file mode 100644 index 00000000..041c197c --- /dev/null +++ b/rbi/lib/lithic/resources/external_bank_accounts/micro_deposits.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Resources + class ExternalBankAccounts + class MicroDeposits + # Verify the external bank account by providing the micro deposit amounts. + sig do + params( + external_bank_account_token: String, + micro_deposits: T::Array[Integer], + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse) + end + def create(external_bank_account_token, micro_deposits:, request_options: {}) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/external_payments.rbi b/rbi/lib/lithic/resources/external_payments.rbi new file mode 100644 index 00000000..e1258876 --- /dev/null +++ b/rbi/lib/lithic/resources/external_payments.rbi @@ -0,0 +1,180 @@ +# typed: strong + +module Lithic + module Resources + class ExternalPayments + # Create external payment + sig do + params( + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::Category::OrSymbol, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::PaymentType::OrSymbol, + token: String, + memo: String, + progress_to: Lithic::Models::ExternalPaymentCreateParams::ProgressTo::OrSymbol, + user_defined_id: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalPayment) + end + def create( + amount:, + category:, + effective_date:, + financial_account_token:, + payment_type:, + token: nil, + memo: nil, + progress_to: nil, + user_defined_id: nil, + request_options: {} + ) + end + + # Get external payment + sig do + params( + external_payment_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalPayment) + end + def retrieve( + # Globally unique identifier for the external payment + external_payment_token, + request_options: {} + ) + end + + # List external payments + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::Models::ExternalPaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::ExternalPaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::ExternalPaymentListParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::ExternalPayment]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # External Payment category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # External Payment result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Book transfer status to be returned. + status: nil, + request_options: {} + ) + end + + # Cancel external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalPayment) + end + def cancel( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + # Release external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalPayment) + end + def release( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + # Reverse external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalPayment) + end + def reverse( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + # Settle external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + progress_to: Lithic::Models::ExternalPaymentSettleParams::ProgressTo::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ExternalPayment) + end + def settle( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + progress_to: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/financial_accounts.rbi b/rbi/lib/lithic/resources/financial_accounts.rbi new file mode 100644 index 00000000..35cae35b --- /dev/null +++ b/rbi/lib/lithic/resources/financial_accounts.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + sig { returns(Lithic::Resources::FinancialAccounts::Balances) } + attr_reader :balances + + sig { returns(Lithic::Resources::FinancialAccounts::FinancialTransactions) } + attr_reader :financial_transactions + + sig { returns(Lithic::Resources::FinancialAccounts::CreditConfiguration) } + attr_reader :credit_configuration + + sig { returns(Lithic::Resources::FinancialAccounts::Statements) } + attr_reader :statements + + sig { returns(Lithic::Resources::FinancialAccounts::LoanTapes) } + attr_reader :loan_tapes + + # Create a new financial account + sig do + params( + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::Type::OrSymbol, + account_token: String, + is_for_benefit_of: T::Boolean, + idempotency_key: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccount) + end + def create( + # Body param: + nickname:, + # Body param: + type:, + # Body param: + account_token: nil, + # Body param: + is_for_benefit_of: nil, + # Header param: + idempotency_key: nil, + request_options: {} + ) + end + + # Get a financial account + sig do + params( + financial_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccount) + end + def retrieve(financial_account_token, request_options: {}) + end + + # Update a financial account + sig do + params( + financial_account_token: String, + nickname: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccount) + end + def update(financial_account_token, nickname: nil, request_options: {}) + end + + # Retrieve information on your financial accounts including routing and account + # number. + sig do + params( + account_token: String, + business_account_token: String, + type: Lithic::Models::FinancialAccountListParams::Type::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::FinancialAccount]) + end + def list( + # List financial accounts for a given account_token or business_account_token + account_token: nil, + # List financial accounts for a given business_account_token + business_account_token: nil, + # List financial accounts of a given type + type: nil, + request_options: {} + ) + end + + # Update financial account status + sig do + params( + financial_account_token: String, + status: Lithic::Models::FinancialAccountUpdateStatusParams::Status::OrSymbol, + status_change_reason: T.nilable(Lithic::Models::FinancialAccountUpdateStatusParams::StatusChangeReason::OrSymbol), + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccount) + end + def update_status( + # Globally unique identifier for financial account. + financial_account_token, + # Status of the financial account + status:, + # Reason for the financial account status change + status_change_reason:, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/financial_accounts/balances.rbi b/rbi/lib/lithic/resources/financial_accounts/balances.rbi new file mode 100644 index 00000000..a847f84c --- /dev/null +++ b/rbi/lib/lithic/resources/financial_accounts/balances.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class Balances + # Get the balances for a given financial account. + sig do + params( + financial_account_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::FinancialAccounts::BalanceListResponse]) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # UTC date of the balance to retrieve. Defaults to latest available balance + balance_date: nil, + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + last_transaction_event_token: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/financial_accounts/credit_configuration.rbi b/rbi/lib/lithic/resources/financial_accounts/credit_configuration.rbi new file mode 100644 index 00000000..d349ec57 --- /dev/null +++ b/rbi/lib/lithic/resources/financial_accounts/credit_configuration.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class CreditConfiguration + # Get an Account's credit configuration + sig do + params( + financial_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig) + end + def retrieve( + # Globally unique identifier for financial account. + financial_account_token, + request_options: {} + ) + end + + # Update an account's credit configuration + sig do + params( + financial_account_token: String, + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig) + end + def update( + # Globally unique identifier for financial account. + financial_account_token, + credit_limit: nil, + # Globally unique identifier for the credit product + credit_product_token: nil, + external_bank_account_token: nil, + # Tier to assign to a financial account + tier: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/financial_accounts/financial_transactions.rbi b/rbi/lib/lithic/resources/financial_accounts/financial_transactions.rbi new file mode 100644 index 00000000..615a2e56 --- /dev/null +++ b/rbi/lib/lithic/resources/financial_accounts/financial_transactions.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class FinancialTransactions + # Get the financial transaction for the provided token. + sig do + params( + financial_transaction_token: String, + financial_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialTransaction) + end + def retrieve( + # Globally unique identifier for financial transaction token. + financial_transaction_token, + # Globally unique identifier for financial account. + financial_account_token:, + request_options: {} + ) + end + + # List the financial transactions for a given financial account. + sig do + params( + financial_account_token: String, + begin_: Time, + category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::SinglePage[Lithic::Models::FinancialTransaction]) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Financial Transaction category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Financial Transaction result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Financial Transaction status to be returned. + status: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/financial_accounts/loan_tapes.rbi b/rbi/lib/lithic/resources/financial_accounts/loan_tapes.rbi new file mode 100644 index 00000000..27fbd80f --- /dev/null +++ b/rbi/lib/lithic/resources/financial_accounts/loan_tapes.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class LoanTapes + # Get a specific loan tape for a given financial account. + sig do + params( + loan_tape_token: String, + financial_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccounts::LoanTape) + end + def retrieve( + # Globally unique identifier for loan tape. + loan_tape_token, + # Globally unique identifier for financial account. + financial_account_token:, + request_options: {} + ) + end + + # List the loan tapes for a given financial account. + sig do + params( + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::FinancialAccounts::LoanTape]) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/financial_accounts/statements.rbi b/rbi/lib/lithic/resources/financial_accounts/statements.rbi new file mode 100644 index 00000000..a8a7a00b --- /dev/null +++ b/rbi/lib/lithic/resources/financial_accounts/statements.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class Statements + sig { returns(Lithic::Resources::FinancialAccounts::Statements::LineItems) } + attr_reader :line_items + + # Get a specific statement for a given financial account. + sig do + params( + statement_token: String, + financial_account_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::FinancialAccounts::Statement) + end + def retrieve( + # Globally unique identifier for statements. + statement_token, + # Globally unique identifier for financial account. + financial_account_token:, + request_options: {} + ) + end + + # List the statements for a given financial account. + sig do + params( + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::FinancialAccounts::Statement]) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Whether to include the initial statement. It is not included by default. + include_initial_statements: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/financial_accounts/statements/line_items.rbi b/rbi/lib/lithic/resources/financial_accounts/statements/line_items.rbi new file mode 100644 index 00000000..0f04ceae --- /dev/null +++ b/rbi/lib/lithic/resources/financial_accounts/statements/line_items.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class Statements + class LineItems + # List the line items for a given statement within a given financial account. + sig do + params( + statement_token: String, + financial_account_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data]) + end + def list( + # Path param: Globally unique identifier for statements. + statement_token, + # Path param: Globally unique identifier for financial account. + financial_account_token:, + # Query param: A cursor representing an item's token before which a page of + # results should end. Used to retrieve the previous page of results before this + # item. + ending_before: nil, + # Query param: Page size (for pagination). + page_size: nil, + # Query param: A cursor representing an item's token after which a page of results + # should begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/management_operations.rbi b/rbi/lib/lithic/resources/management_operations.rbi new file mode 100644 index 00000000..e42d7da0 --- /dev/null +++ b/rbi/lib/lithic/resources/management_operations.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module Lithic + module Resources + class ManagementOperations + # Create management operation + sig do + params( + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::Category::OrSymbol, + direction: Lithic::Models::ManagementOperationCreateParams::Direction::OrSymbol, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::EventType::OrSymbol, + financial_account_token: String, + token: String, + memo: String, + subtype: String, + user_defined_id: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ManagementOperationTransaction) + end + def create( + amount:, + category:, + direction:, + effective_date:, + event_type:, + financial_account_token:, + token: nil, + memo: nil, + subtype: nil, + user_defined_id: nil, + request_options: {} + ) + end + + # Get management operation + sig do + params( + management_operation_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ManagementOperationTransaction) + end + def retrieve( + # Globally unique identifier for the management operation + management_operation_token, + request_options: {} + ) + end + + # List management operations + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::Models::ManagementOperationListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::ManagementOperationListParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::ManagementOperationTransaction]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # Management operation category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Management operation status to be returned. + status: nil, + request_options: {} + ) + end + + # Reverse a management operation + sig do + params( + management_operation_token: String, + effective_date: Date, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ManagementOperationTransaction) + end + def reverse( + # Globally unique identifier for the management operation + management_operation_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/payments.rbi b/rbi/lib/lithic/resources/payments.rbi new file mode 100644 index 00000000..8bb04c64 --- /dev/null +++ b/rbi/lib/lithic/resources/payments.rbi @@ -0,0 +1,191 @@ +# typed: strong + +module Lithic + module Resources + class Payments + # Initiates a payment between a financial account and an external bank account. + sig do + params( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::Method::OrSymbol, + method_attributes: T.any(Lithic::Models::PaymentCreateParams::MethodAttributes, Lithic::Util::AnyHash), + type: Lithic::Models::PaymentCreateParams::Type::OrSymbol, + token: String, + memo: String, + user_defined_id: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::PaymentCreateResponse) + end + def create( + amount:, + external_bank_account_token:, + financial_account_token:, + method_:, + method_attributes:, + type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + memo: nil, + user_defined_id: nil, + request_options: {} + ) + end + + # Get the payment by token. + sig do + params( + payment_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Payment) + end + def retrieve(payment_token, request_options: {}) + end + + # List all the payments for the provided search criteria. + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::PaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::PaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::PaymentListParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Payment]) + end + def list( + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + # Retry an origination which has been returned. + sig do + params( + payment_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::PaymentRetryResponse) + end + def retry_(payment_token, request_options: {}) + end + + # Simulate payment lifecycle event + sig do + params( + payment_token: String, + event_type: Lithic::Models::PaymentSimulateActionParams::EventType::OrSymbol, + decline_reason: Lithic::Models::PaymentSimulateActionParams::DeclineReason::OrSymbol, + return_reason_code: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::PaymentSimulateActionResponse) + end + def simulate_action( + payment_token, + # Event Type + event_type:, + # Decline reason + decline_reason: nil, + # Return Reason Code + return_reason_code: nil, + request_options: {} + ) + end + + # Simulates a receipt of a Payment. + sig do + params( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::ReceiptType::OrSymbol, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::PaymentSimulateReceiptResponse) + end + def simulate_receipt( + # Payment token + token:, + # Amount + amount:, + # Financial Account Token + financial_account_token:, + # Receipt Type + receipt_type:, + # Memo + memo: nil, + request_options: {} + ) + end + + # Simulates a release of a Payment. + sig do + params( + payment_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::PaymentSimulateReleaseResponse) + end + def simulate_release( + # Payment Token + payment_token:, + request_options: {} + ) + end + + # Simulates a return of a Payment. + sig do + params( + payment_token: String, + return_reason_code: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::PaymentSimulateReturnResponse) + end + def simulate_return( + # Payment Token + payment_token:, + # Return Reason Code + return_reason_code: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/reports.rbi b/rbi/lib/lithic/resources/reports.rbi new file mode 100644 index 00000000..f0734428 --- /dev/null +++ b/rbi/lib/lithic/resources/reports.rbi @@ -0,0 +1,14 @@ +# typed: strong + +module Lithic + module Resources + class Reports + sig { returns(Lithic::Resources::Reports::Settlement) } + attr_reader :settlement + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/reports/settlement.rbi b/rbi/lib/lithic/resources/reports/settlement.rbi new file mode 100644 index 00000000..7911b2f6 --- /dev/null +++ b/rbi/lib/lithic/resources/reports/settlement.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Lithic + module Resources + class Reports + class Settlement + sig { returns(Lithic::Resources::Reports::Settlement::NetworkTotals) } + attr_reader :network_totals + + # List details. + sig do + params( + report_date: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::SettlementDetail]) + end + def list_details( + # Date of the settlement report to retrieve. Not available in sandbox. + report_date, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Get the settlement report for a specified report date. Not available in sandbox. + sig do + params( + report_date: Date, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::SettlementReport) + end + def summary( + # Date of the settlement report to retrieve. + report_date, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/reports/settlement/network_totals.rbi b/rbi/lib/lithic/resources/reports/settlement/network_totals.rbi new file mode 100644 index 00000000..ffe0c83c --- /dev/null +++ b/rbi/lib/lithic/resources/reports/settlement/network_totals.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Lithic + module Resources + class Reports + class Settlement + class NetworkTotals + # Retrieve a specific network total record by token. Not available in sandbox. + sig do + params( + token: String, + request_options: T.nilable( + T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ) + ) + .returns(Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse) + end + def retrieve( + # Token of the network total record to retrieve + token, + request_options: {} + ) + end + + # List network total records with optional filters. Not available in sandbox. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Reports::Settlement::NetworkTotalListResponse]) + end + def list( + # Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + begin_: nil, + # Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Institution ID to filter on. + institution_id: nil, + # Network to filter on. + network: nil, + # Number of records per page. + page_size: nil, + # Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + report_date: nil, + # Earliest report date to filter on, inclusive (YYYY-MM-DD). + report_date_begin: nil, + # Latest report date to filter on, inclusive (YYYY-MM-DD). + report_date_end: nil, + # Settlement institution ID to filter on. + settlement_institution_id: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/responder_endpoints.rbi b/rbi/lib/lithic/resources/responder_endpoints.rbi new file mode 100644 index 00000000..f5645360 --- /dev/null +++ b/rbi/lib/lithic/resources/responder_endpoints.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Resources + class ResponderEndpoints + # Enroll a responder endpoint + sig do + params( + type: Lithic::Models::ResponderEndpointCreateParams::Type::OrSymbol, + url: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ResponderEndpointCreateResponse) + end + def create( + # The type of the endpoint. + type: nil, + # The URL for the responder endpoint (must be http(s)). + url: nil, + request_options: {} + ) + end + + # Disenroll a responder endpoint + sig do + params( + type: Lithic::Models::ResponderEndpointDeleteParams::Type::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def delete( + # The type of the endpoint. + type:, + request_options: {} + ) + end + + # Check the status of a responder endpoint + sig do + params( + type: Lithic::Models::ResponderEndpointCheckStatusParams::Type::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ResponderEndpointStatus) + end + def check_status( + # The type of the endpoint. + type:, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/three_ds.rbi b/rbi/lib/lithic/resources/three_ds.rbi new file mode 100644 index 00000000..da7fa2c0 --- /dev/null +++ b/rbi/lib/lithic/resources/three_ds.rbi @@ -0,0 +1,17 @@ +# typed: strong + +module Lithic + module Resources + class ThreeDS + sig { returns(Lithic::Resources::ThreeDS::Authentication) } + attr_reader :authentication + + sig { returns(Lithic::Resources::ThreeDS::Decisioning) } + attr_reader :decisioning + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/three_ds/authentication.rbi b/rbi/lib/lithic/resources/three_ds/authentication.rbi new file mode 100644 index 00000000..beac66f5 --- /dev/null +++ b/rbi/lib/lithic/resources/three_ds/authentication.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module Lithic + module Resources + class ThreeDS + class Authentication + # Get 3DS Authentication by token + sig do + params( + three_ds_authentication_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ThreeDS::AuthenticationRetrieveResponse) + end + def retrieve( + # 3DS Authentication Token + three_ds_authentication_token, + request_options: {} + ) + end + + # Simulates a 3DS authentication request from the payment network as if it came + # from an ACS. If you're configured for 3DS Customer Decisioning, simulating + # authentications requires your customer decisioning endpoint to be set up + # properly (respond with a valid JSON). + sig do + params( + merchant: T.any(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant, Lithic::Util::AnyHash), + pan: String, + transaction: T.any(Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction, Lithic::Util::AnyHash), + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::ThreeDS::AuthenticationSimulateResponse) + end + def simulate( + merchant:, + # Sixteen digit card number. + pan:, + transaction:, + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + card_expiry_check: nil, + request_options: {} + ) + end + + # Endpoint for simulating entering OTP into 3DS Challenge UI. A call to + # /v1/three_ds_authentication/simulate that resulted in triggered SMS-OTP + # challenge must precede. Only a single attempt is supported; upon entering OTP, + # the challenge is either approved or declined. + sig do + params( + token: String, + otp: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def simulate_otp_entry( + # A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + token:, + # The OTP entered by the cardholder + otp:, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/three_ds/decisioning.rbi b/rbi/lib/lithic/resources/three_ds/decisioning.rbi new file mode 100644 index 00000000..902d314f --- /dev/null +++ b/rbi/lib/lithic/resources/three_ds/decisioning.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Lithic + module Resources + class ThreeDS + class Decisioning + # Card program's response to a 3DS Challenge Request (CReq) + sig do + params( + token: String, + challenge_response: Lithic::Models::ThreeDS::ChallengeResult::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def challenge_response( + # Globally unique identifier for the 3DS authentication. This token is sent as + # part of the initial 3DS Decisioning Request and as part of the 3DS Challenge + # Event in the [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) + # object + token:, + # Whether the Cardholder has Approved or Declined the issued Challenge + challenge_response:, + request_options: {} + ) + end + + # Retrieve the 3DS Decisioning HMAC secret key. If one does not exist for your + # program yet, calling this endpoint will create one for you. The headers (which + # you can use to verify 3DS Decisioning requests) will begin appearing shortly + # after calling this endpoint for the first time. See + # [this page](https://docs.lithic.com/docs/3ds-decisioning#3ds-decisioning-hmac-secrets) + # for more detail about verifying 3DS Decisioning requests. + sig do + params(request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))) + .returns(Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse) + end + def retrieve_secret(request_options: {}) + end + + # Generate a new 3DS Decisioning HMAC secret key. The old secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /three_ds_decisioning/secret`](https://docs.lithic.com/reference/getthreedsdecisioningsecret) + # request to retrieve the new secret key. + sig { params(request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))).void } + def rotate_secret(request_options: {}) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/tokenization_decisioning.rbi b/rbi/lib/lithic/resources/tokenization_decisioning.rbi new file mode 100644 index 00000000..3a1479b9 --- /dev/null +++ b/rbi/lib/lithic/resources/tokenization_decisioning.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Resources + class TokenizationDecisioning + # Retrieve the Tokenization Decisioning secret key. If one does not exist your + # program yet, calling this endpoint will create one for you. The headers of the + # Tokenization Decisioning request will contain a hmac signature which you can use + # to verify requests originate from Lithic. See + # [this page](https://docs.lithic.com/docs/events-api#verifying-webhooks) for more + # detail about verifying Tokenization Decisioning requests. + sig do + params(request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))) + .returns(Lithic::Models::TokenizationSecret) + end + def retrieve_secret(request_options: {}) + end + + # Generate a new Tokenization Decisioning secret key. The old Tokenization + # Decisioning secret key will be deactivated 24 hours after a successful request + # to this endpoint. + sig do + params(request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash))) + .returns(Lithic::Models::TokenizationDecisioningRotateSecretResponse) + end + def rotate_secret(request_options: {}) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/tokenizations.rbi b/rbi/lib/lithic/resources/tokenizations.rbi new file mode 100644 index 00000000..e6fdc541 --- /dev/null +++ b/rbi/lib/lithic/resources/tokenizations.rbi @@ -0,0 +1,250 @@ +# typed: strong + +module Lithic + module Resources + class Tokenizations + # Get tokenization + sig do + params( + tokenization_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TokenizationRetrieveResponse) + end + def retrieve( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # List card tokenizations + sig do + params( + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: Lithic::Models::TokenizationListParams::TokenizationChannel::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Tokenization]) + end + def list( + # Filters for tokenizations associated with a specific account. + account_token: nil, + # Filter for tokenizations created after this date. + begin_: nil, + # Filters for tokenizations associated with a specific card. + card_token: nil, + # Filter for tokenizations created before this date. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + tokenization_channel: nil, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to activate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network activates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. The endpoint may only + # be used on digital wallet tokenizations with status `INACTIVE`, + # `PENDING_ACTIVATION`, or `PENDING_2FA`. This will put the tokenization in an + # active state, and transactions will be allowed. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def activate( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to deactivate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network deactivates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. Authorizations + # attempted with a deactivated tokenization will be blocked and will not be + # forwarded to Lithic from the network. Deactivating the token is a permanent + # operation. If the target is a digital wallet tokenization, it will be removed + # from its device. Reach out at [lithic.com/contact](https://lithic.com/contact) + # for more information. + sig do + params( + tokenization_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def deactivate( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to pause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network pauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `ACTIVE`. A paused token will prevent + # merchants from sending authorizations, and is a temporary status that can be + # changed. Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + sig do + params( + tokenization_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def pause( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to send another activation code to + # a cardholder that has already tried tokenizing a card. A successful response + # indicates that the request was successfully delivered to the card network. The + # endpoint may only be used on Mastercard digital wallet tokenizations with status + # `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`. The network will send a new + # activation code to the one of the contact methods provided in the initial + # tokenization flow. If a user fails to enter the code correctly 3 times, the + # contact method will not be eligible for resending the activation code, and the + # cardholder must restart the provision process. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def resend_activation_code( + # Tokenization token + tokenization_token, + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + activation_method_type: nil, + request_options: {} + ) + end + + # This endpoint is used to simulate a card's tokenization in the Digital Wallet + # and merchant tokenization ecosystem. + sig do + params( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::TokenizationSource::OrSymbol, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TokenizationSimulateResponse) + end + def simulate( + # The three digit cvv for the card. + cvv:, + # The expiration date of the card in 'MM/YY' format. + expiration_date:, + # The sixteen digit card number. + pan:, + # The source of the tokenization request. + tokenization_source:, + # The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + account_score: nil, + # The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + device_score: nil, + # Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + entity: nil, + # The decision that the Digital Wallet's recommend + wallet_recommended_decision: nil, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to unpause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network unpauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `PAUSED`. This will put the tokenization in an + # active state, and transactions may resume. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def unpause( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used update the digital card art for a digital wallet + # tokenization. A successful response indicates that the card network has updated + # the tokenization's art, and the tokenization's `digital_cart_art_token` field + # was updated. The endpoint may not be used on tokenizations with status + # `DEACTIVATED`. Note that this updates the art for one specific tokenization, not + # all tokenizations for a card. New tokenizations for a card will be created with + # the art referenced in the card object's `digital_card_art_token` field. Reach + # out at [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + digital_card_art_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TokenizationUpdateDigitalCardArtResponse) + end + def update_digital_card_art( + # Tokenization token + tokenization_token, + # Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/transactions.rbi b/rbi/lib/lithic/resources/transactions.rbi new file mode 100644 index 00000000..7c127017 --- /dev/null +++ b/rbi/lib/lithic/resources/transactions.rbi @@ -0,0 +1,325 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + sig { returns(Lithic::Resources::Transactions::EnhancedCommercialData) } + attr_reader :enhanced_commercial_data + + sig { returns(Lithic::Resources::Transactions::Events) } + attr_reader :events + + # Get a specific card transaction. All amounts are in the smallest unit of their + # respective currency (e.g., cents for USD). + sig do + params( + transaction_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Transaction) + end + def retrieve( + # Globally unique identifier for the transaction. + transaction_token, + request_options: {} + ) + end + + # List card transactions. All amounts are in the smallest unit of their respective + # currency (e.g., cents for USD) and inclusive of any acquirer fees. + sig do + params( + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::Models::TransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::Models::TransactionListParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::CursorPage[Lithic::Models::Transaction]) + end + def list( + # Filters for transactions associated with a specific account. + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Filters for transactions associated with a specific card. + card_token: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filters for transactions using transaction status field. + status: nil, + request_options: {} + ) + end + + # Expire authorization + sig do + params( + transaction_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .void + end + def expire_authorization( + # The token of the transaction to expire. + transaction_token, + request_options: {} + ) + end + + # Simulates an authorization request from the card network as if it came from a + # merchant acquirer. If you are configured for ASA, simulating authorizations + # requires your ASA client to be set up properly, i.e. be able to respond to the + # ASA request with a valid JSON. For users that are not configured for ASA, a + # daily transaction limit of $5000 USD is applied by default. You can update this + # limit via the + # [update account](https://docs.lithic.com/reference/patchaccountbytoken) + # endpoint. + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: T::Boolean, + pin: String, + status: Lithic::Models::TransactionSimulateAuthorizationParams::Status::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TransactionSimulateAuthorizationResponse) + end + def simulate_authorization( + # Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + mcc: nil, + # Unique identifier to identify the payment card acceptor. + merchant_acceptor_id: nil, + # Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + merchant_amount: nil, + # 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + merchant_currency: nil, + # Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + partial_approval_capable: nil, + # Simulate entering a PIN. If omitted, PIN check will not be performed. + pin: nil, + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + status: nil, + request_options: {} + ) + end + + # Simulates an authorization advice from the card network as if it came from a + # merchant acquirer. An authorization advice changes the pending amount of the + # transaction. + sig do + params( + token: String, + amount: Integer, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TransactionSimulateAuthorizationAdviceResponse) + end + def simulate_authorization_advice( + # The transaction token returned from the /v1/simulate/authorize. response. + token:, + # Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + amount:, + request_options: {} + ) + end + + # Clears an existing authorization, either debit or credit. After this event, the + # transaction transitions from `PENDING` to `SETTLED` status. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + sig do + params( + token: String, + amount: Integer, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TransactionSimulateClearingResponse) + end + def simulate_clearing( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + # Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + amount: nil, + request_options: {} + ) + end + + # Simulates a credit authorization advice from the card network. This message + # indicates that the network approved a credit authorization on your behalf. + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TransactionSimulateCreditAuthorizationResponse) + end + def simulate_credit_authorization( + # Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + mcc: nil, + # Unique identifier to identify the payment card acceptor. + merchant_acceptor_id: nil, + request_options: {} + ) + end + + # Returns, or refunds, an amount back to a card. Returns simulated via this + # endpoint clear immediately, without prior authorization, and result in a + # `SETTLED` transaction status. + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TransactionSimulateReturnResponse) + end + def simulate_return( + # Amount (in cents) to authorize. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + request_options: {} + ) + end + + # Reverses a return, i.e. a credit transaction with a `SETTLED` status. Returns + # can be financial credit authorizations, or credit authorizations that have + # cleared. + sig do + params( + token: String, + request_options: T.nilable( + T.any( + Lithic::RequestOptions, + Lithic::Util::AnyHash + ) + ) + ) + .returns(Lithic::Models::TransactionSimulateReturnReversalResponse) + end + def simulate_return_reversal( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + request_options: {} + ) + end + + # Voids a pending authorization. If `amount` is not set, the full amount will be + # voided. Can be used on partially voided transactions but not partially cleared + # transactions. _Simulating an authorization expiry on credit authorizations or + # credit authorization advice is not currently supported but will be added soon._ + sig do + params( + token: String, + amount: Integer, + type: Lithic::Models::TransactionSimulateVoidParams::Type::OrSymbol, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::TransactionSimulateVoidResponse) + end + def simulate_void( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + # Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. + amount: nil, + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + type: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/resources/transactions/enhanced_commercial_data.rbi b/rbi/lib/lithic/resources/transactions/enhanced_commercial_data.rbi new file mode 100644 index 00000000..a7d3ac4c --- /dev/null +++ b/rbi/lib/lithic/resources/transactions/enhanced_commercial_data.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + class EnhancedCommercialData + # Get all L2/L3 enhanced commercial data associated with a transaction. Not + # available in sandbox. + sig do + params( + transaction_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse) + end + def retrieve( + # The token of the transaction that the enhanced data is associated with. + transaction_token, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/transactions/events.rbi b/rbi/lib/lithic/resources/transactions/events.rbi new file mode 100644 index 00000000..dc2c36a7 --- /dev/null +++ b/rbi/lib/lithic/resources/transactions/events.rbi @@ -0,0 +1,16 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + class Events + sig { returns(Lithic::Resources::Transactions::Events::EnhancedCommercialData) } + attr_reader :enhanced_commercial_data + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/transactions/events/enhanced_commercial_data.rbi b/rbi/lib/lithic/resources/transactions/events/enhanced_commercial_data.rbi new file mode 100644 index 00000000..277dd82e --- /dev/null +++ b/rbi/lib/lithic/resources/transactions/events/enhanced_commercial_data.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + class Events + class EnhancedCommercialData + # Get L2/L3 enhanced commercial data associated with a transaction event. Not + # available in sandbox. + sig do + params( + event_token: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Transactions::Events::EnhancedData) + end + def retrieve( + # The token of the transaction event that the enhanced data is associated with. + event_token, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lib/lithic/resources/transfers.rbi b/rbi/lib/lithic/resources/transfers.rbi new file mode 100644 index 00000000..2ae2baa0 --- /dev/null +++ b/rbi/lib/lithic/resources/transfers.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Resources + class Transfers + # Transfer funds between two financial accounts or between a financial account and + # card + sig do + params( + amount: Integer, + from: String, + to: String, + token: String, + memo: String, + request_options: T.nilable(T.any(Lithic::RequestOptions, Lithic::Util::AnyHash)) + ) + .returns(Lithic::Models::Transfer) + end + def create( + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + amount:, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + from:, + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + to:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # Optional descriptor for the transfer. + memo: nil, + request_options: {} + ) + end + + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lib/lithic/single_page.rbi b/rbi/lib/lithic/single_page.rbi new file mode 100644 index 00000000..42e1176b --- /dev/null +++ b/rbi/lib/lithic/single_page.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Lithic + class SinglePage + include Lithic::BasePage + + Elem = type_member + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig { returns(String) } + def inspect + end + end +end diff --git a/rbi/lib/lithic/util.rbi b/rbi/lib/lithic/util.rbi new file mode 100644 index 00000000..700fb6d4 --- /dev/null +++ b/rbi/lib/lithic/util.rbi @@ -0,0 +1,280 @@ +# typed: strong + +module Lithic + # @api private + module Util + # Due to the current WIP status of Shapes support in Sorbet, types referencing + # this alias might be refined in the future. + AnyHash = T.type_alias { T::Hash[Symbol, T.anything] } + + # @api private + sig { returns(Float) } + def self.monotonic_secs + end + + class << self + # @api private + sig { returns(String) } + def arch + end + + # @api private + sig { returns(String) } + def os + end + end + + class << self + # @api private + sig { params(input: T.anything).returns(T::Boolean) } + def primitive?(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(T::Boolean, T.anything)) } + def coerce_boolean(input) + end + + # @api private + sig { params(input: T.anything).returns(T.nilable(T::Boolean)) } + def coerce_boolean!(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(Integer, T.anything)) } + def coerce_integer(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(Float, T.anything)) } + def coerce_float(input) + end + + # @api private + sig { params(input: T.anything).returns(T.any(T::Hash[T.anything, T.anything], T.anything)) } + def coerce_hash(input) + end + end + + # Use this to indicate that a value should be explicitly removed from a data + # structure when using `Lithic::Util.deep_merge`. + # + # e.g. merging `{a: 1}` and `{a: OMIT}` should produce `{}`, where merging + # `{a: 1}` and `{}` would produce `{a: 1}`. + OMIT = T.let(T.anything, T.anything) + + class << self + # @api private + sig { params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns(T.anything) } + private def deep_merge_lr(lhs, rhs, concat: false) + end + + # @api private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + sig do + params(values: T::Array[T.anything], sentinel: T.nilable(T.anything), concat: T::Boolean) + .returns(T.anything) + end + def deep_merge( + *values, + # the value to return if no values are provided. + sentinel: nil, + # whether to merge sequences by concatenation. + concat: false + ) + end + + # @api private + sig do + params( + data: T.any(Lithic::Util::AnyHash, T::Array[T.anything], T.anything), + pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])), + sentinel: T.nilable(T.anything), + blk: T.nilable(T.proc.returns(T.anything)) + ) + .returns(T.nilable(T.anything)) + end + def dig(data, pick, sentinel = nil, &blk) + end + end + + class << self + # @api private + sig { params(uri: URI::Generic).returns(String) } + def uri_origin(uri) + end + + # @api private + sig { params(path: T.any(String, T::Array[String])).returns(String) } + def interpolate_path(path) + end + end + + class << self + # @api private + sig { params(query: T.nilable(String)).returns(T::Hash[String, T::Array[String]]) } + def decode_query(query) + end + + # @api private + sig do + params(query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) + .returns(T.nilable(String)) + end + def encode_query(query) + end + end + + ParsedUriShape = + T.type_alias do + { + scheme: T.nilable(String), + host: T.nilable(String), + port: T.nilable(Integer), + path: T.nilable(String), + query: T::Hash[String, T::Array[String]] + } + end + + class << self + # @api private + sig { params(url: T.any(URI::Generic, String)).returns(Lithic::Util::ParsedUriShape) } + def parse_uri(url) + end + + # @api private + sig { params(parsed: Lithic::Util::ParsedUriShape).returns(URI::Generic) } + def unparse_uri(parsed) + end + + # @api private + sig do + params(lhs: Lithic::Util::ParsedUriShape, rhs: Lithic::Util::ParsedUriShape).returns(URI::Generic) + end + def join_parsed_uri(lhs, rhs) + end + end + + class << self + # @api private + sig do + params( + headers: T::Hash[String, + T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))] + ) + .returns(T::Hash[String, String]) + end + def normalized_headers(*headers) + end + end + + # @api private + # + # An adapter that satisfies the IO interface required by `::IO.copy_stream` + class ReadIOAdapter + # @api private + sig { params(max_len: T.nilable(Integer)).returns(String) } + private def read_enum(max_len) + end + + # @api private + sig { params(max_len: T.nilable(Integer), out_string: T.nilable(String)).returns(T.nilable(String)) } + def read(max_len = nil, out_string = nil) + end + + # @api private + sig do + params( + stream: T.any(String, IO, StringIO, T::Enumerable[String]), + blk: T.proc.params(arg0: String).void + ) + .returns(T.attached_class) + end + def self.new(stream, &blk) + end + end + + class << self + sig { params(blk: T.proc.params(y: Enumerator::Yielder).void).returns(T::Enumerable[String]) } + def string_io(&blk) + end + end + + class << self + # @api private + sig do + params(y: Enumerator::Yielder, boundary: String, key: T.any(Symbol, String), val: T.anything).void + end + private def encode_multipart_formdata(y, boundary:, key:, val:) + end + + # @api private + sig { params(body: T.anything).returns([String, T::Enumerable[String]]) } + private def encode_multipart_streaming(body) + end + + # @api private + sig { params(headers: T::Hash[String, String], body: T.anything).returns(T.anything) } + def encode_content(headers, body) + end + + # @api private + sig do + params( + headers: T.any(T::Hash[String, String], Net::HTTPHeader), + stream: T::Enumerable[String], + suppress_error: T::Boolean + ) + .returns(T.anything) + end + def decode_content(headers, stream:, suppress_error: false) + end + end + + class << self + # @api private + # + # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html + sig do + params(enum: T::Enumerable[T.anything], external: T::Boolean, close: T.proc.void) + .returns(T::Enumerable[T.anything]) + end + def fused_enum(enum, external: false, &close) + end + + # @api private + sig { params(enum: T.nilable(T::Enumerable[T.anything])).void } + def close_fused!(enum) + end + + # @api private + sig do + params(enum: T.nilable(T::Enumerable[T.anything]), blk: T.proc.params(arg0: Enumerator::Yielder).void) + .returns(T::Enumerable[T.anything]) + end + def chain_fused(enum, &blk) + end + end + + ServerSentEvent = + T.type_alias do + {event: T.nilable(String), data: T.nilable(String), id: T.nilable(String), retry: T.nilable(Integer)} + end + + class << self + # @api private + sig { params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) } + def decode_lines(enum) + end + + # @api private + # + # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream + sig { params(lines: T::Enumerable[String]).returns(Lithic::Util::ServerSentEvent) } + def decode_sse(lines) + end + end + end +end diff --git a/rbi/lib/lithic/version.rbi b/rbi/lib/lithic/version.rbi new file mode 100644 index 00000000..c0afcd48 --- /dev/null +++ b/rbi/lib/lithic/version.rbi @@ -0,0 +1,5 @@ +# typed: strong + +module Lithic + VERSION = "0.1.0-alpha.1" +end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..61f7b564 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,64 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "ruby", + "version-file": "lib/lithic/version.rb" +} \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 00000000..88566757 --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then + brew bundle check >/dev/null 2>&1 || { + echo "==> Installing Homebrew dependencies…" + brew bundle + } +fi + +echo "==> Installing Ruby dependencies…" + +bundle install diff --git a/scripts/format b/scripts/format new file mode 100755 index 00000000..67b400de --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running formatters" +exec -- bundle exec rake format "$@" diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 00000000..39581dc1 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +exec -- bundle exec rake lint "$@" diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 00000000..d2814ae6 --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..2e1fe093 --- /dev/null +++ b/scripts/test @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +bundle exec rake test "$@" diff --git a/sig/lithic/base_client.rbs b/sig/lithic/base_client.rbs new file mode 100644 index 00000000..ba29ab3a --- /dev/null +++ b/sig/lithic/base_client.rbs @@ -0,0 +1,106 @@ +module Lithic + class BaseClient + type request_components = + { + method: Symbol, + path: String | ::Array[String], + query: ::Hash[String, (::Array[String] | String)?]?, + headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + body: top?, + unwrap: Symbol?, + page: Class?, + stream: Class?, + model: Lithic::Converter::input?, + options: Lithic::request_opts? + } + + type request_input = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + max_retries: Integer, + timeout: Float + } + + MAX_REDIRECTS: 20 + + PLATFORM_HEADERS: ::Hash[String, String] + + def self.validate!: (Lithic::BaseClient::request_components req) -> void + + def self.should_retry?: ( + Integer status, + headers: ::Hash[String, String] + ) -> bool + + def self.follow_redirect: ( + Lithic::BaseClient::request_input request, + status: Integer, + response_headers: ::Hash[String, String] + ) -> Lithic::BaseClient::request_input + + def self.reap_connection!: ( + Integer | Lithic::APIConnectionError status, + stream: Enumerable[String]? + ) -> void + + # @api private + attr_accessor requester: top + + def initialize: ( + base_url: String, + ?timeout: Float, + ?max_retries: Integer, + ?initial_retry_delay: Float, + ?max_retry_delay: Float, + ?headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?], + ?idempotency_header: String? + ) -> void + + private def auth_headers: -> ::Hash[String, String] + + private def generate_idempotency_key: -> String + + private def build_request: ( + Lithic::BaseClient::request_components req, + Lithic::request_options opts + ) -> Lithic::BaseClient::request_input + + private def retry_delay: ( + ::Hash[String, String] headers, + retry_count: Integer + ) -> Float + + private def send_request: ( + Lithic::BaseClient::request_input request, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: bool + ) -> [Integer, top, Enumerable[String]] + + def request: + ( + Symbol method, + String | ::Array[String] path, + ?query: ::Hash[String, (::Array[String] | String)?]?, + ?headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + ?body: top?, + ?unwrap: Symbol?, + ?page: Class?, + ?stream: Class?, + ?model: Lithic::Converter::input?, + ?options: Lithic::request_opts? + ) -> top + | (Lithic::BaseClient::request_components req) -> top + + def inspect: -> String + end +end diff --git a/sig/lithic/base_model.rbs b/sig/lithic/base_model.rbs new file mode 100644 index 00000000..88c7a747 --- /dev/null +++ b/sig/lithic/base_model.rbs @@ -0,0 +1,260 @@ +module Lithic + module Converter + type input = Lithic::Converter | Class + + def coerce: (top value) -> top + + def dump: (top value) -> top + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def self.type_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Lithic::Converter::input?, + union: ^-> Lithic::Converter::input? + } + | ^-> Lithic::Converter::input + | Lithic::Converter::input spec + ) -> (^-> top) + + def self.coerce: (Lithic::Converter::input target, top value) -> top + + def self.dump: (Lithic::Converter::input target, top value) -> top + + def self.try_strict_coerce: ( + Lithic::Converter::input target, + top value + ) -> top + end + + class Unknown + extend Lithic::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (top value) -> top + + def self.dump: (top value) -> top + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class BooleanModel + extend Lithic::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: (bool | top value) -> (bool | top) + + def self.dump: (bool | top value) -> (bool | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + module Enum + include Lithic::Converter + + def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] + + private def self.finalize!: -> void + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (String | Symbol | top value) -> (Symbol | top) + + def dump: (Symbol | top value) -> (Symbol | top) + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + module Union + include Lithic::Converter + + private def self.known_variants: -> ::Array[[Symbol?, (^-> Lithic::Converter::input)]] + + def self.derefed_variants: -> ::Array[[Symbol?, top]] + + def self.variants: -> ::Array[top] + + private def self.discriminator: (Symbol property) -> void + + private def self.variant: ( + Symbol + | ::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input key, + ?::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input spec + ) -> void + + private def self.resolve_variant: (top value) -> Lithic::Converter::input? + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (top value) -> top + + def dump: (top value) -> top + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + end + + class ArrayOf + include Lithic::Converter + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (Enumerable[top] | top value) -> (::Array[top] | top) + + def dump: (Enumerable[top] | top value) -> (::Array[top] | top) + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def item_type: -> top + + def initialize: ( + ::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + end + + class HashOf + include Lithic::Converter + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def coerce: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top) + + def dump: (::Hash[top, top] | top value) -> (::Hash[Symbol, top] | top) + + def try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def item_type: -> top + + def initialize: ( + ::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + end + + class BaseModel + extend Lithic::Converter + + type known_field = { mode: (:coerce | :dump)?, required: bool } + + def self.known_fields: -> ::Hash[Symbol, (Lithic::BaseModel::known_field + & { type_fn: (^-> Lithic::Converter::input) })] + + def self.reverse_map: -> ::Hash[Symbol, Symbol] + + def self.fields: -> ::Hash[Symbol, (Lithic::BaseModel::known_field + & { type: Lithic::Converter::input })] + + def self.defaults: -> ::Hash[Symbol, (^-> Class)] + + private def self.add_field: ( + Symbol name_sym, + required: bool, + type_info: { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Lithic::Converter::input?, + union: ^-> Lithic::Converter::input?, + api_name: Symbol + } + | ^-> Lithic::Converter::input + | Lithic::Converter::input, + spec: ::Hash[Symbol, top] + ) -> void + + def self.required: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def self.optional: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> Lithic::Converter::input + | Lithic::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + private def self.request_only: { -> void } -> void + + private def self.response_only: { -> void } -> void + + def ==: (top other) -> bool + + def self.coerce: ( + Lithic::BaseModel | ::Hash[top, top] | top value + ) -> (instance | top) + + def self.dump: (instance | top value) -> (::Hash[top, top] | top) + + def self.try_strict_coerce: ( + top value + ) -> ([true, top, nil] | [false, bool, Integer]) + + def []: (Symbol key) -> top? + + def to_h: -> ::Hash[Symbol, top] + + alias to_hash to_h + + def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] + + def initialize: (?::Hash[Symbol, top] | self data) -> void + + def to_s: -> String + + def inspect: -> String + end +end diff --git a/sig/lithic/base_page.rbs b/sig/lithic/base_page.rbs new file mode 100644 index 00000000..5bc621b2 --- /dev/null +++ b/sig/lithic/base_page.rbs @@ -0,0 +1,20 @@ +module Lithic + module BasePage[Elem] + def next_page?: -> bool + + def next_page: -> self + + def auto_paging_each: { (Elem arg0) -> void } -> void + + def to_enum: -> Enumerable[Elem] + + alias enum_for to_enum + + def initialize: ( + client: Lithic::BaseClient, + req: Lithic::BaseClient::request_components, + headers: ::Hash[String, String], + page_data: top + ) -> void + end +end diff --git a/sig/lithic/client.rbs b/sig/lithic/client.rbs new file mode 100644 index 00000000..2e067672 --- /dev/null +++ b/sig/lithic/client.rbs @@ -0,0 +1,84 @@ +module Lithic + class Client < Lithic::BaseClient + DEFAULT_MAX_RETRIES: 2 + + DEFAULT_TIMEOUT_IN_SECONDS: Float + + DEFAULT_INITIAL_RETRY_DELAY: Float + + DEFAULT_MAX_RETRY_DELAY: Float + + ENVIRONMENTS: { + production: "https://api.lithic.com", + sandbox: "https://sandbox.lithic.com" + } + + attr_reader api_key: String + + attr_reader accounts: Lithic::Resources::Accounts + + attr_reader account_holders: Lithic::Resources::AccountHolders + + attr_reader auth_rules: Lithic::Resources::AuthRules + + attr_reader auth_stream_enrollment: Lithic::Resources::AuthStreamEnrollment + + attr_reader tokenization_decisioning: Lithic::Resources::TokenizationDecisioning + + attr_reader tokenizations: Lithic::Resources::Tokenizations + + attr_reader cards: Lithic::Resources::Cards + + attr_reader balances: Lithic::Resources::Balances + + attr_reader aggregate_balances: Lithic::Resources::AggregateBalances + + attr_reader disputes: Lithic::Resources::Disputes + + attr_reader events: Lithic::Resources::Events + + attr_reader transfers: Lithic::Resources::Transfers + + attr_reader financial_accounts: Lithic::Resources::FinancialAccounts + + attr_reader transactions: Lithic::Resources::Transactions + + attr_reader responder_endpoints: Lithic::Resources::ResponderEndpoints + + attr_reader external_bank_accounts: Lithic::Resources::ExternalBankAccounts + + attr_reader payments: Lithic::Resources::Payments + + attr_reader three_ds: Lithic::Resources::ThreeDS + + attr_reader reports: Lithic::Resources::Reports + + attr_reader card_programs: Lithic::Resources::CardPrograms + + attr_reader digital_card_art: Lithic::Resources::DigitalCardArt + + attr_reader book_transfers: Lithic::Resources::BookTransfers + + attr_reader credit_products: Lithic::Resources::CreditProducts + + attr_reader external_payments: Lithic::Resources::ExternalPayments + + attr_reader management_operations: Lithic::Resources::ManagementOperations + + def api_status: ( + ?request_options: Lithic::request_opts + ) -> Lithic::Models::APIStatus + + private def auth_headers: -> ::Hash[String, String] + + def initialize: ( + ?environment: :production | :sandbox | nil, + ?base_url: String?, + ?api_key: String?, + ?max_retries: Integer, + ?timeout: Float, + ?initial_retry_delay: Float, + ?max_retry_delay: Float + ) -> void + end +end diff --git a/sig/lithic/cursor_page.rbs b/sig/lithic/cursor_page.rbs new file mode 100644 index 00000000..3bc79280 --- /dev/null +++ b/sig/lithic/cursor_page.rbs @@ -0,0 +1,11 @@ +module Lithic + class CursorPage[Elem] + include Lithic::BasePage[Elem] + + attr_accessor data: ::Array[Elem]? + + attr_accessor has_more: bool + + def inspect: -> String + end +end diff --git a/sig/lithic/errors.rbs b/sig/lithic/errors.rbs new file mode 100644 index 00000000..14cbd1a3 --- /dev/null +++ b/sig/lithic/errors.rbs @@ -0,0 +1,99 @@ +module Lithic + class Error < StandardError + attr_accessor cause: StandardError? + end + + class ConversionError < Lithic::Error + end + + class APIError < Lithic::Error + attr_accessor url: URI::Generic + + attr_accessor status: Integer? + + attr_accessor body: top? + + def initialize: ( + url: URI::Generic, + ?status: Integer?, + ?body: Object?, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APIConnectionError < Lithic::APIError + def initialize: ( + url: URI::Generic, + ?status: nil, + ?body: nil, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APITimeoutError < Lithic::APIConnectionError + def initialize: ( + url: URI::Generic, + ?status: nil, + ?body: nil, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APIStatusError < Lithic::APIError + def self.for: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil, + ?message: String? + ) -> instance + + def initialize: ( + url: URI::Generic, + status: Integer, + body: Object?, + request: nil, + response: nil, + ?message: String? + ) -> void + end + + class BadRequestError < Lithic::APIStatusError + HTTP_STATUS: 400 + end + + class AuthenticationError < Lithic::APIStatusError + HTTP_STATUS: 401 + end + + class PermissionDeniedError < Lithic::APIStatusError + HTTP_STATUS: 403 + end + + class NotFoundError < Lithic::APIStatusError + HTTP_STATUS: 404 + end + + class ConflictError < Lithic::APIStatusError + HTTP_STATUS: 409 + end + + class UnprocessableEntityError < Lithic::APIStatusError + HTTP_STATUS: 422 + end + + class RateLimitError < Lithic::APIStatusError + HTTP_STATUS: 429 + end + + class InternalServerError < Lithic::APIStatusError + HTTP_STATUS: Range[Integer] + end +end diff --git a/sig/lithic/extern.rbs b/sig/lithic/extern.rbs new file mode 100644 index 00000000..23ee0df9 --- /dev/null +++ b/sig/lithic/extern.rbs @@ -0,0 +1,4 @@ +module Lithic + module Extern + end +end diff --git a/sig/lithic/models/account.rbs b/sig/lithic/models/account.rbs new file mode 100644 index 00000000..04b3ae9e --- /dev/null +++ b/sig/lithic/models/account.rbs @@ -0,0 +1,152 @@ +module Lithic + module Models + type account = + { + token: String, + created: Time?, + spend_limit: Lithic::Models::Account::SpendLimit, + state: Lithic::Models::Account::state, + account_holder: Lithic::Models::Account::AccountHolder, + auth_rule_tokens: ::Array[String], + cardholder_currency: String, + verification_address: Lithic::Models::Account::VerificationAddress + } + + class Account < Lithic::BaseModel + attr_accessor token: String + + attr_accessor created: Time? + + attr_accessor spend_limit: Lithic::Models::Account::SpendLimit + + attr_accessor state: Lithic::Models::Account::state + + attr_reader account_holder: Lithic::Models::Account::AccountHolder? + + def account_holder=: ( + Lithic::Models::Account::AccountHolder + ) -> Lithic::Models::Account::AccountHolder + + attr_reader auth_rule_tokens: ::Array[String]? + + def auth_rule_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader cardholder_currency: String? + + def cardholder_currency=: (String) -> String + + attr_reader verification_address: Lithic::Models::Account::VerificationAddress? + + def verification_address=: ( + Lithic::Models::Account::VerificationAddress + ) -> Lithic::Models::Account::VerificationAddress + + def initialize: ( + token: String, + created: Time?, + spend_limit: Lithic::Models::Account::SpendLimit, + state: Lithic::Models::Account::state, + ?account_holder: Lithic::Models::Account::AccountHolder, + ?auth_rule_tokens: ::Array[String], + ?cardholder_currency: String, + ?verification_address: Lithic::Models::Account::VerificationAddress + ) -> void + + def to_hash: -> Lithic::Models::account + + type spend_limit = { daily: Integer, lifetime: Integer, monthly: Integer } + + class SpendLimit < Lithic::BaseModel + attr_accessor daily: Integer + + attr_accessor lifetime: Integer + + attr_accessor monthly: Integer + + def initialize: ( + daily: Integer, + lifetime: Integer, + monthly: Integer + ) -> void + + def to_hash: -> Lithic::Models::Account::spend_limit + end + + type state = :ACTIVE | :PAUSED | :CLOSED + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + PAUSED: :PAUSED + CLOSED: :CLOSED + + def self?.values: -> ::Array[Lithic::Models::Account::state] + end + + type account_holder = + { + token: String, + business_account_token: String, + email: String, + phone_number: String + } + + class AccountHolder < Lithic::BaseModel + attr_accessor token: String + + attr_accessor business_account_token: String + + attr_accessor email: String + + attr_accessor phone_number: String + + def initialize: ( + token: String, + business_account_token: String, + email: String, + phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::Account::account_holder + end + + type verification_address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class VerificationAddress < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::Account::verification_address + end + end + end +end diff --git a/sig/lithic/models/account_financial_account_type.rbs b/sig/lithic/models/account_financial_account_type.rbs new file mode 100644 index 00000000..90277b8f --- /dev/null +++ b/sig/lithic/models/account_financial_account_type.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type account_financial_account_type = :ISSUING | :OPERATING + + module AccountFinancialAccountType + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + + def self?.values: -> ::Array[Lithic::Models::account_financial_account_type] + end + end +end diff --git a/sig/lithic/models/account_holder.rbs b/sig/lithic/models/account_holder.rbs new file mode 100644 index 00000000..33622403 --- /dev/null +++ b/sig/lithic/models/account_holder.rbs @@ -0,0 +1,512 @@ +module Lithic + module Models + type account_holder = + { + token: String, + created: Time, + account_token: String, + beneficial_owner_entities: ::Array[Lithic::Models::AccountHolder::BeneficialOwnerEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolder::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::Models::AccountHolder::BusinessEntity, + control_person: Lithic::Models::AccountHolder::ControlPerson, + email: String, + exemption_type: Lithic::Models::AccountHolder::exemption_type, + external_id: String, + individual: Lithic::Models::AccountHolder::Individual, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::Models::RequiredDocument], + status: Lithic::Models::AccountHolder::status, + status_reasons: ::Array[Lithic::Models::AccountHolder::status_reason], + user_type: Lithic::Models::AccountHolder::user_type, + verification_application: Lithic::Models::AccountHolder::VerificationApplication, + website_url: String + } + + class AccountHolder < Lithic::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader beneficial_owner_entities: ::Array[Lithic::Models::AccountHolder::BeneficialOwnerEntity]? + + def beneficial_owner_entities=: ( + ::Array[Lithic::Models::AccountHolder::BeneficialOwnerEntity] + ) -> ::Array[Lithic::Models::AccountHolder::BeneficialOwnerEntity] + + attr_reader beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolder::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::Models::AccountHolder::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::Models::AccountHolder::BeneficialOwnerIndividual] + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader business_entity: Lithic::Models::AccountHolder::BusinessEntity? + + def business_entity=: ( + Lithic::Models::AccountHolder::BusinessEntity + ) -> Lithic::Models::AccountHolder::BusinessEntity + + attr_reader control_person: Lithic::Models::AccountHolder::ControlPerson? + + def control_person=: ( + Lithic::Models::AccountHolder::ControlPerson + ) -> Lithic::Models::AccountHolder::ControlPerson + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader exemption_type: Lithic::Models::AccountHolder::exemption_type? + + def exemption_type=: ( + Lithic::Models::AccountHolder::exemption_type + ) -> Lithic::Models::AccountHolder::exemption_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader individual: Lithic::Models::AccountHolder::Individual? + + def individual=: ( + Lithic::Models::AccountHolder::Individual + ) -> Lithic::Models::AccountHolder::Individual + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::Models::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::Models::RequiredDocument] + ) -> ::Array[Lithic::Models::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolder::status? + + def status=: ( + Lithic::Models::AccountHolder::status + ) -> Lithic::Models::AccountHolder::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolder::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolder::status_reason] + ) -> ::Array[Lithic::Models::AccountHolder::status_reason] + + attr_reader user_type: Lithic::Models::AccountHolder::user_type? + + def user_type=: ( + Lithic::Models::AccountHolder::user_type + ) -> Lithic::Models::AccountHolder::user_type + + attr_reader verification_application: Lithic::Models::AccountHolder::VerificationApplication? + + def verification_application=: ( + Lithic::Models::AccountHolder::VerificationApplication + ) -> Lithic::Models::AccountHolder::VerificationApplication + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + token: String, + created: Time, + ?account_token: String, + ?beneficial_owner_entities: ::Array[Lithic::Models::AccountHolder::BeneficialOwnerEntity], + ?beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolder::BeneficialOwnerIndividual], + ?business_account_token: String, + ?business_entity: Lithic::Models::AccountHolder::BusinessEntity, + ?control_person: Lithic::Models::AccountHolder::ControlPerson, + ?email: String, + ?exemption_type: Lithic::Models::AccountHolder::exemption_type, + ?external_id: String, + ?individual: Lithic::Models::AccountHolder::Individual, + ?nature_of_business: String, + ?phone_number: String, + ?required_documents: ::Array[Lithic::Models::RequiredDocument], + ?status: Lithic::Models::AccountHolder::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolder::status_reason], + ?user_type: Lithic::Models::AccountHolder::user_type, + ?verification_application: Lithic::Models::AccountHolder::VerificationApplication, + ?website_url: String + ) -> void + + def to_hash: -> Lithic::Models::account_holder + + type beneficial_owner_entity = + { + address: Lithic::Models::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + parent_company: String + } + + class BeneficialOwnerEntity < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dba_business_name: String + + attr_accessor entity_token: String + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?parent_company: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolder::beneficial_owner_entity + end + + type beneficial_owner_individual = + { + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor entity_token: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolder::beneficial_owner_individual + end + + type business_entity = + { + address: Lithic::Models::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + parent_company: String + } + + class BusinessEntity < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dba_business_name: String + + attr_accessor entity_token: String + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?parent_company: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolder::business_entity + end + + type control_person = + { + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor entity_token: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolder::control_person + end + + type exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module ExemptionType + extend Lithic::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::exemption_type] + end + + type individual = + { + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor entity_token: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolder::individual + end + + type status = + :ACCEPTED + | :PENDING_REVIEW + | :PENDING_DOCUMENT + | :PENDING_RESUBMIT + | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::status_reason] + end + + type user_type = :BUSINESS | :INDIVIDUAL + + module UserType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::user_type] + end + + type verification_application = + { + created: Time, + status: Lithic::Models::AccountHolder::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason], + updated: Time + } + + class VerificationApplication < Lithic::BaseModel + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader status: Lithic::Models::AccountHolder::VerificationApplication::status? + + def status=: ( + Lithic::Models::AccountHolder::VerificationApplication::status + ) -> Lithic::Models::AccountHolder::VerificationApplication::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason] + ) -> ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason] + + attr_reader updated: Time? + + def updated=: (Time) -> Time + + def initialize: ( + ?created: Time, + ?status: Lithic::Models::AccountHolder::VerificationApplication::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason], + ?updated: Time + ) -> void + + def to_hash: -> Lithic::Models::AccountHolder::verification_application + + type status = + :ACCEPTED + | :PENDING_REVIEW + | :PENDING_DOCUMENT + | :PENDING_RESUBMIT + | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::VerificationApplication::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason] + end + end + end + end +end diff --git a/sig/lithic/models/account_holder_create_params.rbs b/sig/lithic/models/account_holder_create_params.rbs new file mode 100644 index 00000000..7f3c14f5 --- /dev/null +++ b/sig/lithic/models/account_holder_create_params.rbs @@ -0,0 +1,325 @@ +module Lithic + module Models + type account_holder_create_params = + { + beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual], + business_entity: Lithic::Models::AccountHolderCreateParams::BusinessEntity, + control_person: Lithic::Models::AccountHolderCreateParams::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::AccountHolderCreateParams::workflow, + external_id: String, + kyb_passed_timestamp: String, + website_url: String, + individual: Lithic::Models::AccountHolderCreateParams::Individual, + kyc_passed_timestamp: String, + address: Lithic::Models::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::AccountHolderCreateParams::kyc_exemption_type, + last_name: String, + phone_number: String, + business_account_token: String + } + & Lithic::request_parameters + + class AccountHolderCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity] + + attr_accessor beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual] + + attr_accessor business_entity: Lithic::Models::AccountHolderCreateParams::BusinessEntity + + attr_accessor control_person: Lithic::Models::AccountHolderCreateParams::ControlPerson + + attr_accessor nature_of_business: String + + attr_accessor tos_timestamp: String + + attr_accessor workflow: Lithic::Models::AccountHolderCreateParams::workflow + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader kyb_passed_timestamp: String? + + def kyb_passed_timestamp=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + attr_accessor individual: Lithic::Models::AccountHolderCreateParams::Individual + + attr_reader kyc_passed_timestamp: String? + + def kyc_passed_timestamp=: (String) -> String + + attr_accessor address: Lithic::Models::Address + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor kyc_exemption_type: Lithic::Models::AccountHolderCreateParams::kyc_exemption_type + + attr_accessor last_name: String + + attr_accessor phone_number: String + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + def initialize: ( + beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual], + business_entity: Lithic::Models::AccountHolderCreateParams::BusinessEntity, + control_person: Lithic::Models::AccountHolderCreateParams::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::AccountHolderCreateParams::workflow, + individual: Lithic::Models::AccountHolderCreateParams::Individual, + address: Lithic::Models::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::AccountHolderCreateParams::kyc_exemption_type, + last_name: String, + phone_number: String, + ?external_id: String, + ?kyb_passed_timestamp: String, + ?website_url: String, + ?kyc_passed_timestamp: String, + ?business_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_holder_create_params + + type beneficial_owner_entity = + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String + } + + class BeneficialOwnerEntity < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?dba_business_name: String, + ?parent_company: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderCreateParams::beneficial_owner_entity + end + + type beneficial_owner_individual = + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderCreateParams::beneficial_owner_individual + end + + type business_entity = + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String + } + + class BusinessEntity < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?dba_business_name: String, + ?parent_company: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderCreateParams::business_entity + end + + type control_person = + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderCreateParams::control_person + end + + type workflow = :KYC_EXEMPT + + module Workflow + extend Lithic::Enum + + KYC_EXEMPT: :KYC_EXEMPT + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreateParams::workflow] + end + + type individual = + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderCreateParams::individual + end + + type kyc_exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module KYCExemptionType + extend Lithic::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreateParams::kyc_exemption_type] + end + end + end +end diff --git a/sig/lithic/models/account_holder_create_response.rbs b/sig/lithic/models/account_holder_create_response.rbs new file mode 100644 index 00000000..aa42fed1 --- /dev/null +++ b/sig/lithic/models/account_holder_create_response.rbs @@ -0,0 +1,126 @@ +module Lithic + module Models + type account_holder_create_response = + { + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason], + created: Time, + external_id: String, + required_documents: ::Array[Lithic::Models::RequiredDocument] + } + + class AccountHolderCreateResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor status: Lithic::Models::AccountHolderCreateResponse::status + + attr_accessor status_reasons: ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason] + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::Models::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::Models::RequiredDocument] + ) -> ::Array[Lithic::Models::RequiredDocument] + + def initialize: ( + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason], + ?created: Time, + ?external_id: String, + ?required_documents: ::Array[Lithic::Models::RequiredDocument] + ) -> void + + def to_hash: -> Lithic::Models::account_holder_create_response + + type status = + :ACCEPTED + | :PENDING_REVIEW + | :PENDING_DOCUMENT + | :PENDING_RESUBMIT + | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreateResponse::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason] + end + end + end +end diff --git a/sig/lithic/models/account_holder_list_documents_params.rbs b/sig/lithic/models/account_holder_list_documents_params.rbs new file mode 100644 index 00000000..57ba4bbd --- /dev/null +++ b/sig/lithic/models/account_holder_list_documents_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type account_holder_list_documents_params = + { } & Lithic::request_parameters + + class AccountHolderListDocumentsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::account_holder_list_documents_params + end + end +end diff --git a/sig/lithic/models/account_holder_list_documents_response.rbs b/sig/lithic/models/account_holder_list_documents_response.rbs new file mode 100644 index 00000000..9fe67603 --- /dev/null +++ b/sig/lithic/models/account_holder_list_documents_response.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type account_holder_list_documents_response = + { data: ::Array[Lithic::Models::Document] } + + class AccountHolderListDocumentsResponse < Lithic::BaseModel + attr_reader data: ::Array[Lithic::Models::Document]? + + def data=: ( + ::Array[Lithic::Models::Document] + ) -> ::Array[Lithic::Models::Document] + + def initialize: (?data: ::Array[Lithic::Models::Document]) -> void + + def to_hash: -> Lithic::Models::account_holder_list_documents_response + end + end +end diff --git a/sig/lithic/models/account_holder_list_params.rbs b/sig/lithic/models/account_holder_list_params.rbs new file mode 100644 index 00000000..c96eb97f --- /dev/null +++ b/sig/lithic/models/account_holder_list_params.rbs @@ -0,0 +1,85 @@ +module Lithic + module Models + type account_holder_list_params = + { + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String + } + & Lithic::request_parameters + + class AccountHolderListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?email: String, + ?end_: Time, + ?ending_before: String, + ?external_id: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?limit: Integer, + ?phone_number: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_holder_list_params + end + end +end diff --git a/sig/lithic/models/account_holder_retrieve_document_params.rbs b/sig/lithic/models/account_holder_retrieve_document_params.rbs new file mode 100644 index 00000000..2a56cbc8 --- /dev/null +++ b/sig/lithic/models/account_holder_retrieve_document_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type account_holder_retrieve_document_params = + { account_holder_token: String } & Lithic::request_parameters + + class AccountHolderRetrieveDocumentParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor account_holder_token: String + + def initialize: ( + account_holder_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_holder_retrieve_document_params + end + end +end diff --git a/sig/lithic/models/account_holder_retrieve_params.rbs b/sig/lithic/models/account_holder_retrieve_params.rbs new file mode 100644 index 00000000..d7f1e19d --- /dev/null +++ b/sig/lithic/models/account_holder_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type account_holder_retrieve_params = { } & Lithic::request_parameters + + class AccountHolderRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::account_holder_retrieve_params + end + end +end diff --git a/sig/lithic/models/account_holder_simulate_enrollment_document_review_params.rbs b/sig/lithic/models/account_holder_simulate_enrollment_document_review_params.rbs new file mode 100644 index 00000000..62e79c0f --- /dev/null +++ b/sig/lithic/models/account_holder_simulate_enrollment_document_review_params.rbs @@ -0,0 +1,85 @@ +module Lithic + module Models + type account_holder_simulate_enrollment_document_review_params = + { + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status, + accepted_entity_status_reasons: ::Array[String], + status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason + } + & Lithic::request_parameters + + class AccountHolderSimulateEnrollmentDocumentReviewParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor document_upload_token: String + + attr_accessor status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status + + attr_reader accepted_entity_status_reasons: ::Array[String]? + + def accepted_entity_status_reasons=: (::Array[String]) -> ::Array[String] + + attr_reader status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason? + + def status_reason=: ( + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason + ) -> Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason + + def initialize: ( + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status, + ?accepted_entity_status_reasons: ::Array[String], + ?status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_holder_simulate_enrollment_document_review_params + + type status = :UPLOADED | :ACCEPTED | :REJECTED | :PARTIAL_APPROVAL + + module Status + extend Lithic::Enum + + UPLOADED: :UPLOADED + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + PARTIAL_APPROVAL: :PARTIAL_APPROVAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status] + end + + type status_reason = + :DOCUMENT_MISSING_REQUIRED_DATA + | :DOCUMENT_UPLOAD_TOO_BLURRY + | :FILE_SIZE_TOO_LARGE + | :INVALID_DOCUMENT_TYPE + | :INVALID_DOCUMENT_UPLOAD + | :INVALID_ENTITY + | :DOCUMENT_EXPIRED + | :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + | :DOCUMENT_TYPE_NOT_SUPPORTED + | :UNKNOWN_FAILURE_REASON + | :UNKNOWN_ERROR + + module StatusReason + extend Lithic::Enum + + DOCUMENT_MISSING_REQUIRED_DATA: :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY: :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE: :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE: :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD: :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY: :INVALID_ENTITY + DOCUMENT_EXPIRED: :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS: :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED: :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON: :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR: :UNKNOWN_ERROR + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason] + end + end + end +end diff --git a/sig/lithic/models/account_holder_simulate_enrollment_review_params.rbs b/sig/lithic/models/account_holder_simulate_enrollment_review_params.rbs new file mode 100644 index 00000000..ce119aa1 --- /dev/null +++ b/sig/lithic/models/account_holder_simulate_enrollment_review_params.rbs @@ -0,0 +1,95 @@ +module Lithic + module Models + type account_holder_simulate_enrollment_review_params = + { + account_holder_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + } + & Lithic::request_parameters + + class AccountHolderSimulateEnrollmentReviewParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_holder_token: String? + + def account_holder_token=: (String) -> String + + attr_reader status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status? + + def status=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + ) -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + + def initialize: ( + ?account_holder_token: String, + ?status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_holder_simulate_enrollment_review_params + + type status = :ACCEPTED | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status] + end + + type status_reason = + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Enum + + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + end + end + end +end diff --git a/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs b/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs new file mode 100644 index 00000000..c9e19c56 --- /dev/null +++ b/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs @@ -0,0 +1,608 @@ +module Lithic + module Models + type account_holder_simulate_enrollment_review_response = + { + token: String, + account_token: String, + beneficial_owner_entities: ::Array[Lithic::Models::KYBBusinessEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::Models::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type, + external_id: String, + individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::Models::RequiredDocument], + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason], + user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type, + verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + website_url: String + } + + class AccountHolderSimulateEnrollmentReviewResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader beneficial_owner_entities: ::Array[Lithic::Models::KYBBusinessEntity]? + + def beneficial_owner_entities=: ( + ::Array[Lithic::Models::KYBBusinessEntity] + ) -> ::Array[Lithic::Models::KYBBusinessEntity] + + attr_reader beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual] + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader business_entity: Lithic::Models::KYBBusinessEntity? + + def business_entity=: ( + Lithic::Models::KYBBusinessEntity + ) -> Lithic::Models::KYBBusinessEntity + + attr_reader control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson? + + def control_person=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type? + + def exemption_type=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual? + + def individual=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::Models::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::Models::RequiredDocument] + ) -> ::Array[Lithic::Models::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status? + + def status=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason] + ) -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason] + + attr_reader user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type? + + def user_type=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type + + attr_reader verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication? + + def verification_application=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + ?token: String, + ?account_token: String, + ?beneficial_owner_entities: ::Array[Lithic::Models::KYBBusinessEntity], + ?beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual], + ?business_account_token: String, + ?business_entity: Lithic::Models::KYBBusinessEntity, + ?control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + ?created: Time, + ?email: String, + ?exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type, + ?external_id: String, + ?individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + ?nature_of_business: String, + ?phone_number: String, + ?required_documents: ::Array[Lithic::Models::RequiredDocument], + ?status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason], + ?user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type, + ?verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + ?website_url: String + ) -> void + + def to_hash: -> Lithic::Models::account_holder_simulate_enrollment_review_response + + type beneficial_owner_individual = + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::BaseModel + attr_reader address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::beneficial_owner_individual + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::address + end + end + + type control_person = + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::BaseModel + attr_reader address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address? + + def address=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::control_person + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::address + end + end + + type exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module ExemptionType + extend Lithic::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type] + end + + type individual = + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::BaseModel + attr_reader address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address? + + def address=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::individual + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::address + end + end + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason] + end + + type user_type = :BUSINESS | :INDIVIDUAL + + module UserType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type] + end + + type verification_application = + { + created: Time, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason], + updated: Time + } + + class VerificationApplication < Lithic::BaseModel + attr_accessor created: Time + + attr_accessor status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status + + attr_accessor status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason] + + attr_accessor updated: Time + + def initialize: ( + created: Time, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason], + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::verification_application + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason] + end + end + end + end +end diff --git a/sig/lithic/models/account_holder_update_params.rbs b/sig/lithic/models/account_holder_update_params.rbs new file mode 100644 index 00000000..8a31c358 --- /dev/null +++ b/sig/lithic/models/account_holder_update_params.rbs @@ -0,0 +1,404 @@ +module Lithic + module Models + type account_holder_update_params = + { + beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual], + business_entity: Lithic::Models::AccountHolderUpdateParams::BusinessEntity, + control_person: Lithic::Models::AccountHolderUpdateParams::ControlPerson, + external_id: String, + nature_of_business: String, + website_url: String, + individual: Lithic::Models::AccountHolderUpdateParams::Individual, + address: Lithic::Models::AddressUpdate, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + & Lithic::request_parameters + + class AccountHolderUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity]? + + def beneficial_owner_entities=: ( + ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity] + ) -> ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity] + + attr_reader beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual] + + attr_reader business_entity: Lithic::Models::AccountHolderUpdateParams::BusinessEntity? + + def business_entity=: ( + Lithic::Models::AccountHolderUpdateParams::BusinessEntity + ) -> Lithic::Models::AccountHolderUpdateParams::BusinessEntity + + attr_reader control_person: Lithic::Models::AccountHolderUpdateParams::ControlPerson? + + def control_person=: ( + Lithic::Models::AccountHolderUpdateParams::ControlPerson + ) -> Lithic::Models::AccountHolderUpdateParams::ControlPerson + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + attr_reader individual: Lithic::Models::AccountHolderUpdateParams::Individual? + + def individual=: ( + Lithic::Models::AccountHolderUpdateParams::Individual + ) -> Lithic::Models::AccountHolderUpdateParams::Individual + + attr_reader address: Lithic::Models::AddressUpdate? + + def address=: ( + Lithic::Models::AddressUpdate + ) -> Lithic::Models::AddressUpdate + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity], + ?beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual], + ?business_entity: Lithic::Models::AccountHolderUpdateParams::BusinessEntity, + ?control_person: Lithic::Models::AccountHolderUpdateParams::ControlPerson, + ?external_id: String, + ?nature_of_business: String, + ?website_url: String, + ?individual: Lithic::Models::AccountHolderUpdateParams::Individual, + ?address: Lithic::Models::AddressUpdate, + ?business_account_token: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_holder_update_params + + type beneficial_owner_entity = + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: ::Array[String] + } + + class BeneficialOwnerEntity < Lithic::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::Models::AddressUpdate? + + def address=: ( + Lithic::Models::AddressUpdate + ) -> Lithic::Models::AddressUpdate + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + attr_reader phone_numbers: ::Array[String]? + + def phone_numbers=: (::Array[String]) -> ::Array[String] + + def initialize: ( + entity_token: String, + ?address: Lithic::Models::AddressUpdate, + ?dba_business_name: String, + ?government_id: String, + ?legal_business_name: String, + ?parent_company: String, + ?phone_numbers: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateParams::beneficial_owner_entity + end + + type beneficial_owner_individual = + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::Models::AddressUpdate? + + def address=: ( + Lithic::Models::AddressUpdate + ) -> Lithic::Models::AddressUpdate + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + def initialize: ( + entity_token: String, + ?address: Lithic::Models::AddressUpdate, + ?dob: String, + ?email: String, + ?first_name: String, + ?government_id: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateParams::beneficial_owner_individual + end + + type business_entity = + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: ::Array[String] + } + + class BusinessEntity < Lithic::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::Models::AddressUpdate? + + def address=: ( + Lithic::Models::AddressUpdate + ) -> Lithic::Models::AddressUpdate + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + attr_reader phone_numbers: ::Array[String]? + + def phone_numbers=: (::Array[String]) -> ::Array[String] + + def initialize: ( + entity_token: String, + ?address: Lithic::Models::AddressUpdate, + ?dba_business_name: String, + ?government_id: String, + ?legal_business_name: String, + ?parent_company: String, + ?phone_numbers: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateParams::business_entity + end + + type control_person = + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::Models::AddressUpdate? + + def address=: ( + Lithic::Models::AddressUpdate + ) -> Lithic::Models::AddressUpdate + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + def initialize: ( + entity_token: String, + ?address: Lithic::Models::AddressUpdate, + ?dob: String, + ?email: String, + ?first_name: String, + ?government_id: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateParams::control_person + end + + type individual = + { + entity_token: String, + address: Lithic::Models::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::Models::AddressUpdate? + + def address=: ( + Lithic::Models::AddressUpdate + ) -> Lithic::Models::AddressUpdate + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + def initialize: ( + entity_token: String, + ?address: Lithic::Models::AddressUpdate, + ?dob: String, + ?email: String, + ?first_name: String, + ?government_id: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateParams::individual + end + end + end +end diff --git a/sig/lithic/models/account_holder_update_response.rbs b/sig/lithic/models/account_holder_update_response.rbs new file mode 100644 index 00000000..8166c097 --- /dev/null +++ b/sig/lithic/models/account_holder_update_response.rbs @@ -0,0 +1,716 @@ +module Lithic + module Models + type account_holder_update_response = + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse + | Lithic::Models::AccountHolderUpdateResponse::PatchResponse + + module AccountHolderUpdateResponse + extend Lithic::Union + + type kybkyc_patch_response = + { + token: String, + account_token: String, + beneficial_owner_entities: ::Array[Lithic::Models::KYBBusinessEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::Models::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type, + external_id: String, + individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::Models::RequiredDocument], + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason], + user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type, + verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + website_url: String + } + + class KYBKYCPatchResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader beneficial_owner_entities: ::Array[Lithic::Models::KYBBusinessEntity]? + + def beneficial_owner_entities=: ( + ::Array[Lithic::Models::KYBBusinessEntity] + ) -> ::Array[Lithic::Models::KYBBusinessEntity] + + attr_reader beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual] + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader business_entity: Lithic::Models::KYBBusinessEntity? + + def business_entity=: ( + Lithic::Models::KYBBusinessEntity + ) -> Lithic::Models::KYBBusinessEntity + + attr_reader control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson? + + def control_person=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type? + + def exemption_type=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual? + + def individual=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::Models::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::Models::RequiredDocument] + ) -> ::Array[Lithic::Models::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status? + + def status=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason] + ) -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason] + + attr_reader user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type? + + def user_type=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type + + attr_reader verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication? + + def verification_application=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + ?token: String, + ?account_token: String, + ?beneficial_owner_entities: ::Array[Lithic::Models::KYBBusinessEntity], + ?beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual], + ?business_account_token: String, + ?business_entity: Lithic::Models::KYBBusinessEntity, + ?control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + ?created: Time, + ?email: String, + ?exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type, + ?external_id: String, + ?individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + ?nature_of_business: String, + ?phone_number: String, + ?required_documents: ::Array[Lithic::Models::RequiredDocument], + ?status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason], + ?user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type, + ?verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + ?website_url: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::kybkyc_patch_response + + type beneficial_owner_individual = + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::BaseModel + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::beneficial_owner_individual + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::address + end + end + + type control_person = + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::BaseModel + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::control_person + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::address + end + end + + type exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module ExemptionType + extend Lithic::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type] + end + + type individual = + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::BaseModel + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::individual + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::address + end + end + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason] + end + + type user_type = :BUSINESS | :INDIVIDUAL + + module UserType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type] + end + + type verification_application = + { + created: Time, + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason], + updated: Time + } + + class VerificationApplication < Lithic::BaseModel + attr_accessor created: Time + + attr_accessor status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status + + attr_accessor status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason] + + attr_accessor updated: Time + + def initialize: ( + created: Time, + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason], + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::verification_application + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason] + end + end + end + + type patch_response = + { + token: String, + address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + class PatchResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?token: String, + ?address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + ?business_account_token: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::patch_response + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::AccountHolderUpdateResponse::PatchResponse::address + end + end + + def self?.variants: -> [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, Lithic::Models::AccountHolderUpdateResponse::PatchResponse] + end + end +end diff --git a/sig/lithic/models/account_holder_upload_document_params.rbs b/sig/lithic/models/account_holder_upload_document_params.rbs new file mode 100644 index 00000000..37d60ffe --- /dev/null +++ b/sig/lithic/models/account_holder_upload_document_params.rbs @@ -0,0 +1,74 @@ +module Lithic + module Models + type account_holder_upload_document_params = + { + document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type, + entity_token: String + } + & Lithic::request_parameters + + class AccountHolderUploadDocumentParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type + + attr_accessor entity_token: String + + def initialize: ( + document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type, + entity_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_holder_upload_document_params + + type document_type = + :EIN_LETTER + | :TAX_RETURN + | :OPERATING_AGREEMENT + | :CERTIFICATE_OF_FORMATION + | :DRIVERS_LICENSE + | :PASSPORT + | :PASSPORT_CARD + | :CERTIFICATE_OF_GOOD_STANDING + | :ARTICLES_OF_INCORPORATION + | :ARTICLES_OF_ORGANIZATION + | :BYLAWS + | :GOVERNMENT_BUSINESS_LICENSE + | :PARTNERSHIP_AGREEMENT + | :SS4_FORM + | :BANK_STATEMENT + | :UTILITY_BILL_STATEMENT + | :SSN_CARD + | :ITIN_LETTER + | :FINCEN_BOI_REPORT + + module DocumentType + extend Lithic::Enum + + EIN_LETTER: :EIN_LETTER + TAX_RETURN: :TAX_RETURN + OPERATING_AGREEMENT: :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION: :CERTIFICATE_OF_FORMATION + DRIVERS_LICENSE: :DRIVERS_LICENSE + PASSPORT: :PASSPORT + PASSPORT_CARD: :PASSPORT_CARD + CERTIFICATE_OF_GOOD_STANDING: :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION: :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION: :ARTICLES_OF_ORGANIZATION + BYLAWS: :BYLAWS + GOVERNMENT_BUSINESS_LICENSE: :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT: :PARTNERSHIP_AGREEMENT + SS4_FORM: :SS4_FORM + BANK_STATEMENT: :BANK_STATEMENT + UTILITY_BILL_STATEMENT: :UTILITY_BILL_STATEMENT + SSN_CARD: :SSN_CARD + ITIN_LETTER: :ITIN_LETTER + FINCEN_BOI_REPORT: :FINCEN_BOI_REPORT + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUploadDocumentParams::document_type] + end + end + end +end diff --git a/sig/lithic/models/account_list_params.rbs b/sig/lithic/models/account_list_params.rbs new file mode 100644 index 00000000..0c4bf8eb --- /dev/null +++ b/sig/lithic/models/account_list_params.rbs @@ -0,0 +1,49 @@ +module Lithic + module Models + type account_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::request_parameters + + class AccountListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_list_params + end + end +end diff --git a/sig/lithic/models/account_retrieve_params.rbs b/sig/lithic/models/account_retrieve_params.rbs new file mode 100644 index 00000000..22c5e83b --- /dev/null +++ b/sig/lithic/models/account_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type account_retrieve_params = { } & Lithic::request_parameters + + class AccountRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::account_retrieve_params + end + end +end diff --git a/sig/lithic/models/account_retrieve_spend_limits_params.rbs b/sig/lithic/models/account_retrieve_spend_limits_params.rbs new file mode 100644 index 00000000..f2efde68 --- /dev/null +++ b/sig/lithic/models/account_retrieve_spend_limits_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type account_retrieve_spend_limits_params = + { } & Lithic::request_parameters + + class AccountRetrieveSpendLimitsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::account_retrieve_spend_limits_params + end + end +end diff --git a/sig/lithic/models/account_spend_limits.rbs b/sig/lithic/models/account_spend_limits.rbs new file mode 100644 index 00000000..e2b0b8fa --- /dev/null +++ b/sig/lithic/models/account_spend_limits.rbs @@ -0,0 +1,108 @@ +module Lithic + module Models + type account_spend_limits = + { + available_spend_limit: Lithic::Models::AccountSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::Models::AccountSpendLimits::SpendLimit, + spend_velocity: Lithic::Models::AccountSpendLimits::SpendVelocity + } + + class AccountSpendLimits < Lithic::BaseModel + attr_accessor available_spend_limit: Lithic::Models::AccountSpendLimits::AvailableSpendLimit + + attr_reader spend_limit: Lithic::Models::AccountSpendLimits::SpendLimit? + + def spend_limit=: ( + Lithic::Models::AccountSpendLimits::SpendLimit + ) -> Lithic::Models::AccountSpendLimits::SpendLimit + + attr_reader spend_velocity: Lithic::Models::AccountSpendLimits::SpendVelocity? + + def spend_velocity=: ( + Lithic::Models::AccountSpendLimits::SpendVelocity + ) -> Lithic::Models::AccountSpendLimits::SpendVelocity + + def initialize: ( + available_spend_limit: Lithic::Models::AccountSpendLimits::AvailableSpendLimit, + ?spend_limit: Lithic::Models::AccountSpendLimits::SpendLimit, + ?spend_velocity: Lithic::Models::AccountSpendLimits::SpendVelocity + ) -> void + + def to_hash: -> Lithic::Models::account_spend_limits + + type available_spend_limit = + { daily: Integer, lifetime: Integer, monthly: Integer } + + class AvailableSpendLimit < Lithic::BaseModel + attr_reader daily: Integer? + + def daily=: (Integer) -> Integer + + attr_reader lifetime: Integer? + + def lifetime=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?daily: Integer, + ?lifetime: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> Lithic::Models::AccountSpendLimits::available_spend_limit + end + + type spend_limit = { daily: Integer, lifetime: Integer, monthly: Integer } + + class SpendLimit < Lithic::BaseModel + attr_reader daily: Integer? + + def daily=: (Integer) -> Integer + + attr_reader lifetime: Integer? + + def lifetime=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?daily: Integer, + ?lifetime: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> Lithic::Models::AccountSpendLimits::spend_limit + end + + type spend_velocity = + { daily: Integer, lifetime: Integer, monthly: Integer } + + class SpendVelocity < Lithic::BaseModel + attr_reader daily: Integer? + + def daily=: (Integer) -> Integer + + attr_reader lifetime: Integer? + + def lifetime=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?daily: Integer, + ?lifetime: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> Lithic::Models::AccountSpendLimits::spend_velocity + end + end + end +end diff --git a/sig/lithic/models/account_update_params.rbs b/sig/lithic/models/account_update_params.rbs new file mode 100644 index 00000000..7f37882a --- /dev/null +++ b/sig/lithic/models/account_update_params.rbs @@ -0,0 +1,111 @@ +module Lithic + module Models + type account_update_params = + { + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::Models::AccountUpdateParams::state, + verification_address: Lithic::Models::AccountUpdateParams::VerificationAddress + } + & Lithic::request_parameters + + class AccountUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader daily_spend_limit: Integer? + + def daily_spend_limit=: (Integer) -> Integer + + attr_reader lifetime_spend_limit: Integer? + + def lifetime_spend_limit=: (Integer) -> Integer + + attr_reader monthly_spend_limit: Integer? + + def monthly_spend_limit=: (Integer) -> Integer + + attr_reader state: Lithic::Models::AccountUpdateParams::state? + + def state=: ( + Lithic::Models::AccountUpdateParams::state + ) -> Lithic::Models::AccountUpdateParams::state + + attr_reader verification_address: Lithic::Models::AccountUpdateParams::VerificationAddress? + + def verification_address=: ( + Lithic::Models::AccountUpdateParams::VerificationAddress + ) -> Lithic::Models::AccountUpdateParams::VerificationAddress + + def initialize: ( + ?daily_spend_limit: Integer, + ?lifetime_spend_limit: Integer, + ?monthly_spend_limit: Integer, + ?state: Lithic::Models::AccountUpdateParams::state, + ?verification_address: Lithic::Models::AccountUpdateParams::VerificationAddress, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::account_update_params + + type state = :ACTIVE | :PAUSED + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::AccountUpdateParams::state] + end + + type verification_address = + { + :address1 => String, + :address2 => String, + city: String, + country: String, + postal_code: String, + state: String + } + + class VerificationAddress < Lithic::BaseModel + attr_reader address1: String? + + def address1=: (String) -> String + + attr_reader address2: String? + + def address2=: (String) -> String + + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?address1: String, + ?address2: String, + ?city: String, + ?country: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> Lithic::Models::AccountUpdateParams::verification_address + end + end + end +end diff --git a/sig/lithic/models/address.rbs b/sig/lithic/models/address.rbs new file mode 100644 index 00000000..e844fad0 --- /dev/null +++ b/sig/lithic/models/address.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::address + end + end +end diff --git a/sig/lithic/models/address_update.rbs b/sig/lithic/models/address_update.rbs new file mode 100644 index 00000000..17918c9c --- /dev/null +++ b/sig/lithic/models/address_update.rbs @@ -0,0 +1,50 @@ +module Lithic + module Models + type address_update = + { + :address1 => String, + :address2 => String, + city: String, + country: String, + postal_code: String, + state: String + } + + class AddressUpdate < Lithic::BaseModel + attr_reader address1: String? + + def address1=: (String) -> String + + attr_reader address2: String? + + def address2=: (String) -> String + + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?address1: String, + ?address2: String, + ?city: String, + ?country: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> Lithic::Models::address_update + end + end +end diff --git a/sig/lithic/models/aggregate_balance.rbs b/sig/lithic/models/aggregate_balance.rbs new file mode 100644 index 00000000..47c33d8e --- /dev/null +++ b/sig/lithic/models/aggregate_balance.rbs @@ -0,0 +1,66 @@ +module Lithic + module Models + type aggregate_balance = + { + available_amount: Integer, + created: Time, + currency: String, + financial_account_type: Lithic::Models::AggregateBalance::financial_account_type, + last_financial_account_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + + class AggregateBalance < Lithic::BaseModel + attr_accessor available_amount: Integer + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor financial_account_type: Lithic::Models::AggregateBalance::financial_account_type + + attr_accessor last_financial_account_token: String + + attr_accessor last_transaction_event_token: String + + attr_accessor last_transaction_token: String + + attr_accessor pending_amount: Integer + + attr_accessor total_amount: Integer + + attr_accessor updated: Time + + def initialize: ( + available_amount: Integer, + created: Time, + currency: String, + financial_account_type: Lithic::Models::AggregateBalance::financial_account_type, + last_financial_account_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::aggregate_balance + + type financial_account_type = :ISSUING | :OPERATING | :RESERVE + + module FinancialAccountType + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + + def self?.values: -> ::Array[Lithic::Models::AggregateBalance::financial_account_type] + end + end + end +end diff --git a/sig/lithic/models/aggregate_balance_list_params.rbs b/sig/lithic/models/aggregate_balance_list_params.rbs new file mode 100644 index 00000000..7d1bc663 --- /dev/null +++ b/sig/lithic/models/aggregate_balance_list_params.rbs @@ -0,0 +1,39 @@ +module Lithic + module Models + type aggregate_balance_list_params = + { + financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type + } + & Lithic::request_parameters + + class AggregateBalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type? + + def financial_account_type=: ( + Lithic::Models::AggregateBalanceListParams::financial_account_type + ) -> Lithic::Models::AggregateBalanceListParams::financial_account_type + + def initialize: ( + ?financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::aggregate_balance_list_params + + type financial_account_type = :ISSUING | :OPERATING | :RESERVE + + module FinancialAccountType + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + + def self?.values: -> ::Array[Lithic::Models::AggregateBalanceListParams::financial_account_type] + end + end + end +end diff --git a/sig/lithic/models/api_status.rbs b/sig/lithic/models/api_status.rbs new file mode 100644 index 00000000..f2e98bb6 --- /dev/null +++ b/sig/lithic/models/api_status.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type api_status = { message: String } + + class APIStatus < Lithic::BaseModel + attr_reader message: String? + + def message=: (String) -> String + + def initialize: (?message: String) -> void + + def to_hash: -> Lithic::Models::api_status + end + end +end diff --git a/sig/lithic/models/auth_rules/auth_rule.rbs b/sig/lithic/models/auth_rules/auth_rule.rbs new file mode 100644 index 00000000..4c1cacdb --- /dev/null +++ b/sig/lithic/models/auth_rules/auth_rule.rbs @@ -0,0 +1,79 @@ +module Lithic + module Models + class AuthRule = AuthRules::AuthRule + + module AuthRules + type auth_rule = + { + token: String, + state: Lithic::Models::AuthRules::AuthRule::state, + account_tokens: ::Array[String], + allowed_countries: ::Array[String], + allowed_mcc: ::Array[String], + blocked_countries: ::Array[String], + blocked_mcc: ::Array[String], + card_tokens: ::Array[String], + program_level: bool + } + + class AuthRule < Lithic::BaseModel + attr_accessor token: String + + attr_accessor state: Lithic::Models::AuthRules::AuthRule::state + + attr_reader account_tokens: ::Array[String]? + + def account_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader allowed_countries: ::Array[String]? + + def allowed_countries=: (::Array[String]) -> ::Array[String] + + attr_reader allowed_mcc: ::Array[String]? + + def allowed_mcc=: (::Array[String]) -> ::Array[String] + + attr_reader blocked_countries: ::Array[String]? + + def blocked_countries=: (::Array[String]) -> ::Array[String] + + attr_reader blocked_mcc: ::Array[String]? + + def blocked_mcc=: (::Array[String]) -> ::Array[String] + + attr_reader card_tokens: ::Array[String]? + + def card_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader program_level: bool? + + def program_level=: (bool) -> bool + + def initialize: ( + token: String, + state: Lithic::Models::AuthRules::AuthRule::state, + ?account_tokens: ::Array[String], + ?allowed_countries: ::Array[String], + ?allowed_mcc: ::Array[String], + ?blocked_countries: ::Array[String], + ?blocked_mcc: ::Array[String], + ?card_tokens: ::Array[String], + ?program_level: bool + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::auth_rule + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRule::state] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/auth_rule_condition.rbs b/sig/lithic/models/auth_rules/auth_rule_condition.rbs new file mode 100644 index 00000000..e7c616ca --- /dev/null +++ b/sig/lithic/models/auth_rules/auth_rule_condition.rbs @@ -0,0 +1,75 @@ +module Lithic + module Models + class AuthRuleCondition = AuthRules::AuthRuleCondition + + module AuthRules + type auth_rule_condition = + { + attribute: Lithic::Models::AuthRules::conditional_attribute, + operation: Lithic::Models::AuthRules::AuthRuleCondition::operation, + value: Lithic::Models::AuthRules::AuthRuleCondition::value + } + + class AuthRuleCondition < Lithic::BaseModel + attr_reader attribute: Lithic::Models::AuthRules::conditional_attribute? + + def attribute=: ( + Lithic::Models::AuthRules::conditional_attribute + ) -> Lithic::Models::AuthRules::conditional_attribute + + attr_reader operation: Lithic::Models::AuthRules::AuthRuleCondition::operation? + + def operation=: ( + Lithic::Models::AuthRules::AuthRuleCondition::operation + ) -> Lithic::Models::AuthRules::AuthRuleCondition::operation + + attr_reader value: Lithic::Models::AuthRules::AuthRuleCondition::value? + + def value=: ( + Lithic::Models::AuthRules::AuthRuleCondition::value + ) -> Lithic::Models::AuthRules::AuthRuleCondition::value + + def initialize: ( + ?attribute: Lithic::Models::AuthRules::conditional_attribute, + ?operation: Lithic::Models::AuthRules::AuthRuleCondition::operation, + ?value: Lithic::Models::AuthRules::AuthRuleCondition::value + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::auth_rule_condition + + type operation = + :IS_ONE_OF + | :IS_NOT_ONE_OF + | :MATCHES + | :DOES_NOT_MATCH + | :IS_GREATER_THAN + | :IS_LESS_THAN + + module Operation + extend Lithic::Enum + + IS_ONE_OF: :IS_ONE_OF + IS_NOT_ONE_OF: :IS_NOT_ONE_OF + MATCHES: :MATCHES + DOES_NOT_MATCH: :DOES_NOT_MATCH + IS_GREATER_THAN: :IS_GREATER_THAN + IS_LESS_THAN: :IS_LESS_THAN + + def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRuleCondition::operation] + end + + type value = String | Integer | ::Array[String] + + module Value + extend Lithic::Union + + type string_array = ::Array[String] + + StringArray: string_array + + def self?.variants: -> [String, Integer, ::Array[String]] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_attribute.rbs b/sig/lithic/models/auth_rules/conditional_attribute.rbs new file mode 100644 index 00000000..8995fbdc --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_attribute.rbs @@ -0,0 +1,46 @@ +module Lithic + module Models + module AuthRules + type conditional_attribute = + :MCC + | :COUNTRY + | :CURRENCY + | :MERCHANT_ID + | :DESCRIPTOR + | :LIABILITY_SHIFT + | :PAN_ENTRY_MODE + | :TRANSACTION_AMOUNT + | :RISK_SCORE + | :CARD_TRANSACTION_COUNT_15M + | :CARD_TRANSACTION_COUNT_1H + | :CARD_TRANSACTION_COUNT_24H + | :CARD_STATE + | :PIN_ENTERED + | :PIN_STATUS + | :WALLET_TYPE + + module ConditionalAttribute + extend Lithic::Enum + + MCC: :MCC + COUNTRY: :COUNTRY + CURRENCY: :CURRENCY + MERCHANT_ID: :MERCHANT_ID + DESCRIPTOR: :DESCRIPTOR + LIABILITY_SHIFT: :LIABILITY_SHIFT + PAN_ENTRY_MODE: :PAN_ENTRY_MODE + TRANSACTION_AMOUNT: :TRANSACTION_AMOUNT + RISK_SCORE: :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M: :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H: :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H: :CARD_TRANSACTION_COUNT_24H + CARD_STATE: :CARD_STATE + PIN_ENTERED: :PIN_ENTERED + PIN_STATUS: :PIN_STATUS + WALLET_TYPE: :WALLET_TYPE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::conditional_attribute] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_block_parameters.rbs b/sig/lithic/models/auth_rules/conditional_block_parameters.rbs new file mode 100644 index 00000000..c7c84980 --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_block_parameters.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + module AuthRules + type conditional_block_parameters = + { conditions: ::Array[Lithic::Models::AuthRules::AuthRuleCondition] } + + class ConditionalBlockParameters < Lithic::BaseModel + attr_accessor conditions: ::Array[Lithic::Models::AuthRules::AuthRuleCondition] + + def initialize: ( + conditions: ::Array[Lithic::Models::AuthRules::AuthRuleCondition] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::conditional_block_parameters + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_create_params.rbs b/sig/lithic/models/auth_rules/v2/backtest_create_params.rbs new file mode 100644 index 00000000..4b4cca08 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_create_params.rbs @@ -0,0 +1,31 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_create_params = + { end_: Time, start: Time } & Lithic::request_parameters + + class BacktestCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader start: Time? + + def start=: (Time) -> Time + + def initialize: ( + ?end_: Time, + ?start: Time, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::backtest_create_params + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_create_response.rbs b/sig/lithic/models/auth_rules/v2/backtest_create_response.rbs new file mode 100644 index 00000000..37962702 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_create_response.rbs @@ -0,0 +1,19 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_create_response = { backtest_token: String } + + class BacktestCreateResponse < Lithic::BaseModel + attr_reader backtest_token: String? + + def backtest_token=: (String) -> String + + def initialize: (?backtest_token: String) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::backtest_create_response + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_results.rbs b/sig/lithic/models/auth_rules/v2/backtest_results.rbs new file mode 100644 index 00000000..9417e531 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_results.rbs @@ -0,0 +1,198 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_results = + { + backtest_token: String, + results: Lithic::Models::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters + } + + class BacktestResults < Lithic::BaseModel + attr_accessor backtest_token: String + + attr_accessor results: Lithic::Models::AuthRules::V2::BacktestResults::Results + + attr_accessor simulation_parameters: Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters + + def initialize: ( + backtest_token: String, + results: Lithic::Models::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::backtest_results + + type results = + { + current_version: Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion? + } + + class Results < Lithic::BaseModel + attr_accessor current_version: Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion? + + def initialize: ( + ?current_version: Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion?, + ?draft_version: Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion? + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::BacktestResults::results + + type current_version = + { + approved: Integer, + declined: Integer, + examples: ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example], + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_reader approved: Integer? + + def approved=: (Integer) -> Integer + + attr_reader declined: Integer? + + def declined=: (Integer) -> Integer + + attr_reader examples: ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example]? + + def examples=: ( + ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example] + ) -> ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example] + + attr_reader version: Integer? + + def version=: (Integer) -> Integer + + def initialize: ( + ?approved: Integer, + ?declined: Integer, + ?examples: ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::Example], + ?version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::BacktestResults::Results::current_version + + type example = + { approved: bool, event_token: String, timestamp: Time } + + class Example < Lithic::BaseModel + attr_reader approved: bool? + + def approved=: (bool) -> bool + + attr_reader event_token: String? + + def event_token=: (String) -> String + + attr_reader timestamp: Time? + + def timestamp=: (Time) -> Time + + def initialize: ( + ?approved: bool, + ?event_token: String, + ?timestamp: Time + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::BacktestResults::Results::CurrentVersion::example + end + end + + type draft_version = + { + approved: Integer, + declined: Integer, + examples: ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example], + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_reader approved: Integer? + + def approved=: (Integer) -> Integer + + attr_reader declined: Integer? + + def declined=: (Integer) -> Integer + + attr_reader examples: ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example]? + + def examples=: ( + ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example] + ) -> ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example] + + attr_reader version: Integer? + + def version=: (Integer) -> Integer + + def initialize: ( + ?approved: Integer, + ?declined: Integer, + ?examples: ::Array[Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::Example], + ?version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::BacktestResults::Results::draft_version + + type example = + { approved: bool, event_token: String, timestamp: Time } + + class Example < Lithic::BaseModel + attr_reader approved: bool? + + def approved=: (bool) -> bool + + attr_reader event_token: String? + + def event_token=: (String) -> String + + attr_reader timestamp: Time? + + def timestamp=: (Time) -> Time + + def initialize: ( + ?approved: bool, + ?event_token: String, + ?timestamp: Time + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::BacktestResults::Results::DraftVersion::example + end + end + end + + type simulation_parameters = + { auth_rule_token: String, end_: Time, start: Time } + + class SimulationParameters < Lithic::BaseModel + attr_reader auth_rule_token: String? + + def auth_rule_token=: (String) -> String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader start: Time? + + def start=: (Time) -> Time + + def initialize: ( + ?auth_rule_token: String, + ?end_: Time, + ?start: Time + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::BacktestResults::simulation_parameters + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_retrieve_params.rbs b/sig/lithic/models/auth_rules/v2/backtest_retrieve_params.rbs new file mode 100644 index 00000000..b7d6f092 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_retrieve_params = + { auth_rule_token: String } & Lithic::request_parameters + + class BacktestRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor auth_rule_token: String + + def initialize: ( + auth_rule_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2::backtest_retrieve_params + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_apply_params.rbs b/sig/lithic/models/auth_rules/v2_apply_params.rbs new file mode 100644 index 00000000..50cd1799 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_apply_params.rbs @@ -0,0 +1,39 @@ +module Lithic + module Models + module AuthRules + type v2_apply_params = + { + account_tokens: ::Array[String], + card_tokens: ::Array[String], + program_level: bool, + excluded_card_tokens: ::Array[String] + } + & Lithic::request_parameters + + class V2ApplyParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor program_level: bool + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + account_tokens: ::Array[String], + card_tokens: ::Array[String], + program_level: bool, + ?excluded_card_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_apply_params + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_apply_response.rbs b/sig/lithic/models/auth_rules/v2_apply_response.rbs new file mode 100644 index 00000000..31191c07 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_apply_response.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module AuthRules + type v2_apply_response = + { + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2ApplyResponse::state, + type: Lithic::Models::AuthRules::V2ApplyResponse::type_, + excluded_card_tokens: ::Array[String] + } + + class V2ApplyResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion? + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::V2ApplyResponse::state + + attr_accessor type: Lithic::Models::AuthRules::V2ApplyResponse::type_ + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2ApplyResponse::state, + type: Lithic::Models::AuthRules::V2ApplyResponse::type_, + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_apply_response + + type current_version = + { + parameters: Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2ApplyResponse::current_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type draft_version = + { + parameters: Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::parameters, + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2ApplyResponse::draft_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ApplyResponse::state] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ApplyResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_create_params.rbs b/sig/lithic/models/auth_rules/v2_create_params.rbs new file mode 100644 index 00000000..d08b67b5 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_create_params.rbs @@ -0,0 +1,80 @@ +module Lithic + module Models + module AuthRules + type v2_create_params = + { + account_tokens: ::Array[String], + name: String?, + parameters: Lithic::Models::AuthRules::V2CreateParams::parameters, + type: Lithic::Models::AuthRules::V2CreateParams::type_, + card_tokens: ::Array[String], + program_level: bool, + excluded_card_tokens: ::Array[String] + } + & Lithic::request_parameters + + class V2CreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor account_tokens: ::Array[String] + + attr_accessor name: String? + + attr_reader parameters: Lithic::Models::AuthRules::V2CreateParams::parameters? + + def parameters=: ( + Lithic::Models::AuthRules::V2CreateParams::parameters + ) -> Lithic::Models::AuthRules::V2CreateParams::parameters + + attr_reader type: Lithic::Models::AuthRules::V2CreateParams::type_? + + def type=: ( + Lithic::Models::AuthRules::V2CreateParams::type_ + ) -> Lithic::Models::AuthRules::V2CreateParams::type_ + + attr_accessor card_tokens: ::Array[String] + + attr_accessor program_level: bool + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + account_tokens: ::Array[String], + card_tokens: ::Array[String], + program_level: bool, + ?name: String?, + ?parameters: Lithic::Models::AuthRules::V2CreateParams::parameters, + ?type: Lithic::Models::AuthRules::V2CreateParams::type_, + ?excluded_card_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_create_params + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_create_response.rbs b/sig/lithic/models/auth_rules/v2_create_response.rbs new file mode 100644 index 00000000..22ff1858 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_create_response.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module AuthRules + type v2_create_response = + { + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2CreateResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2CreateResponse::state, + type: Lithic::Models::AuthRules::V2CreateResponse::type_, + excluded_card_tokens: ::Array[String] + } + + class V2CreateResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2CreateResponse::DraftVersion? + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::V2CreateResponse::state + + attr_accessor type: Lithic::Models::AuthRules::V2CreateResponse::type_ + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2CreateResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2CreateResponse::state, + type: Lithic::Models::AuthRules::V2CreateResponse::type_, + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_create_response + + type current_version = + { + parameters: Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2CreateResponse::current_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type draft_version = + { + parameters: Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::parameters, + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2CreateResponse::draft_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateResponse::state] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_delete_params.rbs b/sig/lithic/models/auth_rules/v2_delete_params.rbs new file mode 100644 index 00000000..00fb0f26 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_delete_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module AuthRules + type v2_delete_params = { } & Lithic::request_parameters + + class V2DeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_delete_params + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_draft_params.rbs b/sig/lithic/models/auth_rules/v2_draft_params.rbs new file mode 100644 index 00000000..9ccd3194 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_draft_params.rbs @@ -0,0 +1,33 @@ +module Lithic + module Models + module AuthRules + type v2_draft_params = + { parameters: Lithic::Models::AuthRules::V2DraftParams::parameters? } + & Lithic::request_parameters + + class V2DraftParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor parameters: Lithic::Models::AuthRules::V2DraftParams::parameters? + + def initialize: ( + ?parameters: Lithic::Models::AuthRules::V2DraftParams::parameters?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_draft_params + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_draft_response.rbs b/sig/lithic/models/auth_rules/v2_draft_response.rbs new file mode 100644 index 00000000..bdbd77f6 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_draft_response.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module AuthRules + type v2_draft_response = + { + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2DraftResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2DraftResponse::state, + type: Lithic::Models::AuthRules::V2DraftResponse::type_, + excluded_card_tokens: ::Array[String] + } + + class V2DraftResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2DraftResponse::DraftVersion? + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::V2DraftResponse::state + + attr_accessor type: Lithic::Models::AuthRules::V2DraftResponse::type_ + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2DraftResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2DraftResponse::state, + type: Lithic::Models::AuthRules::V2DraftResponse::type_, + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_draft_response + + type current_version = + { + parameters: Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2DraftResponse::current_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type draft_version = + { + parameters: Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::parameters, + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2DraftResponse::draft_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2DraftResponse::state] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2DraftResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_list_params.rbs b/sig/lithic/models/auth_rules/v2_list_params.rbs new file mode 100644 index 00000000..281ef393 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_list_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + module AuthRules + type v2_list_params = + { + account_token: String, + card_token: String, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::request_parameters + + class V2ListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?account_token: String, + ?card_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_list_params + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_list_response.rbs b/sig/lithic/models/auth_rules/v2_list_response.rbs new file mode 100644 index 00000000..61b07b1a --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_list_response.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module AuthRules + type v2_list_response = + { + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2ListResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2ListResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2ListResponse::state, + type: Lithic::Models::AuthRules::V2ListResponse::type_, + excluded_card_tokens: ::Array[String] + } + + class V2ListResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::Models::AuthRules::V2ListResponse::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2ListResponse::DraftVersion? + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::V2ListResponse::state + + attr_accessor type: Lithic::Models::AuthRules::V2ListResponse::type_ + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2ListResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2ListResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2ListResponse::state, + type: Lithic::Models::AuthRules::V2ListResponse::type_, + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_list_response + + type current_version = + { + parameters: Lithic::Models::AuthRules::V2ListResponse::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2ListResponse::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2ListResponse::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2ListResponse::current_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type draft_version = + { + parameters: Lithic::Models::AuthRules::V2ListResponse::DraftVersion::parameters, + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2ListResponse::DraftVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2ListResponse::DraftVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2ListResponse::draft_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResponse::state] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_promote_params.rbs b/sig/lithic/models/auth_rules/v2_promote_params.rbs new file mode 100644 index 00000000..16fa9238 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_promote_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module AuthRules + type v2_promote_params = { } & Lithic::request_parameters + + class V2PromoteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_promote_params + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_promote_response.rbs b/sig/lithic/models/auth_rules/v2_promote_response.rbs new file mode 100644 index 00000000..84f178ad --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_promote_response.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module AuthRules + type v2_promote_response = + { + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2PromoteResponse::state, + type: Lithic::Models::AuthRules::V2PromoteResponse::type_, + excluded_card_tokens: ::Array[String] + } + + class V2PromoteResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion? + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::V2PromoteResponse::state + + attr_accessor type: Lithic::Models::AuthRules::V2PromoteResponse::type_ + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2PromoteResponse::state, + type: Lithic::Models::AuthRules::V2PromoteResponse::type_, + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_promote_response + + type current_version = + { + parameters: Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2PromoteResponse::current_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type draft_version = + { + parameters: Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion::parameters, + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2PromoteResponse::draft_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2PromoteResponse::state] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2PromoteResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_report_params.rbs b/sig/lithic/models/auth_rules/v2_report_params.rbs new file mode 100644 index 00000000..0f4c72a7 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_report_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module AuthRules + type v2_report_params = { } & Lithic::request_parameters + + class V2ReportParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_report_params + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_report_response.rbs b/sig/lithic/models/auth_rules/v2_report_response.rbs new file mode 100644 index 00000000..244dfb9e --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_report_response.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module AuthRules + type v2_report_response = { report_token: String } + + class V2ReportResponse < Lithic::BaseModel + attr_reader report_token: String? + + def report_token=: (String) -> String + + def initialize: (?report_token: String) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_report_response + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_retrieve_params.rbs b/sig/lithic/models/auth_rules/v2_retrieve_params.rbs new file mode 100644 index 00000000..a1aabeb5 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_retrieve_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module AuthRules + type v2_retrieve_params = { } & Lithic::request_parameters + + class V2RetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_retrieve_response.rbs b/sig/lithic/models/auth_rules/v2_retrieve_response.rbs new file mode 100644 index 00000000..2ac8d4d9 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_retrieve_response.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module AuthRules + type v2_retrieve_response = + { + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2RetrieveResponse::state, + type: Lithic::Models::AuthRules::V2RetrieveResponse::type_, + excluded_card_tokens: ::Array[String] + } + + class V2RetrieveResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion? + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::V2RetrieveResponse::state + + attr_accessor type: Lithic::Models::AuthRules::V2RetrieveResponse::type_ + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2RetrieveResponse::state, + type: Lithic::Models::AuthRules::V2RetrieveResponse::type_, + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_retrieve_response + + type current_version = + { + parameters: Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2RetrieveResponse::current_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type draft_version = + { + parameters: Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion::parameters, + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2RetrieveResponse::draft_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2RetrieveResponse::state] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2RetrieveResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_update_params.rbs b/sig/lithic/models/auth_rules/v2_update_params.rbs new file mode 100644 index 00000000..59b0ab38 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_update_params.rbs @@ -0,0 +1,67 @@ +module Lithic + module Models + module AuthRules + type v2_update_params = + { + account_tokens: ::Array[String], + name: String?, + state: Lithic::Models::AuthRules::V2UpdateParams::state, + card_tokens: ::Array[String], + excluded_card_tokens: ::Array[String], + program_level: bool + } + & Lithic::request_parameters + + class V2UpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_tokens: ::Array[String]? + + def account_tokens=: (::Array[String]) -> ::Array[String] + + attr_accessor name: String? + + attr_reader state: Lithic::Models::AuthRules::V2UpdateParams::state? + + def state=: ( + Lithic::Models::AuthRules::V2UpdateParams::state + ) -> Lithic::Models::AuthRules::V2UpdateParams::state + + attr_reader card_tokens: ::Array[String]? + + def card_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader program_level: bool? + + def program_level=: (bool) -> bool + + def initialize: ( + ?account_tokens: ::Array[String], + ?name: String?, + ?state: Lithic::Models::AuthRules::V2UpdateParams::state, + ?card_tokens: ::Array[String], + ?excluded_card_tokens: ::Array[String], + ?program_level: bool, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_update_params + + type state = :INACTIVE + + module State + extend Lithic::Enum + + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2UpdateParams::state] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_update_response.rbs b/sig/lithic/models/auth_rules/v2_update_response.rbs new file mode 100644 index 00000000..5bc4ebd2 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_update_response.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module AuthRules + type v2_update_response = + { + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2UpdateResponse::state, + type: Lithic::Models::AuthRules::V2UpdateResponse::type_, + excluded_card_tokens: ::Array[String] + } + + class V2UpdateResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion? + + attr_accessor draft_version: Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion? + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::V2UpdateResponse::state + + attr_accessor type: Lithic::Models::AuthRules::V2UpdateResponse::type_ + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion?, + draft_version: Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion?, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2UpdateResponse::state, + type: Lithic::Models::AuthRules::V2UpdateResponse::type_, + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::v2_update_response + + type current_version = + { + parameters: Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2UpdateResponse::current_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type draft_version = + { + parameters: Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion::parameters, + version: Integer + } + + class DraftVersion < Lithic::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::V2UpdateResponse::draft_version + + type parameters = + Lithic::Models::AuthRules::ConditionalBlockParameters + | Lithic::Models::AuthRules::VelocityLimitParams + + module Parameters + extend Lithic::Union + + def self?.variants: -> [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2UpdateResponse::state] + end + + type type_ = :CONDITIONAL_BLOCK | :VELOCITY_LIMIT + + module Type + extend Lithic::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2UpdateResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/velocity_limit_params.rbs b/sig/lithic/models/auth_rules/velocity_limit_params.rbs new file mode 100644 index 00000000..06924b84 --- /dev/null +++ b/sig/lithic/models/auth_rules/velocity_limit_params.rbs @@ -0,0 +1,84 @@ +module Lithic + module Models + module AuthRules + type velocity_limit_params = + { + filters: Lithic::Models::AuthRules::VelocityLimitParams::Filters, + period: Lithic::Models::AuthRules::VelocityLimitParams::period, + scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + limit_amount: Integer?, + limit_count: Integer? + } + + class VelocityLimitParams < Lithic::BaseModel + attr_accessor filters: Lithic::Models::AuthRules::VelocityLimitParams::Filters + + attr_accessor period: Lithic::Models::AuthRules::VelocityLimitParams::period + + attr_accessor scope: Lithic::Models::AuthRules::VelocityLimitParams::scope + + attr_accessor limit_amount: Integer? + + attr_accessor limit_count: Integer? + + def initialize: ( + filters: Lithic::Models::AuthRules::VelocityLimitParams::Filters, + period: Lithic::Models::AuthRules::VelocityLimitParams::period, + scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + ?limit_amount: Integer?, + ?limit_count: Integer? + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::velocity_limit_params + + type filters = + { + exclude_countries: ::Array[String]?, + exclude_mccs: ::Array[String]?, + include_countries: ::Array[String]?, + include_mccs: ::Array[String]? + } + + class Filters < Lithic::BaseModel + attr_accessor exclude_countries: ::Array[String]? + + attr_accessor exclude_mccs: ::Array[String]? + + attr_accessor include_countries: ::Array[String]? + + attr_accessor include_mccs: ::Array[String]? + + def initialize: ( + ?exclude_countries: ::Array[String]?, + ?exclude_mccs: ::Array[String]?, + ?include_countries: ::Array[String]?, + ?include_mccs: ::Array[String]? + ) -> void + + def to_hash: -> Lithic::Models::AuthRules::VelocityLimitParams::filters + end + + type period = + Integer + | Lithic::Models::AuthRules::velocity_limit_params_period_window + + module Period + extend Lithic::Union + + def self?.variants: -> [Integer, Lithic::Models::AuthRules::velocity_limit_params_period_window] + end + + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/velocity_limit_params_period_window.rbs b/sig/lithic/models/auth_rules/velocity_limit_params_period_window.rbs new file mode 100644 index 00000000..aeaba028 --- /dev/null +++ b/sig/lithic/models/auth_rules/velocity_limit_params_period_window.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module AuthRules + type velocity_limit_params_period_window = :DAY | :WEEK | :MONTH + + module VelocityLimitParamsPeriodWindow + extend Lithic::Enum + + DAY: :DAY + WEEK: :WEEK + MONTH: :MONTH + + def self?.values: -> ::Array[Lithic::Models::AuthRules::velocity_limit_params_period_window] + end + end + end +end diff --git a/sig/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbs b/sig/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbs new file mode 100644 index 00000000..1dbe0846 --- /dev/null +++ b/sig/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type auth_stream_enrollment_retrieve_secret_params = + { } & Lithic::request_parameters + + class AuthStreamEnrollmentRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::auth_stream_enrollment_retrieve_secret_params + end + end +end diff --git a/sig/lithic/models/auth_stream_enrollment_rotate_secret_params.rbs b/sig/lithic/models/auth_stream_enrollment_rotate_secret_params.rbs new file mode 100644 index 00000000..b2b0f96e --- /dev/null +++ b/sig/lithic/models/auth_stream_enrollment_rotate_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type auth_stream_enrollment_rotate_secret_params = + { } & Lithic::request_parameters + + class AuthStreamEnrollmentRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::auth_stream_enrollment_rotate_secret_params + end + end +end diff --git a/sig/lithic/models/auth_stream_secret.rbs b/sig/lithic/models/auth_stream_secret.rbs new file mode 100644 index 00000000..ddd6a5a2 --- /dev/null +++ b/sig/lithic/models/auth_stream_secret.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type auth_stream_secret = { secret: String } + + class AuthStreamSecret < Lithic::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> Lithic::Models::auth_stream_secret + end + end +end diff --git a/sig/lithic/models/balance.rbs b/sig/lithic/models/balance.rbs new file mode 100644 index 00000000..f0aedd7a --- /dev/null +++ b/sig/lithic/models/balance.rbs @@ -0,0 +1,66 @@ +module Lithic + module Models + type balance = + { + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::financial_account_type, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + + class Balance < Lithic::BaseModel + attr_accessor available_amount: Integer + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor financial_account_token: String + + attr_accessor financial_account_type: Lithic::Models::Balance::financial_account_type + + attr_accessor last_transaction_event_token: String + + attr_accessor last_transaction_token: String + + attr_accessor pending_amount: Integer + + attr_accessor total_amount: Integer + + attr_accessor updated: Time + + def initialize: ( + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::financial_account_type, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::balance + + type financial_account_type = :ISSUING | :OPERATING | :RESERVE + + module FinancialAccountType + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + + def self?.values: -> ::Array[Lithic::Models::Balance::financial_account_type] + end + end + end +end diff --git a/sig/lithic/models/balance_list_params.rbs b/sig/lithic/models/balance_list_params.rbs new file mode 100644 index 00000000..b95658db --- /dev/null +++ b/sig/lithic/models/balance_list_params.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + type balance_list_params = + { + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: Lithic::Models::BalanceListParams::financial_account_type + } + & Lithic::request_parameters + + class BalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader balance_date: Time? + + def balance_date=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader financial_account_type: Lithic::Models::BalanceListParams::financial_account_type? + + def financial_account_type=: ( + Lithic::Models::BalanceListParams::financial_account_type + ) -> Lithic::Models::BalanceListParams::financial_account_type + + def initialize: ( + ?account_token: String, + ?balance_date: Time, + ?business_account_token: String, + ?financial_account_type: Lithic::Models::BalanceListParams::financial_account_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::balance_list_params + + type financial_account_type = :ISSUING | :OPERATING | :RESERVE + + module FinancialAccountType + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + + def self?.values: -> ::Array[Lithic::Models::BalanceListParams::financial_account_type] + end + end + end +end diff --git a/sig/lithic/models/book_transfer_create_params.rbs b/sig/lithic/models/book_transfer_create_params.rbs new file mode 100644 index 00000000..8e90ab05 --- /dev/null +++ b/sig/lithic/models/book_transfer_create_params.rbs @@ -0,0 +1,151 @@ +module Lithic + module Models + type book_transfer_create_params = + { + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::category, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::type_, + token: String, + memo: String + } + & Lithic::request_parameters + + class BookTransferCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::BookTransferCreateParams::category + + attr_accessor from_financial_account_token: String + + attr_accessor subtype: String + + attr_accessor to_financial_account_token: String + + attr_accessor type: Lithic::Models::BookTransferCreateParams::type_ + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::category, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::type_, + ?token: String, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::book_transfer_create_params + + type category = + :ADJUSTMENT + | :BALANCE_OR_FUNDING + | :DERECOGNITION + | :DISPUTE + | :FEE + | :REWARD + | :TRANSFER + + module Category + extend Lithic::Enum + + ADJUSTMENT: :ADJUSTMENT + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + FEE: :FEE + REWARD: :REWARD + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::BookTransferCreateParams::category] + end + + type type_ = + :ATM_WITHDRAWAL + | :ATM_DECLINE + | :INTERNATIONAL_ATM_WITHDRAWAL + | :INACTIVITY + | :STATEMENT + | :MONTHLY + | :QUARTERLY + | :ANNUAL + | :CUSTOMER_SERVICE + | :ACCOUNT_MAINTENANCE + | :ACCOUNT_ACTIVATION + | :ACCOUNT_CLOSURE + | :CARD_REPLACEMENT + | :CARD_DELIVERY + | :CARD_CREATE + | :CURRENCY_CONVERSION + | :INTEREST + | :LATE_PAYMENT + | :BILL_PAYMENT + | :CASH_BACK + | :ACCOUNT_TO_ACCOUNT + | :CARD_TO_CARD + | :DISBURSE + | :BILLING_ERROR + | :LOSS_WRITE_OFF + | :EXPIRED_CARD + | :EARLY_DERECOGNITION + | :ESCHEATMENT + | :INACTIVITY_FEE_DOWN + | :PROVISIONAL_CREDIT + | :DISPUTE_WON + | :TRANSFER + + module Type + extend Lithic::Enum + + ATM_WITHDRAWAL: :ATM_WITHDRAWAL + ATM_DECLINE: :ATM_DECLINE + INTERNATIONAL_ATM_WITHDRAWAL: :INTERNATIONAL_ATM_WITHDRAWAL + INACTIVITY: :INACTIVITY + STATEMENT: :STATEMENT + MONTHLY: :MONTHLY + QUARTERLY: :QUARTERLY + ANNUAL: :ANNUAL + CUSTOMER_SERVICE: :CUSTOMER_SERVICE + ACCOUNT_MAINTENANCE: :ACCOUNT_MAINTENANCE + ACCOUNT_ACTIVATION: :ACCOUNT_ACTIVATION + ACCOUNT_CLOSURE: :ACCOUNT_CLOSURE + CARD_REPLACEMENT: :CARD_REPLACEMENT + CARD_DELIVERY: :CARD_DELIVERY + CARD_CREATE: :CARD_CREATE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + INTEREST: :INTEREST + LATE_PAYMENT: :LATE_PAYMENT + BILL_PAYMENT: :BILL_PAYMENT + CASH_BACK: :CASH_BACK + ACCOUNT_TO_ACCOUNT: :ACCOUNT_TO_ACCOUNT + CARD_TO_CARD: :CARD_TO_CARD + DISBURSE: :DISBURSE + BILLING_ERROR: :BILLING_ERROR + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + EXPIRED_CARD: :EXPIRED_CARD + EARLY_DERECOGNITION: :EARLY_DERECOGNITION + ESCHEATMENT: :ESCHEATMENT + INACTIVITY_FEE_DOWN: :INACTIVITY_FEE_DOWN + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + DISPUTE_WON: :DISPUTE_WON + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::BookTransferCreateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/book_transfer_list_params.rbs b/sig/lithic/models/book_transfer_list_params.rbs new file mode 100644 index 00000000..8f8f3cf9 --- /dev/null +++ b/sig/lithic/models/book_transfer_list_params.rbs @@ -0,0 +1,136 @@ +module Lithic + module Models + type book_transfer_list_params = + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::BookTransferListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::BookTransferListParams::result, + starting_after: String, + status: Lithic::Models::BookTransferListParams::status + } + & Lithic::request_parameters + + class BookTransferListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::BookTransferListParams::category? + + def category=: ( + Lithic::Models::BookTransferListParams::category + ) -> Lithic::Models::BookTransferListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::BookTransferListParams::result? + + def result=: ( + Lithic::Models::BookTransferListParams::result + ) -> Lithic::Models::BookTransferListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::BookTransferListParams::status? + + def status=: ( + Lithic::Models::BookTransferListParams::status + ) -> Lithic::Models::BookTransferListParams::status + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::BookTransferListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::BookTransferListParams::result, + ?starting_after: String, + ?status: Lithic::Models::BookTransferListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::book_transfer_list_params + + type category = + :BALANCE_OR_FUNDING + | :FEE + | :REWARD + | :ADJUSTMENT + | :DERECOGNITION + | :DISPUTE + | :INTERNAL + + module Category + extend Lithic::Enum + + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + FEE: :FEE + REWARD: :REWARD + ADJUSTMENT: :ADJUSTMENT + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + INTERNAL: :INTERNAL + + def self?.values: -> ::Array[Lithic::Models::BookTransferListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::BookTransferListParams::result] + end + + type status = :DECLINED | :SETTLED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + SETTLED: :SETTLED + + def self?.values: -> ::Array[Lithic::Models::BookTransferListParams::status] + end + end + end +end diff --git a/sig/lithic/models/book_transfer_response.rbs b/sig/lithic/models/book_transfer_response.rbs new file mode 100644 index 00000000..31a1c677 --- /dev/null +++ b/sig/lithic/models/book_transfer_response.rbs @@ -0,0 +1,173 @@ +module Lithic + module Models + type book_transfer_response = + { + token: String, + category: Lithic::Models::BookTransferResponse::category, + created: Time, + currency: String, + events: ::Array[Lithic::Models::BookTransferResponse::Event], + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::status, + to_financial_account_token: top, + updated: Time + } + + class BookTransferResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::BookTransferResponse::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor events: ::Array[Lithic::Models::BookTransferResponse::Event] + + attr_accessor from_financial_account_token: String + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::BookTransferResponse::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::BookTransferResponse::status + + attr_accessor to_financial_account_token: top + + attr_accessor updated: Time + + def initialize: ( + token: String, + category: Lithic::Models::BookTransferResponse::category, + created: Time, + currency: String, + events: ::Array[Lithic::Models::BookTransferResponse::Event], + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::status, + to_financial_account_token: top, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::book_transfer_response + + type category = + :ADJUSTMENT + | :BALANCE_OR_FUNDING + | :DERECOGNITION + | :DISPUTE + | :FEE + | :REWARD + | :TRANSFER + + module Category + extend Lithic::Enum + + ADJUSTMENT: :ADJUSTMENT + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + FEE: :FEE + REWARD: :REWARD + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::category] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result], + memo: String, + result: Lithic::Models::BookTransferResponse::Event::result, + subtype: String, + type: String + } + + class Event < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result] + + attr_accessor memo: String + + attr_accessor result: Lithic::Models::BookTransferResponse::Event::result + + attr_accessor subtype: String + + attr_accessor type: String + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result], + memo: String, + result: Lithic::Models::BookTransferResponse::Event::result, + subtype: String, + type: String + ) -> void + + def to_hash: -> Lithic::Models::BookTransferResponse::event + + type detailed_result = :APPROVED | :FUNDS_INSUFFICIENT + + module DetailedResult + extend Lithic::Enum + + APPROVED: :APPROVED + FUNDS_INSUFFICIENT: :FUNDS_INSUFFICIENT + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::Event::result] + end + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::result] + end + + type status = :DECLINED | :REVERSED | :SETTLED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + REVERSED: :REVERSED + SETTLED: :SETTLED + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::status] + end + end + end +end diff --git a/sig/lithic/models/book_transfer_retrieve_params.rbs b/sig/lithic/models/book_transfer_retrieve_params.rbs new file mode 100644 index 00000000..57df8650 --- /dev/null +++ b/sig/lithic/models/book_transfer_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type book_transfer_retrieve_params = { } & Lithic::request_parameters + + class BookTransferRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::book_transfer_retrieve_params + end + end +end diff --git a/sig/lithic/models/book_transfer_reverse_params.rbs b/sig/lithic/models/book_transfer_reverse_params.rbs new file mode 100644 index 00000000..bd2ef131 --- /dev/null +++ b/sig/lithic/models/book_transfer_reverse_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type book_transfer_reverse_params = + { memo: String } & Lithic::request_parameters + + class BookTransferReverseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::book_transfer_reverse_params + end + end +end diff --git a/sig/lithic/models/card.rbs b/sig/lithic/models/card.rbs new file mode 100644 index 00000000..ebc92f88 --- /dev/null +++ b/sig/lithic/models/card.rbs @@ -0,0 +1,242 @@ +module Lithic + module Models + type card = + { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::Card::state, + type: Lithic::Models::Card::type_, + auth_rule_tokens: ::Array[String], + cardholder_currency: String, + cvv: String, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + hostname: String, + memo: String, + pan: String, + pending_commands: ::Array[String], + product_id: String, + replacement_for: String? + } + + class Card < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor card_program_token: String + + attr_accessor created: Time + + attr_accessor funding: Lithic::Models::Card::Funding + + attr_accessor last_four: String + + attr_accessor pin_status: Lithic::Models::Card::pin_status + + attr_accessor spend_limit: Integer + + attr_accessor spend_limit_duration: Lithic::Models::spend_limit_duration + + attr_accessor state: Lithic::Models::Card::state + + attr_accessor type: Lithic::Models::Card::type_ + + attr_reader auth_rule_tokens: ::Array[String]? + + def auth_rule_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader cardholder_currency: String? + + def cardholder_currency=: (String) -> String + + attr_reader cvv: String? + + def cvv=: (String) -> String + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader hostname: String? + + def hostname=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader pan: String? + + def pan=: (String) -> String + + attr_reader pending_commands: ::Array[String]? + + def pending_commands=: (::Array[String]) -> ::Array[String] + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_accessor replacement_for: String? + + def initialize: ( + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::Card::state, + type: Lithic::Models::Card::type_, + ?auth_rule_tokens: ::Array[String], + ?cardholder_currency: String, + ?cvv: String, + ?digital_card_art_token: String, + ?exp_month: String, + ?exp_year: String, + ?hostname: String, + ?memo: String, + ?pan: String, + ?pending_commands: ::Array[String], + ?product_id: String, + ?replacement_for: String? + ) -> void + + def to_hash: -> Lithic::Models::card + + type funding = + { + token: String, + created: Time, + last_four: String, + state: Lithic::Models::Card::Funding::state, + type: Lithic::Models::Card::Funding::type_, + account_name: String, + nickname: String + } + + class Funding < Lithic::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor last_four: String + + attr_accessor state: Lithic::Models::Card::Funding::state + + attr_accessor type: Lithic::Models::Card::Funding::type_ + + attr_reader account_name: String? + + def account_name=: (String) -> String + + attr_reader nickname: String? + + def nickname=: (String) -> String + + def initialize: ( + token: String, + created: Time, + last_four: String, + state: Lithic::Models::Card::Funding::state, + type: Lithic::Models::Card::Funding::type_, + ?account_name: String, + ?nickname: String + ) -> void + + def to_hash: -> Lithic::Models::Card::funding + + type state = :DELETED | :ENABLED | :PENDING + + module State + extend Lithic::Enum + + DELETED: :DELETED + ENABLED: :ENABLED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::Card::Funding::state] + end + + type type_ = :DEPOSITORY_CHECKING | :DEPOSITORY_SAVINGS + + module Type + extend Lithic::Enum + + DEPOSITORY_CHECKING: :DEPOSITORY_CHECKING + DEPOSITORY_SAVINGS: :DEPOSITORY_SAVINGS + + def self?.values: -> ::Array[Lithic::Models::Card::Funding::type_] + end + end + + type pin_status = :OK | :BLOCKED | :NOT_SET + + module PinStatus + extend Lithic::Enum + + OK: :OK + BLOCKED: :BLOCKED + NOT_SET: :NOT_SET + + def self?.values: -> ::Array[Lithic::Models::Card::pin_status] + end + + type state = + :CLOSED | :OPEN | :PAUSED | :PENDING_ACTIVATION | :PENDING_FULFILLMENT + + module State + extend Lithic::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + PENDING_ACTIVATION: :PENDING_ACTIVATION + PENDING_FULFILLMENT: :PENDING_FULFILLMENT + + def self?.values: -> ::Array[Lithic::Models::Card::state] + end + + type type_ = + :MERCHANT_LOCKED + | :PHYSICAL + | :SINGLE_USE + | :VIRTUAL + | :UNLOCKED + | :DIGITAL_WALLET + + module Type + extend Lithic::Enum + + MERCHANT_LOCKED: :MERCHANT_LOCKED + PHYSICAL: :PHYSICAL + SINGLE_USE: :SINGLE_USE + VIRTUAL: :VIRTUAL + UNLOCKED: :UNLOCKED + DIGITAL_WALLET: :DIGITAL_WALLET + + def self?.values: -> ::Array[Lithic::Models::Card::type_] + end + end + end +end diff --git a/sig/lithic/models/card_convert_physical_params.rbs b/sig/lithic/models/card_convert_physical_params.rbs new file mode 100644 index 00000000..10e15a0c --- /dev/null +++ b/sig/lithic/models/card_convert_physical_params.rbs @@ -0,0 +1,64 @@ +module Lithic + module Models + type card_convert_physical_params = + { + shipping_address: Lithic::Models::ShippingAddress, + carrier: Lithic::Models::Carrier, + product_id: String, + shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method + } + & Lithic::request_parameters + + class CardConvertPhysicalParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor shipping_address: Lithic::Models::ShippingAddress + + attr_reader carrier: Lithic::Models::Carrier? + + def carrier=: (Lithic::Models::Carrier) -> Lithic::Models::Carrier + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardConvertPhysicalParams::shipping_method + ) -> Lithic::Models::CardConvertPhysicalParams::shipping_method + + def initialize: ( + shipping_address: Lithic::Models::ShippingAddress, + ?carrier: Lithic::Models::Carrier, + ?product_id: String, + ?shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_convert_physical_params + + type shipping_method = + :"2-DAY" + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY: :"2-DAY" + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardConvertPhysicalParams::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_create_params.rbs b/sig/lithic/models/card_create_params.rbs new file mode 100644 index 00000000..7f2c10a0 --- /dev/null +++ b/sig/lithic/models/card_create_params.rbs @@ -0,0 +1,180 @@ +module Lithic + module Models + type card_create_params = + { + type: Lithic::Models::CardCreateParams::type_, + account_token: String, + card_program_token: String, + carrier: Lithic::Models::Carrier, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_for: String, + shipping_address: Lithic::Models::ShippingAddress, + shipping_method: Lithic::Models::CardCreateParams::shipping_method, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::CardCreateParams::state + } + & Lithic::request_parameters + + class CardCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor type: Lithic::Models::CardCreateParams::type_ + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader card_program_token: String? + + def card_program_token=: (String) -> String + + attr_reader carrier: Lithic::Models::Carrier? + + def carrier=: (Lithic::Models::Carrier) -> Lithic::Models::Carrier + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader pin: String? + + def pin=: (String) -> String + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader replacement_account_token: String? + + def replacement_account_token=: (String) -> String + + attr_reader replacement_for: String? + + def replacement_for=: (String) -> String + + attr_reader shipping_address: Lithic::Models::ShippingAddress? + + def shipping_address=: ( + Lithic::Models::ShippingAddress + ) -> Lithic::Models::ShippingAddress + + attr_reader shipping_method: Lithic::Models::CardCreateParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardCreateParams::shipping_method + ) -> Lithic::Models::CardCreateParams::shipping_method + + attr_reader spend_limit: Integer? + + def spend_limit=: (Integer) -> Integer + + attr_reader spend_limit_duration: Lithic::Models::spend_limit_duration? + + def spend_limit_duration=: ( + Lithic::Models::spend_limit_duration + ) -> Lithic::Models::spend_limit_duration + + attr_reader state: Lithic::Models::CardCreateParams::state? + + def state=: ( + Lithic::Models::CardCreateParams::state + ) -> Lithic::Models::CardCreateParams::state + + def initialize: ( + type: Lithic::Models::CardCreateParams::type_, + ?account_token: String, + ?card_program_token: String, + ?carrier: Lithic::Models::Carrier, + ?digital_card_art_token: String, + ?exp_month: String, + ?exp_year: String, + ?memo: String, + ?pin: String, + ?product_id: String, + ?replacement_account_token: String, + ?replacement_for: String, + ?shipping_address: Lithic::Models::ShippingAddress, + ?shipping_method: Lithic::Models::CardCreateParams::shipping_method, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardCreateParams::state, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_create_params + + type type_ = + :MERCHANT_LOCKED + | :PHYSICAL + | :SINGLE_USE + | :VIRTUAL + | :UNLOCKED + | :DIGITAL_WALLET + + module Type + extend Lithic::Enum + + MERCHANT_LOCKED: :MERCHANT_LOCKED + PHYSICAL: :PHYSICAL + SINGLE_USE: :SINGLE_USE + VIRTUAL: :VIRTUAL + UNLOCKED: :UNLOCKED + DIGITAL_WALLET: :DIGITAL_WALLET + + def self?.values: -> ::Array[Lithic::Models::CardCreateParams::type_] + end + + type shipping_method = + :"2_DAY" + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY: :"2_DAY" + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardCreateParams::shipping_method] + end + + type state = :OPEN | :PAUSED + + module State + extend Lithic::Enum + + OPEN: :OPEN + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::CardCreateParams::state] + end + end + end +end diff --git a/sig/lithic/models/card_embed_params.rbs b/sig/lithic/models/card_embed_params.rbs new file mode 100644 index 00000000..1576cbf7 --- /dev/null +++ b/sig/lithic/models/card_embed_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type card_embed_params = + { embed_request: String, hmac: String } & Lithic::request_parameters + + class CardEmbedParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor embed_request: String + + attr_accessor hmac: String + + def initialize: ( + embed_request: String, + hmac: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_embed_params + end + end +end diff --git a/sig/lithic/models/card_list_params.rbs b/sig/lithic/models/card_list_params.rbs new file mode 100644 index 00000000..b3ce23b7 --- /dev/null +++ b/sig/lithic/models/card_list_params.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type card_list_params = + { + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + state: Lithic::Models::CardListParams::state + } + & Lithic::request_parameters + + class CardListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader state: Lithic::Models::CardListParams::state? + + def state=: ( + Lithic::Models::CardListParams::state + ) -> Lithic::Models::CardListParams::state + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?state: Lithic::Models::CardListParams::state, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_list_params + + type state = + :CLOSED | :OPEN | :PAUSED | :PENDING_ACTIVATION | :PENDING_FULFILLMENT + + module State + extend Lithic::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + PENDING_ACTIVATION: :PENDING_ACTIVATION + PENDING_FULFILLMENT: :PENDING_FULFILLMENT + + def self?.values: -> ::Array[Lithic::Models::CardListParams::state] + end + end + end +end diff --git a/sig/lithic/models/card_program.rbs b/sig/lithic/models/card_program.rbs new file mode 100644 index 00000000..6f4af549 --- /dev/null +++ b/sig/lithic/models/card_program.rbs @@ -0,0 +1,46 @@ +module Lithic + module Models + type card_program = + { + token: String, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String, + settlement_currencies: ::Array[String] + } + + class CardProgram < Lithic::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor name: String + + attr_accessor pan_range_end: String + + attr_accessor pan_range_start: String + + attr_reader cardholder_currency: String? + + def cardholder_currency=: (String) -> String + + attr_reader settlement_currencies: ::Array[String]? + + def settlement_currencies=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + ?cardholder_currency: String, + ?settlement_currencies: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::card_program + end + end +end diff --git a/sig/lithic/models/card_program_list_params.rbs b/sig/lithic/models/card_program_list_params.rbs new file mode 100644 index 00000000..5179d5d4 --- /dev/null +++ b/sig/lithic/models/card_program_list_params.rbs @@ -0,0 +1,33 @@ +module Lithic + module Models + type card_program_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::request_parameters + + class CardProgramListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_program_list_params + end + end +end diff --git a/sig/lithic/models/card_program_retrieve_params.rbs b/sig/lithic/models/card_program_retrieve_params.rbs new file mode 100644 index 00000000..0e19ae2c --- /dev/null +++ b/sig/lithic/models/card_program_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type card_program_retrieve_params = { } & Lithic::request_parameters + + class CardProgramRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::card_program_retrieve_params + end + end +end diff --git a/sig/lithic/models/card_provision_params.rbs b/sig/lithic/models/card_provision_params.rbs new file mode 100644 index 00000000..c8f7ea0e --- /dev/null +++ b/sig/lithic/models/card_provision_params.rbs @@ -0,0 +1,69 @@ +module Lithic + module Models + type card_provision_params = + { + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet, + nonce: String, + nonce_signature: String + } + & Lithic::request_parameters + + class CardProvisionParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader certificate: String? + + def certificate=: (String) -> String + + attr_reader client_device_id: String? + + def client_device_id=: (String) -> String + + attr_reader client_wallet_account_id: String? + + def client_wallet_account_id=: (String) -> String + + attr_reader digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet? + + def digital_wallet=: ( + Lithic::Models::CardProvisionParams::digital_wallet + ) -> Lithic::Models::CardProvisionParams::digital_wallet + + attr_reader nonce: String? + + def nonce=: (String) -> String + + attr_reader nonce_signature: String? + + def nonce_signature=: (String) -> String + + def initialize: ( + ?certificate: String, + ?client_device_id: String, + ?client_wallet_account_id: String, + ?digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet, + ?nonce: String, + ?nonce_signature: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_provision_params + + type digital_wallet = :APPLE_PAY | :GOOGLE_PAY | :SAMSUNG_PAY + + module DigitalWallet + extend Lithic::Enum + + APPLE_PAY: :APPLE_PAY + GOOGLE_PAY: :GOOGLE_PAY + SAMSUNG_PAY: :SAMSUNG_PAY + + def self?.values: -> ::Array[Lithic::Models::CardProvisionParams::digital_wallet] + end + end + end +end diff --git a/sig/lithic/models/card_provision_response.rbs b/sig/lithic/models/card_provision_response.rbs new file mode 100644 index 00000000..0c665608 --- /dev/null +++ b/sig/lithic/models/card_provision_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type card_provision_response = { provisioning_payload: String } + + class CardProvisionResponse < Lithic::BaseModel + attr_reader provisioning_payload: String? + + def provisioning_payload=: (String) -> String + + def initialize: (?provisioning_payload: String) -> void + + def to_hash: -> Lithic::Models::card_provision_response + end + end +end diff --git a/sig/lithic/models/card_reissue_params.rbs b/sig/lithic/models/card_reissue_params.rbs new file mode 100644 index 00000000..0a755956 --- /dev/null +++ b/sig/lithic/models/card_reissue_params.rbs @@ -0,0 +1,68 @@ +module Lithic + module Models + type card_reissue_params = + { + carrier: Lithic::Models::Carrier, + product_id: String, + shipping_address: Lithic::Models::ShippingAddress, + shipping_method: Lithic::Models::CardReissueParams::shipping_method + } + & Lithic::request_parameters + + class CardReissueParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader carrier: Lithic::Models::Carrier? + + def carrier=: (Lithic::Models::Carrier) -> Lithic::Models::Carrier + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader shipping_address: Lithic::Models::ShippingAddress? + + def shipping_address=: ( + Lithic::Models::ShippingAddress + ) -> Lithic::Models::ShippingAddress + + attr_reader shipping_method: Lithic::Models::CardReissueParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardReissueParams::shipping_method + ) -> Lithic::Models::CardReissueParams::shipping_method + + def initialize: ( + ?carrier: Lithic::Models::Carrier, + ?product_id: String, + ?shipping_address: Lithic::Models::ShippingAddress, + ?shipping_method: Lithic::Models::CardReissueParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_reissue_params + + type shipping_method = + :"2-DAY" + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY: :"2-DAY" + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardReissueParams::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_renew_params.rbs b/sig/lithic/models/card_renew_params.rbs new file mode 100644 index 00000000..c2d3538f --- /dev/null +++ b/sig/lithic/models/card_renew_params.rbs @@ -0,0 +1,76 @@ +module Lithic + module Models + type card_renew_params = + { + shipping_address: Lithic::Models::ShippingAddress, + carrier: Lithic::Models::Carrier, + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::Models::CardRenewParams::shipping_method + } + & Lithic::request_parameters + + class CardRenewParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor shipping_address: Lithic::Models::ShippingAddress + + attr_reader carrier: Lithic::Models::Carrier? + + def carrier=: (Lithic::Models::Carrier) -> Lithic::Models::Carrier + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader shipping_method: Lithic::Models::CardRenewParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardRenewParams::shipping_method + ) -> Lithic::Models::CardRenewParams::shipping_method + + def initialize: ( + shipping_address: Lithic::Models::ShippingAddress, + ?carrier: Lithic::Models::Carrier, + ?exp_month: String, + ?exp_year: String, + ?product_id: String, + ?shipping_method: Lithic::Models::CardRenewParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_renew_params + + type shipping_method = + :"2-DAY" + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Enum + + NUMBER_2_DAY: :"2-DAY" + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardRenewParams::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_retrieve_params.rbs b/sig/lithic/models/card_retrieve_params.rbs new file mode 100644 index 00000000..9b8bcf3d --- /dev/null +++ b/sig/lithic/models/card_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type card_retrieve_params = { } & Lithic::request_parameters + + class CardRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::card_retrieve_params + end + end +end diff --git a/sig/lithic/models/card_retrieve_spend_limits_params.rbs b/sig/lithic/models/card_retrieve_spend_limits_params.rbs new file mode 100644 index 00000000..7862aeac --- /dev/null +++ b/sig/lithic/models/card_retrieve_spend_limits_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type card_retrieve_spend_limits_params = { } & Lithic::request_parameters + + class CardRetrieveSpendLimitsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::card_retrieve_spend_limits_params + end + end +end diff --git a/sig/lithic/models/card_search_by_pan_params.rbs b/sig/lithic/models/card_search_by_pan_params.rbs new file mode 100644 index 00000000..98a02cfe --- /dev/null +++ b/sig/lithic/models/card_search_by_pan_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type card_search_by_pan_params = + { pan: String } & Lithic::request_parameters + + class CardSearchByPanParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor pan: String + + def initialize: ( + pan: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_search_by_pan_params + end + end +end diff --git a/sig/lithic/models/card_spend_limits.rbs b/sig/lithic/models/card_spend_limits.rbs new file mode 100644 index 00000000..df45a37b --- /dev/null +++ b/sig/lithic/models/card_spend_limits.rbs @@ -0,0 +1,109 @@ +module Lithic + module Models + type card_spend_limits = + { + available_spend_limit: Lithic::Models::CardSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::Models::CardSpendLimits::SpendLimit, + spend_velocity: Lithic::Models::CardSpendLimits::SpendVelocity + } + + class CardSpendLimits < Lithic::BaseModel + attr_accessor available_spend_limit: Lithic::Models::CardSpendLimits::AvailableSpendLimit + + attr_reader spend_limit: Lithic::Models::CardSpendLimits::SpendLimit? + + def spend_limit=: ( + Lithic::Models::CardSpendLimits::SpendLimit + ) -> Lithic::Models::CardSpendLimits::SpendLimit + + attr_reader spend_velocity: Lithic::Models::CardSpendLimits::SpendVelocity? + + def spend_velocity=: ( + Lithic::Models::CardSpendLimits::SpendVelocity + ) -> Lithic::Models::CardSpendLimits::SpendVelocity + + def initialize: ( + available_spend_limit: Lithic::Models::CardSpendLimits::AvailableSpendLimit, + ?spend_limit: Lithic::Models::CardSpendLimits::SpendLimit, + ?spend_velocity: Lithic::Models::CardSpendLimits::SpendVelocity + ) -> void + + def to_hash: -> Lithic::Models::card_spend_limits + + type available_spend_limit = + { annually: Integer, forever: Integer, monthly: Integer } + + class AvailableSpendLimit < Lithic::BaseModel + attr_reader annually: Integer? + + def annually=: (Integer) -> Integer + + attr_reader forever: Integer? + + def forever=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?annually: Integer, + ?forever: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> Lithic::Models::CardSpendLimits::available_spend_limit + end + + type spend_limit = + { annually: Integer, forever: Integer, monthly: Integer } + + class SpendLimit < Lithic::BaseModel + attr_reader annually: Integer? + + def annually=: (Integer) -> Integer + + attr_reader forever: Integer? + + def forever=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?annually: Integer, + ?forever: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> Lithic::Models::CardSpendLimits::spend_limit + end + + type spend_velocity = + { annually: Integer, forever: Integer, monthly: Integer } + + class SpendVelocity < Lithic::BaseModel + attr_reader annually: Integer? + + def annually=: (Integer) -> Integer + + attr_reader forever: Integer? + + def forever=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?annually: Integer, + ?forever: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> Lithic::Models::CardSpendLimits::spend_velocity + end + end + end +end diff --git a/sig/lithic/models/card_update_params.rbs b/sig/lithic/models/card_update_params.rbs new file mode 100644 index 00000000..eb8d8445 --- /dev/null +++ b/sig/lithic/models/card_update_params.rbs @@ -0,0 +1,89 @@ +module Lithic + module Models + type card_update_params = + { + digital_card_art_token: String, + memo: String, + pin: String, + pin_status: Lithic::Models::CardUpdateParams::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::CardUpdateParams::state + } + & Lithic::request_parameters + + class CardUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader pin: String? + + def pin=: (String) -> String + + attr_reader pin_status: Lithic::Models::CardUpdateParams::pin_status? + + def pin_status=: ( + Lithic::Models::CardUpdateParams::pin_status + ) -> Lithic::Models::CardUpdateParams::pin_status + + attr_reader spend_limit: Integer? + + def spend_limit=: (Integer) -> Integer + + attr_reader spend_limit_duration: Lithic::Models::spend_limit_duration? + + def spend_limit_duration=: ( + Lithic::Models::spend_limit_duration + ) -> Lithic::Models::spend_limit_duration + + attr_reader state: Lithic::Models::CardUpdateParams::state? + + def state=: ( + Lithic::Models::CardUpdateParams::state + ) -> Lithic::Models::CardUpdateParams::state + + def initialize: ( + ?digital_card_art_token: String, + ?memo: String, + ?pin: String, + ?pin_status: Lithic::Models::CardUpdateParams::pin_status, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardUpdateParams::state, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::card_update_params + + type pin_status = :OK + + module PinStatus + extend Lithic::Enum + + OK: :OK + + def self?.values: -> ::Array[Lithic::Models::CardUpdateParams::pin_status] + end + + type state = :CLOSED | :OPEN | :PAUSED + + module State + extend Lithic::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::CardUpdateParams::state] + end + end + end +end diff --git a/sig/lithic/models/cards/aggregate_balance_list_params.rbs b/sig/lithic/models/cards/aggregate_balance_list_params.rbs new file mode 100644 index 00000000..9490bf97 --- /dev/null +++ b/sig/lithic/models/cards/aggregate_balance_list_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module Cards + type aggregate_balance_list_params = + { account_token: String, business_account_token: String } + & Lithic::request_parameters + + class AggregateBalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + def initialize: ( + ?account_token: String, + ?business_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Cards::aggregate_balance_list_params + end + end + end +end diff --git a/sig/lithic/models/cards/aggregate_balance_list_response.rbs b/sig/lithic/models/cards/aggregate_balance_list_response.rbs new file mode 100644 index 00000000..01198844 --- /dev/null +++ b/sig/lithic/models/cards/aggregate_balance_list_response.rbs @@ -0,0 +1,52 @@ +module Lithic + module Models + module Cards + type aggregate_balance_list_response = + { + available_amount: Integer, + created: Time, + currency: String, + last_card_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + + class AggregateBalanceListResponse < Lithic::BaseModel + attr_accessor available_amount: Integer + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_card_token: String + + attr_accessor last_transaction_event_token: String + + attr_accessor last_transaction_token: String + + attr_accessor pending_amount: Integer + + attr_accessor total_amount: Integer + + attr_accessor updated: Time + + def initialize: ( + available_amount: Integer, + created: Time, + currency: String, + last_card_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::Cards::aggregate_balance_list_response + end + end + end +end diff --git a/sig/lithic/models/cards/balance_list_params.rbs b/sig/lithic/models/cards/balance_list_params.rbs new file mode 100644 index 00000000..bca15044 --- /dev/null +++ b/sig/lithic/models/cards/balance_list_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module Cards + type balance_list_params = + { balance_date: Time, last_transaction_event_token: String } + & Lithic::request_parameters + + class BalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader balance_date: Time? + + def balance_date=: (Time) -> Time + + attr_reader last_transaction_event_token: String? + + def last_transaction_event_token=: (String) -> String + + def initialize: ( + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Cards::balance_list_params + end + end + end +end diff --git a/sig/lithic/models/cards/balance_list_response.rbs b/sig/lithic/models/cards/balance_list_response.rbs new file mode 100644 index 00000000..58166532 --- /dev/null +++ b/sig/lithic/models/cards/balance_list_response.rbs @@ -0,0 +1,68 @@ +module Lithic + module Models + module Cards + type balance_list_response = + { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::Cards::BalanceListResponse::type_, + updated: Time + } + + class BalanceListResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor available_amount: Integer + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_transaction_event_token: String + + attr_accessor last_transaction_token: String + + attr_accessor pending_amount: Integer + + attr_accessor total_amount: Integer + + attr_accessor type: Lithic::Models::Cards::BalanceListResponse::type_ + + attr_accessor updated: Time + + def initialize: ( + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::Cards::BalanceListResponse::type_, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::Cards::balance_list_response + + type type_ = :ISSUING | :OPERATING | :RESERVE + + module Type + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + + def self?.values: -> ::Array[Lithic::Models::Cards::BalanceListResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/cards/financial_transaction_list_params.rbs b/sig/lithic/models/cards/financial_transaction_list_params.rbs new file mode 100644 index 00000000..b5e4cc16 --- /dev/null +++ b/sig/lithic/models/cards/financial_transaction_list_params.rbs @@ -0,0 +1,107 @@ +module Lithic + module Models + module Cards + type financial_transaction_list_params = + { + begin_: Time, + category: Lithic::Models::Cards::FinancialTransactionListParams::category, + end_: Time, + ending_before: String, + result: Lithic::Models::Cards::FinancialTransactionListParams::result, + starting_after: String, + status: Lithic::Models::Cards::FinancialTransactionListParams::status + } + & Lithic::request_parameters + + class FinancialTransactionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader category: Lithic::Models::Cards::FinancialTransactionListParams::category? + + def category=: ( + Lithic::Models::Cards::FinancialTransactionListParams::category + ) -> Lithic::Models::Cards::FinancialTransactionListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader result: Lithic::Models::Cards::FinancialTransactionListParams::result? + + def result=: ( + Lithic::Models::Cards::FinancialTransactionListParams::result + ) -> Lithic::Models::Cards::FinancialTransactionListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::Cards::FinancialTransactionListParams::status? + + def status=: ( + Lithic::Models::Cards::FinancialTransactionListParams::status + ) -> Lithic::Models::Cards::FinancialTransactionListParams::status + + def initialize: ( + ?begin_: Time, + ?category: Lithic::Models::Cards::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::Cards::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::Cards::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Cards::financial_transaction_list_params + + type category = :CARD | :TRANSFER + + module Category + extend Lithic::Enum + + CARD: :CARD + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::Cards::FinancialTransactionListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Cards::FinancialTransactionListParams::result] + end + + type status = + :DECLINED | :EXPIRED | :PENDING | :RETURNED | :SETTLED | :VOIDED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::Cards::FinancialTransactionListParams::status] + end + end + end + end +end diff --git a/sig/lithic/models/cards/financial_transaction_retrieve_params.rbs b/sig/lithic/models/cards/financial_transaction_retrieve_params.rbs new file mode 100644 index 00000000..1c89fa89 --- /dev/null +++ b/sig/lithic/models/cards/financial_transaction_retrieve_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + module Cards + type financial_transaction_retrieve_params = + { card_token: String } & Lithic::request_parameters + + class FinancialTransactionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor card_token: String + + def initialize: ( + card_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Cards::financial_transaction_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/carrier.rbs b/sig/lithic/models/carrier.rbs new file mode 100644 index 00000000..90c0efc4 --- /dev/null +++ b/sig/lithic/models/carrier.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type carrier = { qr_code_url: String } + + class Carrier < Lithic::BaseModel + attr_reader qr_code_url: String? + + def qr_code_url=: (String) -> String + + def initialize: (?qr_code_url: String) -> void + + def to_hash: -> Lithic::Models::carrier + end + end +end diff --git a/sig/lithic/models/client_api_status_params.rbs b/sig/lithic/models/client_api_status_params.rbs new file mode 100644 index 00000000..63c1fc52 --- /dev/null +++ b/sig/lithic/models/client_api_status_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type client_api_status_params = { } & Lithic::request_parameters + + class ClientAPIStatusParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::client_api_status_params + end + end +end diff --git a/sig/lithic/models/credit_products/extended_credit.rbs b/sig/lithic/models/credit_products/extended_credit.rbs new file mode 100644 index 00000000..65b46f45 --- /dev/null +++ b/sig/lithic/models/credit_products/extended_credit.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + module CreditProducts + type credit_products_extended_credit = { credit_extended: Integer } + + class CreditProductsExtendedCredit < Lithic::BaseModel + attr_accessor credit_extended: Integer + + def initialize: (credit_extended: Integer) -> void + + def to_hash: -> Lithic::Models::CreditProducts::credit_products_extended_credit + end + end + end +end diff --git a/sig/lithic/models/credit_products/extended_credit_retrieve_params.rbs b/sig/lithic/models/credit_products/extended_credit_retrieve_params.rbs new file mode 100644 index 00000000..54d29e60 --- /dev/null +++ b/sig/lithic/models/credit_products/extended_credit_retrieve_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module CreditProducts + type extended_credit_retrieve_params = { } & Lithic::request_parameters + + class ExtendedCreditRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::CreditProducts::extended_credit_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/credit_products/prime_rate_create_params.rbs b/sig/lithic/models/credit_products/prime_rate_create_params.rbs new file mode 100644 index 00000000..aefe821a --- /dev/null +++ b/sig/lithic/models/credit_products/prime_rate_create_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module CreditProducts + type prime_rate_create_params = + { effective_date: Date, rate: String } & Lithic::request_parameters + + class PrimeRateCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor effective_date: Date + + attr_accessor rate: String + + def initialize: ( + effective_date: Date, + rate: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::CreditProducts::prime_rate_create_params + end + end + end +end diff --git a/sig/lithic/models/credit_products/prime_rate_retrieve_params.rbs b/sig/lithic/models/credit_products/prime_rate_retrieve_params.rbs new file mode 100644 index 00000000..071165c4 --- /dev/null +++ b/sig/lithic/models/credit_products/prime_rate_retrieve_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module CreditProducts + type prime_rate_retrieve_params = + { ending_before: Date, starting_after: Date } + & Lithic::request_parameters + + class PrimeRateRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader ending_before: Date? + + def ending_before=: (Date) -> Date + + attr_reader starting_after: Date? + + def starting_after=: (Date) -> Date + + def initialize: ( + ?ending_before: Date, + ?starting_after: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::CreditProducts::prime_rate_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/credit_products/prime_rate_retrieve_response.rbs b/sig/lithic/models/credit_products/prime_rate_retrieve_response.rbs new file mode 100644 index 00000000..58a59ad9 --- /dev/null +++ b/sig/lithic/models/credit_products/prime_rate_retrieve_response.rbs @@ -0,0 +1,36 @@ +module Lithic + module Models + module CreditProducts + type prime_rate_retrieve_response = + { + data: ::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data], + has_more: bool + } + + class PrimeRateRetrieveResponse < Lithic::BaseModel + attr_accessor data: ::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data], + has_more: bool + ) -> void + + def to_hash: -> Lithic::Models::CreditProducts::prime_rate_retrieve_response + + type data = { effective_date: Date, rate: String } + + class Data < Lithic::BaseModel + attr_accessor effective_date: Date + + attr_accessor rate: String + + def initialize: (effective_date: Date, rate: String) -> void + + def to_hash: -> Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::data + end + end + end + end +end diff --git a/sig/lithic/models/digital_card_art.rbs b/sig/lithic/models/digital_card_art.rbs new file mode 100644 index 00000000..24107608 --- /dev/null +++ b/sig/lithic/models/digital_card_art.rbs @@ -0,0 +1,55 @@ +module Lithic + module Models + type digital_card_art_api = + { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: bool, + network: Lithic::Models::DigitalCardArtAPI::network, + is_card_program_default: bool + } + + class DigitalCardArtAPI < Lithic::BaseModel + attr_accessor token: String + + attr_accessor card_program_token: String + + attr_accessor created: Time + + attr_accessor description: String + + attr_accessor is_enabled: bool + + attr_accessor network: Lithic::Models::DigitalCardArtAPI::network + + attr_reader is_card_program_default: bool? + + def is_card_program_default=: (bool) -> bool + + def initialize: ( + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: bool, + network: Lithic::Models::DigitalCardArtAPI::network, + ?is_card_program_default: bool + ) -> void + + def to_hash: -> Lithic::Models::digital_card_art_api + + type network = :MASTERCARD | :VISA + + module Network + extend Lithic::Enum + + MASTERCARD: :MASTERCARD + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::DigitalCardArtAPI::network] + end + end + end +end diff --git a/sig/lithic/models/digital_card_art_list_params.rbs b/sig/lithic/models/digital_card_art_list_params.rbs new file mode 100644 index 00000000..587d2b1b --- /dev/null +++ b/sig/lithic/models/digital_card_art_list_params.rbs @@ -0,0 +1,33 @@ +module Lithic + module Models + type digital_card_art_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::request_parameters + + class DigitalCardArtListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::digital_card_art_list_params + end + end +end diff --git a/sig/lithic/models/digital_card_art_retrieve_params.rbs b/sig/lithic/models/digital_card_art_retrieve_params.rbs new file mode 100644 index 00000000..70cd3aab --- /dev/null +++ b/sig/lithic/models/digital_card_art_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type digital_card_art_retrieve_params = { } & Lithic::request_parameters + + class DigitalCardArtRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::digital_card_art_retrieve_params + end + end +end diff --git a/sig/lithic/models/dispute.rbs b/sig/lithic/models/dispute.rbs new file mode 100644 index 00000000..2f50d067 --- /dev/null +++ b/sig/lithic/models/dispute.rbs @@ -0,0 +1,195 @@ +module Lithic + module Models + type dispute = + { + token: String, + amount: Integer, + arbitration_date: Time?, + created: Time, + customer_filed_date: Time?, + customer_note: String?, + network_claim_ids: ::Array[String]?, + network_filed_date: Time?, + network_reason_code: String?, + prearbitration_date: Time?, + primary_claim_id: String?, + reason: Lithic::Models::Dispute::reason, + representment_date: Time?, + resolution_amount: Integer?, + resolution_date: Time?, + resolution_note: String?, + resolution_reason: Lithic::Models::Dispute::resolution_reason?, + status: Lithic::Models::Dispute::status, + transaction_token: String + } + + class Dispute < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor arbitration_date: Time? + + attr_accessor created: Time + + attr_accessor customer_filed_date: Time? + + attr_accessor customer_note: String? + + attr_accessor network_claim_ids: ::Array[String]? + + attr_accessor network_filed_date: Time? + + attr_accessor network_reason_code: String? + + attr_accessor prearbitration_date: Time? + + attr_accessor primary_claim_id: String? + + attr_accessor reason: Lithic::Models::Dispute::reason + + attr_accessor representment_date: Time? + + attr_accessor resolution_amount: Integer? + + attr_accessor resolution_date: Time? + + attr_accessor resolution_note: String? + + attr_accessor resolution_reason: Lithic::Models::Dispute::resolution_reason? + + attr_accessor status: Lithic::Models::Dispute::status + + attr_accessor transaction_token: String + + def initialize: ( + token: String, + amount: Integer, + arbitration_date: Time?, + created: Time, + customer_filed_date: Time?, + customer_note: String?, + network_claim_ids: ::Array[String]?, + network_filed_date: Time?, + network_reason_code: String?, + prearbitration_date: Time?, + primary_claim_id: String?, + reason: Lithic::Models::Dispute::reason, + representment_date: Time?, + resolution_amount: Integer?, + resolution_date: Time?, + resolution_note: String?, + resolution_reason: Lithic::Models::Dispute::resolution_reason?, + status: Lithic::Models::Dispute::status, + transaction_token: String + ) -> void + + def to_hash: -> Lithic::Models::dispute + + type reason = + :ATM_CASH_MISDISPENSE + | :CANCELLED + | :DUPLICATED + | :FRAUD_CARD_NOT_PRESENT + | :FRAUD_CARD_PRESENT + | :FRAUD_OTHER + | :GOODS_SERVICES_NOT_AS_DESCRIBED + | :GOODS_SERVICES_NOT_RECEIVED + | :INCORRECT_AMOUNT + | :MISSING_AUTH + | :OTHER + | :PROCESSING_ERROR + | :RECURRING_TRANSACTION_NOT_CANCELLED + | :REFUND_NOT_PROCESSED + + module Reason + extend Lithic::Enum + + ATM_CASH_MISDISPENSE: :ATM_CASH_MISDISPENSE + CANCELLED: :CANCELLED + DUPLICATED: :DUPLICATED + FRAUD_CARD_NOT_PRESENT: :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT: :FRAUD_CARD_PRESENT + FRAUD_OTHER: :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED: :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED: :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT: :INCORRECT_AMOUNT + MISSING_AUTH: :MISSING_AUTH + OTHER: :OTHER + PROCESSING_ERROR: :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED: :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED: :REFUND_NOT_PROCESSED + + def self?.values: -> ::Array[Lithic::Models::Dispute::reason] + end + + type resolution_reason = + :CASE_LOST + | :NETWORK_REJECTED + | :NO_DISPUTE_RIGHTS_3DS + | :NO_DISPUTE_RIGHTS_BELOW_THRESHOLD + | :NO_DISPUTE_RIGHTS_CONTACTLESS + | :NO_DISPUTE_RIGHTS_HYBRID + | :NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS + | :NO_DISPUTE_RIGHTS_OTHER + | :PAST_FILING_DATE + | :PREARBITRATION_REJECTED + | :PROCESSOR_REJECTED_OTHER + | :REFUNDED + | :REFUNDED_AFTER_CHARGEBACK + | :WITHDRAWN + | :WON_ARBITRATION + | :WON_FIRST_CHARGEBACK + | :WON_PREARBITRATION + + module ResolutionReason + extend Lithic::Enum + + CASE_LOST: :CASE_LOST + NETWORK_REJECTED: :NETWORK_REJECTED + NO_DISPUTE_RIGHTS_3DS: :NO_DISPUTE_RIGHTS_3DS + NO_DISPUTE_RIGHTS_BELOW_THRESHOLD: :NO_DISPUTE_RIGHTS_BELOW_THRESHOLD + NO_DISPUTE_RIGHTS_CONTACTLESS: :NO_DISPUTE_RIGHTS_CONTACTLESS + NO_DISPUTE_RIGHTS_HYBRID: :NO_DISPUTE_RIGHTS_HYBRID + NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS: :NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS + NO_DISPUTE_RIGHTS_OTHER: :NO_DISPUTE_RIGHTS_OTHER + PAST_FILING_DATE: :PAST_FILING_DATE + PREARBITRATION_REJECTED: :PREARBITRATION_REJECTED + PROCESSOR_REJECTED_OTHER: :PROCESSOR_REJECTED_OTHER + REFUNDED: :REFUNDED + REFUNDED_AFTER_CHARGEBACK: :REFUNDED_AFTER_CHARGEBACK + WITHDRAWN: :WITHDRAWN + WON_ARBITRATION: :WON_ARBITRATION + WON_FIRST_CHARGEBACK: :WON_FIRST_CHARGEBACK + WON_PREARBITRATION: :WON_PREARBITRATION + + def self?.values: -> ::Array[Lithic::Models::Dispute::resolution_reason] + end + + type status = + :ARBITRATION + | :CASE_CLOSED + | :CASE_WON + | :NEW + | :PENDING_CUSTOMER + | :PREARBITRATION + | :REPRESENTMENT + | :SUBMITTED + + module Status + extend Lithic::Enum + + ARBITRATION: :ARBITRATION + CASE_CLOSED: :CASE_CLOSED + CASE_WON: :CASE_WON + NEW: :NEW + PENDING_CUSTOMER: :PENDING_CUSTOMER + PREARBITRATION: :PREARBITRATION + REPRESENTMENT: :REPRESENTMENT + SUBMITTED: :SUBMITTED + + def self?.values: -> ::Array[Lithic::Models::Dispute::status] + end + end + end +end diff --git a/sig/lithic/models/dispute_create_params.rbs b/sig/lithic/models/dispute_create_params.rbs new file mode 100644 index 00000000..96467600 --- /dev/null +++ b/sig/lithic/models/dispute_create_params.rbs @@ -0,0 +1,80 @@ +module Lithic + module Models + type dispute_create_params = + { + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::reason, + transaction_token: String, + customer_filed_date: Time, + customer_note: String + } + & Lithic::request_parameters + + class DisputeCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor reason: Lithic::Models::DisputeCreateParams::reason + + attr_accessor transaction_token: String + + attr_reader customer_filed_date: Time? + + def customer_filed_date=: (Time) -> Time + + attr_reader customer_note: String? + + def customer_note=: (String) -> String + + def initialize: ( + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::reason, + transaction_token: String, + ?customer_filed_date: Time, + ?customer_note: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::dispute_create_params + + type reason = + :ATM_CASH_MISDISPENSE + | :CANCELLED + | :DUPLICATED + | :FRAUD_CARD_NOT_PRESENT + | :FRAUD_CARD_PRESENT + | :FRAUD_OTHER + | :GOODS_SERVICES_NOT_AS_DESCRIBED + | :GOODS_SERVICES_NOT_RECEIVED + | :INCORRECT_AMOUNT + | :MISSING_AUTH + | :OTHER + | :PROCESSING_ERROR + | :RECURRING_TRANSACTION_NOT_CANCELLED + | :REFUND_NOT_PROCESSED + + module Reason + extend Lithic::Enum + + ATM_CASH_MISDISPENSE: :ATM_CASH_MISDISPENSE + CANCELLED: :CANCELLED + DUPLICATED: :DUPLICATED + FRAUD_CARD_NOT_PRESENT: :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT: :FRAUD_CARD_PRESENT + FRAUD_OTHER: :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED: :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED: :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT: :INCORRECT_AMOUNT + MISSING_AUTH: :MISSING_AUTH + OTHER: :OTHER + PROCESSING_ERROR: :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED: :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED: :REFUND_NOT_PROCESSED + + def self?.values: -> ::Array[Lithic::Models::DisputeCreateParams::reason] + end + end + end +end diff --git a/sig/lithic/models/dispute_delete_evidence_params.rbs b/sig/lithic/models/dispute_delete_evidence_params.rbs new file mode 100644 index 00000000..38dac8db --- /dev/null +++ b/sig/lithic/models/dispute_delete_evidence_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type dispute_delete_evidence_params = + { dispute_token: String } & Lithic::request_parameters + + class DisputeDeleteEvidenceParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor dispute_token: String + + def initialize: ( + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::dispute_delete_evidence_params + end + end +end diff --git a/sig/lithic/models/dispute_delete_params.rbs b/sig/lithic/models/dispute_delete_params.rbs new file mode 100644 index 00000000..06f48429 --- /dev/null +++ b/sig/lithic/models/dispute_delete_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type dispute_delete_params = { } & Lithic::request_parameters + + class DisputeDeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::dispute_delete_params + end + end +end diff --git a/sig/lithic/models/dispute_evidence.rbs b/sig/lithic/models/dispute_evidence.rbs new file mode 100644 index 00000000..e4f2ca48 --- /dev/null +++ b/sig/lithic/models/dispute_evidence.rbs @@ -0,0 +1,62 @@ +module Lithic + module Models + type dispute_evidence = + { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::upload_status, + download_url: String, + filename: String, + upload_url: String + } + + class DisputeEvidence < Lithic::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor dispute_token: String + + attr_accessor upload_status: Lithic::Models::DisputeEvidence::upload_status + + attr_reader download_url: String? + + def download_url=: (String) -> String + + attr_reader filename: String? + + def filename=: (String) -> String + + attr_reader upload_url: String? + + def upload_url=: (String) -> String + + def initialize: ( + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::upload_status, + ?download_url: String, + ?filename: String, + ?upload_url: String + ) -> void + + def to_hash: -> Lithic::Models::dispute_evidence + + type upload_status = :DELETED | :ERROR | :PENDING | :REJECTED | :UPLOADED + + module UploadStatus + extend Lithic::Enum + + DELETED: :DELETED + ERROR: :ERROR + PENDING: :PENDING + REJECTED: :REJECTED + UPLOADED: :UPLOADED + + def self?.values: -> ::Array[Lithic::Models::DisputeEvidence::upload_status] + end + end + end +end diff --git a/sig/lithic/models/dispute_initiate_evidence_upload_params.rbs b/sig/lithic/models/dispute_initiate_evidence_upload_params.rbs new file mode 100644 index 00000000..19c34fd6 --- /dev/null +++ b/sig/lithic/models/dispute_initiate_evidence_upload_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type dispute_initiate_evidence_upload_params = + { filename: String } & Lithic::request_parameters + + class DisputeInitiateEvidenceUploadParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader filename: String? + + def filename=: (String) -> String + + def initialize: ( + ?filename: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::dispute_initiate_evidence_upload_params + end + end +end diff --git a/sig/lithic/models/dispute_list_evidences_params.rbs b/sig/lithic/models/dispute_list_evidences_params.rbs new file mode 100644 index 00000000..eb2c1ec1 --- /dev/null +++ b/sig/lithic/models/dispute_list_evidences_params.rbs @@ -0,0 +1,49 @@ +module Lithic + module Models + type dispute_list_evidences_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::request_parameters + + class DisputeListEvidencesParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::dispute_list_evidences_params + end + end +end diff --git a/sig/lithic/models/dispute_list_params.rbs b/sig/lithic/models/dispute_list_params.rbs new file mode 100644 index 00000000..76b1704a --- /dev/null +++ b/sig/lithic/models/dispute_list_params.rbs @@ -0,0 +1,88 @@ +module Lithic + module Models + type dispute_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::DisputeListParams::status, + transaction_tokens: ::Array[String] + } + & Lithic::request_parameters + + class DisputeListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::DisputeListParams::status? + + def status=: ( + Lithic::Models::DisputeListParams::status + ) -> Lithic::Models::DisputeListParams::status + + attr_reader transaction_tokens: ::Array[String]? + + def transaction_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::DisputeListParams::status, + ?transaction_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::dispute_list_params + + type status = + :ARBITRATION + | :CASE_CLOSED + | :CASE_WON + | :NEW + | :PENDING_CUSTOMER + | :PREARBITRATION + | :REPRESENTMENT + | :SUBMITTED + + module Status + extend Lithic::Enum + + ARBITRATION: :ARBITRATION + CASE_CLOSED: :CASE_CLOSED + CASE_WON: :CASE_WON + NEW: :NEW + PENDING_CUSTOMER: :PENDING_CUSTOMER + PREARBITRATION: :PREARBITRATION + REPRESENTMENT: :REPRESENTMENT + SUBMITTED: :SUBMITTED + + def self?.values: -> ::Array[Lithic::Models::DisputeListParams::status] + end + end + end +end diff --git a/sig/lithic/models/dispute_retrieve_evidence_params.rbs b/sig/lithic/models/dispute_retrieve_evidence_params.rbs new file mode 100644 index 00000000..b60f8619 --- /dev/null +++ b/sig/lithic/models/dispute_retrieve_evidence_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type dispute_retrieve_evidence_params = + { dispute_token: String } & Lithic::request_parameters + + class DisputeRetrieveEvidenceParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor dispute_token: String + + def initialize: ( + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::dispute_retrieve_evidence_params + end + end +end diff --git a/sig/lithic/models/dispute_retrieve_params.rbs b/sig/lithic/models/dispute_retrieve_params.rbs new file mode 100644 index 00000000..472ca8a7 --- /dev/null +++ b/sig/lithic/models/dispute_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type dispute_retrieve_params = { } & Lithic::request_parameters + + class DisputeRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::dispute_retrieve_params + end + end +end diff --git a/sig/lithic/models/dispute_update_params.rbs b/sig/lithic/models/dispute_update_params.rbs new file mode 100644 index 00000000..8c948a17 --- /dev/null +++ b/sig/lithic/models/dispute_update_params.rbs @@ -0,0 +1,82 @@ +module Lithic + module Models + type dispute_update_params = + { + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::Models::DisputeUpdateParams::reason + } + & Lithic::request_parameters + + class DisputeUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader customer_filed_date: Time? + + def customer_filed_date=: (Time) -> Time + + attr_reader customer_note: String? + + def customer_note=: (String) -> String + + attr_reader reason: Lithic::Models::DisputeUpdateParams::reason? + + def reason=: ( + Lithic::Models::DisputeUpdateParams::reason + ) -> Lithic::Models::DisputeUpdateParams::reason + + def initialize: ( + ?amount: Integer, + ?customer_filed_date: Time, + ?customer_note: String, + ?reason: Lithic::Models::DisputeUpdateParams::reason, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::dispute_update_params + + type reason = + :ATM_CASH_MISDISPENSE + | :CANCELLED + | :DUPLICATED + | :FRAUD_CARD_NOT_PRESENT + | :FRAUD_CARD_PRESENT + | :FRAUD_OTHER + | :GOODS_SERVICES_NOT_AS_DESCRIBED + | :GOODS_SERVICES_NOT_RECEIVED + | :INCORRECT_AMOUNT + | :MISSING_AUTH + | :OTHER + | :PROCESSING_ERROR + | :RECURRING_TRANSACTION_NOT_CANCELLED + | :REFUND_NOT_PROCESSED + + module Reason + extend Lithic::Enum + + ATM_CASH_MISDISPENSE: :ATM_CASH_MISDISPENSE + CANCELLED: :CANCELLED + DUPLICATED: :DUPLICATED + FRAUD_CARD_NOT_PRESENT: :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT: :FRAUD_CARD_PRESENT + FRAUD_OTHER: :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED: :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED: :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT: :INCORRECT_AMOUNT + MISSING_AUTH: :MISSING_AUTH + OTHER: :OTHER + PROCESSING_ERROR: :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED: :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED: :REFUND_NOT_PROCESSED + + def self?.values: -> ::Array[Lithic::Models::DisputeUpdateParams::reason] + end + end + end +end diff --git a/sig/lithic/models/document.rbs b/sig/lithic/models/document.rbs new file mode 100644 index 00000000..75e49f32 --- /dev/null +++ b/sig/lithic/models/document.rbs @@ -0,0 +1,189 @@ +module Lithic + module Models + type document = + { + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::Models::Document::RequiredDocumentUpload] + } + + class Document < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_holder_token: String + + attr_accessor document_type: Lithic::Models::Document::document_type + + attr_accessor entity_token: String + + attr_accessor required_document_uploads: ::Array[Lithic::Models::Document::RequiredDocumentUpload] + + def initialize: ( + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::Models::Document::RequiredDocumentUpload] + ) -> void + + def to_hash: -> Lithic::Models::document + + type document_type = + :DRIVERS_LICENSE + | :PASSPORT + | :PASSPORT_CARD + | :EIN_LETTER + | :TAX_RETURN + | :OPERATING_AGREEMENT + | :CERTIFICATE_OF_FORMATION + | :CERTIFICATE_OF_GOOD_STANDING + | :ARTICLES_OF_INCORPORATION + | :ARTICLES_OF_ORGANIZATION + | :BYLAWS + | :GOVERNMENT_BUSINESS_LICENSE + | :PARTNERSHIP_AGREEMENT + | :SS4_FORM + | :BANK_STATEMENT + | :UTILITY_BILL_STATEMENT + | :SSN_CARD + | :ITIN_LETTER + | :FINCEN_BOI_REPORT + + module DocumentType + extend Lithic::Enum + + DRIVERS_LICENSE: :DRIVERS_LICENSE + PASSPORT: :PASSPORT + PASSPORT_CARD: :PASSPORT_CARD + EIN_LETTER: :EIN_LETTER + TAX_RETURN: :TAX_RETURN + OPERATING_AGREEMENT: :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION: :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING: :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION: :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION: :ARTICLES_OF_ORGANIZATION + BYLAWS: :BYLAWS + GOVERNMENT_BUSINESS_LICENSE: :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT: :PARTNERSHIP_AGREEMENT + SS4_FORM: :SS4_FORM + BANK_STATEMENT: :BANK_STATEMENT + UTILITY_BILL_STATEMENT: :UTILITY_BILL_STATEMENT + SSN_CARD: :SSN_CARD + ITIN_LETTER: :ITIN_LETTER + FINCEN_BOI_REPORT: :FINCEN_BOI_REPORT + + def self?.values: -> ::Array[Lithic::Models::Document::document_type] + end + + type required_document_upload = + { + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::Document::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::Document::RequiredDocumentUpload::status, + status_reasons: ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason], + updated: Time, + upload_url: String + } + + class RequiredDocumentUpload < Lithic::BaseModel + attr_accessor token: String + + attr_accessor accepted_entity_status_reasons: ::Array[String] + + attr_accessor created: Time + + attr_accessor image_type: Lithic::Models::Document::RequiredDocumentUpload::image_type + + attr_accessor rejected_entity_status_reasons: ::Array[String] + + attr_accessor status: Lithic::Models::Document::RequiredDocumentUpload::status + + attr_accessor status_reasons: ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason] + + attr_accessor updated: Time + + attr_accessor upload_url: String + + def initialize: ( + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::Document::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::Document::RequiredDocumentUpload::status, + status_reasons: ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason], + updated: Time, + upload_url: String + ) -> void + + def to_hash: -> Lithic::Models::Document::required_document_upload + + type image_type = :FRONT | :BACK + + module ImageType + extend Lithic::Enum + + FRONT: :FRONT + BACK: :BACK + + def self?.values: -> ::Array[Lithic::Models::Document::RequiredDocumentUpload::image_type] + end + + type status = + :ACCEPTED + | :REJECTED + | :PENDING_UPLOAD + | :UPLOADED + | :PARTIAL_APPROVAL + + module Status + extend Lithic::Enum + + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + PENDING_UPLOAD: :PENDING_UPLOAD + UPLOADED: :UPLOADED + PARTIAL_APPROVAL: :PARTIAL_APPROVAL + + def self?.values: -> ::Array[Lithic::Models::Document::RequiredDocumentUpload::status] + end + + type status_reason = + :DOCUMENT_MISSING_REQUIRED_DATA + | :DOCUMENT_UPLOAD_TOO_BLURRY + | :FILE_SIZE_TOO_LARGE + | :INVALID_DOCUMENT_TYPE + | :INVALID_DOCUMENT_UPLOAD + | :INVALID_ENTITY + | :DOCUMENT_EXPIRED + | :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + | :DOCUMENT_TYPE_NOT_SUPPORTED + | :UNKNOWN_FAILURE_REASON + | :UNKNOWN_ERROR + + module StatusReason + extend Lithic::Enum + + DOCUMENT_MISSING_REQUIRED_DATA: :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY: :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE: :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE: :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD: :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY: :INVALID_ENTITY + DOCUMENT_EXPIRED: :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS: :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED: :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON: :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR: :UNKNOWN_ERROR + + def self?.values: -> ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason] + end + end + end + end +end diff --git a/sig/lithic/models/event.rbs b/sig/lithic/models/event.rbs new file mode 100644 index 00000000..f9a772a2 --- /dev/null +++ b/sig/lithic/models/event.rbs @@ -0,0 +1,123 @@ +module Lithic + module Models + type event = + { + token: String, + created: Time, + event_type: Lithic::Models::Event::event_type, + payload: ::Hash[Symbol, top] + } + + class Event < Lithic::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor event_type: Lithic::Models::Event::event_type + + attr_accessor payload: ::Hash[Symbol, top] + + def initialize: ( + token: String, + created: Time, + event_type: Lithic::Models::Event::event_type, + payload: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> Lithic::Models::event + + type event_type = + :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.performance_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"card.created" + | :"card.renewed" + | :"card.reissued" + | :"card.converted" + | :"card.shipped" + | :"card_transaction.updated" + | :"digital_wallet.tokenization_approval_request" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute.updated" + | :"dispute_evidence.upload_failed" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED: :"auth_rules.performance_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + CARD_CREATED: :"card.created" + CARD_RENEWED: :"card.renewed" + CARD_REISSUED: :"card.reissued" + CARD_CONVERTED: :"card.converted" + CARD_SHIPPED: :"card.shipped" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED: :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Event::event_type] + end + end + end +end diff --git a/sig/lithic/models/event_list_attempts_params.rbs b/sig/lithic/models/event_list_attempts_params.rbs new file mode 100644 index 00000000..d4d0d6df --- /dev/null +++ b/sig/lithic/models/event_list_attempts_params.rbs @@ -0,0 +1,70 @@ +module Lithic + module Models + type event_list_attempts_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::EventListAttemptsParams::status + } + & Lithic::request_parameters + + class EventListAttemptsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::EventListAttemptsParams::status? + + def status=: ( + Lithic::Models::EventListAttemptsParams::status + ) -> Lithic::Models::EventListAttemptsParams::status + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::EventListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::event_list_attempts_params + + type status = :FAILED | :PENDING | :SENDING | :SUCCESS + + module Status + extend Lithic::Enum + + FAILED: :FAILED + PENDING: :PENDING + SENDING: :SENDING + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::EventListAttemptsParams::status] + end + end + end +end diff --git a/sig/lithic/models/event_list_params.rbs b/sig/lithic/models/event_list_params.rbs new file mode 100644 index 00000000..85017ab6 --- /dev/null +++ b/sig/lithic/models/event_list_params.rbs @@ -0,0 +1,156 @@ +module Lithic + module Models + type event_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + event_types: ::Array[Lithic::Models::EventListParams::event_type], + page_size: Integer, + starting_after: String, + with_content: bool + } + & Lithic::request_parameters + + class EventListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader event_types: ::Array[Lithic::Models::EventListParams::event_type]? + + def event_types=: ( + ::Array[Lithic::Models::EventListParams::event_type] + ) -> ::Array[Lithic::Models::EventListParams::event_type] + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader with_content: bool? + + def with_content=: (bool) -> bool + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?event_types: ::Array[Lithic::Models::EventListParams::event_type], + ?page_size: Integer, + ?starting_after: String, + ?with_content: bool, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::event_list_params + + type event_type = + :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.performance_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"card.created" + | :"card.renewed" + | :"card.reissued" + | :"card.converted" + | :"card.shipped" + | :"card_transaction.updated" + | :"digital_wallet.tokenization_approval_request" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute.updated" + | :"dispute_evidence.upload_failed" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED: :"auth_rules.performance_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + CARD_CREATED: :"card.created" + CARD_RENEWED: :"card.renewed" + CARD_REISSUED: :"card.reissued" + CARD_CONVERTED: :"card.converted" + CARD_SHIPPED: :"card.shipped" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED: :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::EventListParams::event_type] + end + end + end +end diff --git a/sig/lithic/models/event_retrieve_params.rbs b/sig/lithic/models/event_retrieve_params.rbs new file mode 100644 index 00000000..3e1fbafa --- /dev/null +++ b/sig/lithic/models/event_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type event_retrieve_params = { } & Lithic::request_parameters + + class EventRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::event_retrieve_params + end + end +end diff --git a/sig/lithic/models/event_subscription.rbs b/sig/lithic/models/event_subscription.rbs new file mode 100644 index 00000000..6080b281 --- /dev/null +++ b/sig/lithic/models/event_subscription.rbs @@ -0,0 +1,127 @@ +module Lithic + module Models + type event_subscription = + { + token: String, + description: String, + disabled: bool, + url: String, + event_types: ::Array[Lithic::Models::EventSubscription::event_type]? + } + + class EventSubscription < Lithic::BaseModel + attr_accessor token: String + + attr_accessor description: String + + attr_accessor disabled: bool + + attr_accessor url: String + + attr_accessor event_types: ::Array[Lithic::Models::EventSubscription::event_type]? + + def initialize: ( + token: String, + description: String, + disabled: bool, + url: String, + ?event_types: ::Array[Lithic::Models::EventSubscription::event_type]? + ) -> void + + def to_hash: -> Lithic::Models::event_subscription + + type event_type = + :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.performance_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"card.created" + | :"card.renewed" + | :"card.reissued" + | :"card.converted" + | :"card.shipped" + | :"card_transaction.updated" + | :"digital_wallet.tokenization_approval_request" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute.updated" + | :"dispute_evidence.upload_failed" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED: :"auth_rules.performance_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + CARD_CREATED: :"card.created" + CARD_RENEWED: :"card.renewed" + CARD_REISSUED: :"card.reissued" + CARD_CONVERTED: :"card.converted" + CARD_SHIPPED: :"card.shipped" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED: :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::EventSubscription::event_type] + end + end + end +end diff --git a/sig/lithic/models/events/subscription_create_params.rbs b/sig/lithic/models/events/subscription_create_params.rbs new file mode 100644 index 00000000..9abf4835 --- /dev/null +++ b/sig/lithic/models/events/subscription_create_params.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module Events + type subscription_create_params = + { + url: String, + description: String, + disabled: bool, + event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + } + & Lithic::request_parameters + + class SubscriptionCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor url: String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader disabled: bool? + + def disabled=: (bool) -> bool + + attr_reader event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type]? + + def event_types=: ( + ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + ) -> ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + + def initialize: ( + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Events::subscription_create_params + + type event_type = + :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.performance_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"card.created" + | :"card.renewed" + | :"card.reissued" + | :"card.converted" + | :"card.shipped" + | :"card_transaction.updated" + | :"digital_wallet.tokenization_approval_request" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute.updated" + | :"dispute_evidence.upload_failed" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED: :"auth_rules.performance_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + CARD_CREATED: :"card.created" + CARD_RENEWED: :"card.renewed" + CARD_REISSUED: :"card.reissued" + CARD_CONVERTED: :"card.converted" + CARD_SHIPPED: :"card.shipped" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED: :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + end + end + end + end +end diff --git a/sig/lithic/models/events/subscription_delete_params.rbs b/sig/lithic/models/events/subscription_delete_params.rbs new file mode 100644 index 00000000..d2eaed0c --- /dev/null +++ b/sig/lithic/models/events/subscription_delete_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module Events + type subscription_delete_params = { } & Lithic::request_parameters + + class SubscriptionDeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Events::subscription_delete_params + end + end + end +end diff --git a/sig/lithic/models/events/subscription_list_attempts_params.rbs b/sig/lithic/models/events/subscription_list_attempts_params.rbs new file mode 100644 index 00000000..79205f16 --- /dev/null +++ b/sig/lithic/models/events/subscription_list_attempts_params.rbs @@ -0,0 +1,72 @@ +module Lithic + module Models + module Events + type subscription_list_attempts_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::Events::SubscriptionListAttemptsParams::status + } + & Lithic::request_parameters + + class SubscriptionListAttemptsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::Events::SubscriptionListAttemptsParams::status? + + def status=: ( + Lithic::Models::Events::SubscriptionListAttemptsParams::status + ) -> Lithic::Models::Events::SubscriptionListAttemptsParams::status + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::Events::SubscriptionListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Events::subscription_list_attempts_params + + type status = :FAILED | :PENDING | :SENDING | :SUCCESS + + module Status + extend Lithic::Enum + + FAILED: :FAILED + PENDING: :PENDING + SENDING: :SENDING + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionListAttemptsParams::status] + end + end + end + end +end diff --git a/sig/lithic/models/events/subscription_list_params.rbs b/sig/lithic/models/events/subscription_list_params.rbs new file mode 100644 index 00000000..677941f0 --- /dev/null +++ b/sig/lithic/models/events/subscription_list_params.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + module Events + type subscription_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::request_parameters + + class SubscriptionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Events::subscription_list_params + end + end + end +end diff --git a/sig/lithic/models/events/subscription_recover_params.rbs b/sig/lithic/models/events/subscription_recover_params.rbs new file mode 100644 index 00000000..1f35785c --- /dev/null +++ b/sig/lithic/models/events/subscription_recover_params.rbs @@ -0,0 +1,29 @@ +module Lithic + module Models + module Events + type subscription_recover_params = + { begin_: Time, end_: Time } & Lithic::request_parameters + + class SubscriptionRecoverParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Events::subscription_recover_params + end + end + end +end diff --git a/sig/lithic/models/events/subscription_replay_missing_params.rbs b/sig/lithic/models/events/subscription_replay_missing_params.rbs new file mode 100644 index 00000000..b5092018 --- /dev/null +++ b/sig/lithic/models/events/subscription_replay_missing_params.rbs @@ -0,0 +1,29 @@ +module Lithic + module Models + module Events + type subscription_replay_missing_params = + { begin_: Time, end_: Time } & Lithic::request_parameters + + class SubscriptionReplayMissingParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Events::subscription_replay_missing_params + end + end + end +end diff --git a/sig/lithic/models/events/subscription_retrieve_params.rbs b/sig/lithic/models/events/subscription_retrieve_params.rbs new file mode 100644 index 00000000..f43cf99a --- /dev/null +++ b/sig/lithic/models/events/subscription_retrieve_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module Events + type subscription_retrieve_params = { } & Lithic::request_parameters + + class SubscriptionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Events::subscription_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/events/subscription_retrieve_secret_params.rbs b/sig/lithic/models/events/subscription_retrieve_secret_params.rbs new file mode 100644 index 00000000..360c7063 --- /dev/null +++ b/sig/lithic/models/events/subscription_retrieve_secret_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module Events + type subscription_retrieve_secret_params = + { } & Lithic::request_parameters + + class SubscriptionRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Events::subscription_retrieve_secret_params + end + end + end +end diff --git a/sig/lithic/models/events/subscription_retrieve_secret_response.rbs b/sig/lithic/models/events/subscription_retrieve_secret_response.rbs new file mode 100644 index 00000000..42c08804 --- /dev/null +++ b/sig/lithic/models/events/subscription_retrieve_secret_response.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module Events + type subscription_retrieve_secret_response = { secret: String } + + class SubscriptionRetrieveSecretResponse < Lithic::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> Lithic::Models::Events::subscription_retrieve_secret_response + end + end + end +end diff --git a/sig/lithic/models/events/subscription_rotate_secret_params.rbs b/sig/lithic/models/events/subscription_rotate_secret_params.rbs new file mode 100644 index 00000000..cf4eb6e4 --- /dev/null +++ b/sig/lithic/models/events/subscription_rotate_secret_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module Events + type subscription_rotate_secret_params = { } & Lithic::request_parameters + + class SubscriptionRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Events::subscription_rotate_secret_params + end + end + end +end diff --git a/sig/lithic/models/events/subscription_send_simulated_example_params.rbs b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs new file mode 100644 index 00000000..c3ef9edd --- /dev/null +++ b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs @@ -0,0 +1,122 @@ +module Lithic + module Models + module Events + type subscription_send_simulated_example_params = + { + event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type + } + & Lithic::request_parameters + + class SubscriptionSendSimulatedExampleParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type? + + def event_type=: ( + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type + ) -> Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type + + def initialize: ( + ?event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Events::subscription_send_simulated_example_params + + type event_type = + :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.performance_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"card.created" + | :"card.renewed" + | :"card.reissued" + | :"card.converted" + | :"card.shipped" + | :"card_transaction.updated" + | :"digital_wallet.tokenization_approval_request" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute.updated" + | :"dispute_evidence.upload_failed" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED: :"auth_rules.performance_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + CARD_CREATED: :"card.created" + CARD_RENEWED: :"card.renewed" + CARD_REISSUED: :"card.reissued" + CARD_CONVERTED: :"card.converted" + CARD_SHIPPED: :"card.shipped" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED: :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type] + end + end + end + end +end diff --git a/sig/lithic/models/events/subscription_update_params.rbs b/sig/lithic/models/events/subscription_update_params.rbs new file mode 100644 index 00000000..cd24031e --- /dev/null +++ b/sig/lithic/models/events/subscription_update_params.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + module Events + type subscription_update_params = + { + url: String, + description: String, + disabled: bool, + event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + } + & Lithic::request_parameters + + class SubscriptionUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor url: String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader disabled: bool? + + def disabled=: (bool) -> bool + + attr_reader event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type]? + + def event_types=: ( + ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + ) -> ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + + def initialize: ( + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Events::subscription_update_params + + type event_type = + :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.performance_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"card.created" + | :"card.renewed" + | :"card.reissued" + | :"card.converted" + | :"card.shipped" + | :"card_transaction.updated" + | :"digital_wallet.tokenization_approval_request" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute.updated" + | :"dispute_evidence.upload_failed" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Enum + + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_PERFORMANCE_REPORT_CREATED: :"auth_rules.performance_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + CARD_CREATED: :"card.created" + CARD_RENEWED: :"card.renewed" + CARD_REISSUED: :"card.reissued" + CARD_CONVERTED: :"card.converted" + CARD_SHIPPED: :"card.shipped" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_UPDATED: :"dispute.updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + end + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_address.rbs b/sig/lithic/models/external_bank_account_address.rbs new file mode 100644 index 00000000..f9e6d929 --- /dev/null +++ b/sig/lithic/models/external_bank_account_address.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + type external_bank_account_address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class ExternalBankAccountAddress < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_address + end + end +end diff --git a/sig/lithic/models/external_bank_account_create_params.rbs b/sig/lithic/models/external_bank_account_create_params.rbs new file mode 100644 index 00000000..7ba48893 --- /dev/null +++ b/sig/lithic/models/external_bank_account_create_params.rbs @@ -0,0 +1,130 @@ +module Lithic + module Models + type external_bank_account_create_params = + { + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::type_, + verification_method: Lithic::Models::ExternalBankAccountCreateParams::verification_method, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: bool, + processor_token: String + } + & Lithic::request_parameters + + class ExternalBankAccountCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor account_number: String + + attr_accessor country: String + + attr_accessor currency: String + + attr_accessor financial_account_token: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::owner_type + + attr_accessor routing_number: String + + attr_accessor type: Lithic::Models::ExternalBankAccountCreateParams::type_ + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountCreateParams::verification_method + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_enforcement: bool? + + def verification_enforcement=: (bool) -> bool + + attr_accessor processor_token: String + + def initialize: ( + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::type_, + verification_method: Lithic::Models::ExternalBankAccountCreateParams::verification_method, + processor_token: String, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?user_defined_id: String, + ?verification_enforcement: bool, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_create_params + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateParams::type_] + end + + type verification_method = :EXTERNALLY_VERIFIED + + module VerificationMethod + extend Lithic::Enum + + EXTERNALLY_VERIFIED: :EXTERNALLY_VERIFIED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateParams::verification_method] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_create_response.rbs b/sig/lithic/models/external_bank_account_create_response.rbs new file mode 100644 index 00000000..ee139f3e --- /dev/null +++ b/sig/lithic/models/external_bank_account_create_response.rbs @@ -0,0 +1,183 @@ +module Lithic + module Models + type external_bank_account_create_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::state, + type: Lithic::Models::ExternalBankAccountCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::verification_state, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + + class ExternalBankAccountCreateResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountCreateResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountCreateResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountCreateResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountCreateResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountCreateResponse::verification_state + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_failed_reason: String? + + def verification_failed_reason=: (String) -> String + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::state, + type: Lithic::Models::ExternalBankAccountCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::verification_state, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?financial_account_token: String, + ?name: String, + ?user_defined_id: String, + ?verification_failed_reason: String + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_create_response + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_list_params.rbs b/sig/lithic/models/external_bank_account_list_params.rbs new file mode 100644 index 00000000..e780f131 --- /dev/null +++ b/sig/lithic/models/external_bank_account_list_params.rbs @@ -0,0 +1,118 @@ +module Lithic + module Models + type external_bank_account_list_params = + { + account_token: String, + account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type], + countries: ::Array[String], + ending_before: String, + owner_types: ::Array[Lithic::Models::owner_type], + page_size: Integer, + starting_after: String, + states: ::Array[Lithic::Models::ExternalBankAccountListParams::state], + verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + } + & Lithic::request_parameters + + class ExternalBankAccountListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type]? + + def account_types=: ( + ::Array[Lithic::Models::ExternalBankAccountListParams::account_type] + ) -> ::Array[Lithic::Models::ExternalBankAccountListParams::account_type] + + attr_reader countries: ::Array[String]? + + def countries=: (::Array[String]) -> ::Array[String] + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader owner_types: ::Array[Lithic::Models::owner_type]? + + def owner_types=: ( + ::Array[Lithic::Models::owner_type] + ) -> ::Array[Lithic::Models::owner_type] + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader states: ::Array[Lithic::Models::ExternalBankAccountListParams::state]? + + def states=: ( + ::Array[Lithic::Models::ExternalBankAccountListParams::state] + ) -> ::Array[Lithic::Models::ExternalBankAccountListParams::state] + + attr_reader verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state]? + + def verification_states=: ( + ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + ) -> ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + + def initialize: ( + ?account_token: String, + ?account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type], + ?countries: ::Array[String], + ?ending_before: String, + ?owner_types: ::Array[Lithic::Models::owner_type], + ?page_size: Integer, + ?starting_after: String, + ?states: ::Array[Lithic::Models::ExternalBankAccountListParams::state], + ?verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_list_params + + type account_type = :CHECKING | :SAVINGS + + module AccountType + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListParams::account_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListParams::state] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_list_response.rbs b/sig/lithic/models/external_bank_account_list_response.rbs new file mode 100644 index 00000000..207f4e05 --- /dev/null +++ b/sig/lithic/models/external_bank_account_list_response.rbs @@ -0,0 +1,183 @@ +module Lithic + module Models + type external_bank_account_list_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::state, + type: Lithic::Models::ExternalBankAccountListResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountListResponse::verification_state, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + + class ExternalBankAccountListResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountListResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountListResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountListResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountListResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountListResponse::verification_state + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_failed_reason: String? + + def verification_failed_reason=: (String) -> String + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::state, + type: Lithic::Models::ExternalBankAccountListResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountListResponse::verification_state, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?financial_account_token: String, + ?name: String, + ?user_defined_id: String, + ?verification_failed_reason: String + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_list_response + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_retrieve_params.rbs b/sig/lithic/models/external_bank_account_retrieve_params.rbs new file mode 100644 index 00000000..edaf197d --- /dev/null +++ b/sig/lithic/models/external_bank_account_retrieve_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type external_bank_account_retrieve_params = + { } & Lithic::request_parameters + + class ExternalBankAccountRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::external_bank_account_retrieve_params + end + end +end diff --git a/sig/lithic/models/external_bank_account_retrieve_response.rbs b/sig/lithic/models/external_bank_account_retrieve_response.rbs new file mode 100644 index 00000000..bef8266e --- /dev/null +++ b/sig/lithic/models/external_bank_account_retrieve_response.rbs @@ -0,0 +1,183 @@ +module Lithic + module Models + type external_bank_account_retrieve_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::state, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + + class ExternalBankAccountRetrieveResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountRetrieveResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountRetrieveResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_failed_reason: String? + + def verification_failed_reason=: (String) -> String + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::state, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?financial_account_token: String, + ?name: String, + ?user_defined_id: String, + ?verification_failed_reason: String + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_retrieve_response + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_retry_micro_deposits_params.rbs b/sig/lithic/models/external_bank_account_retry_micro_deposits_params.rbs new file mode 100644 index 00000000..6cd207be --- /dev/null +++ b/sig/lithic/models/external_bank_account_retry_micro_deposits_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type external_bank_account_retry_micro_deposits_params = + { financial_account_token: String } & Lithic::request_parameters + + class ExternalBankAccountRetryMicroDepositsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + def initialize: ( + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_retry_micro_deposits_params + end + end +end diff --git a/sig/lithic/models/external_bank_account_retry_micro_deposits_response.rbs b/sig/lithic/models/external_bank_account_retry_micro_deposits_response.rbs new file mode 100644 index 00000000..3baef51e --- /dev/null +++ b/sig/lithic/models/external_bank_account_retry_micro_deposits_response.rbs @@ -0,0 +1,183 @@ +module Lithic + module Models + type external_bank_account_retry_micro_deposits_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + + class ExternalBankAccountRetryMicroDepositsResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_failed_reason: String? + + def verification_failed_reason=: (String) -> String + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?financial_account_token: String, + ?name: String, + ?user_defined_id: String, + ?verification_failed_reason: String + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_retry_micro_deposits_response + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_retry_prenote_params.rbs b/sig/lithic/models/external_bank_account_retry_prenote_params.rbs new file mode 100644 index 00000000..327f2025 --- /dev/null +++ b/sig/lithic/models/external_bank_account_retry_prenote_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type external_bank_account_retry_prenote_params = + { financial_account_token: String } & Lithic::request_parameters + + class ExternalBankAccountRetryPrenoteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + def initialize: ( + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_retry_prenote_params + end + end +end diff --git a/sig/lithic/models/external_bank_account_retry_prenote_response.rbs b/sig/lithic/models/external_bank_account_retry_prenote_response.rbs new file mode 100644 index 00000000..d96f3698 --- /dev/null +++ b/sig/lithic/models/external_bank_account_retry_prenote_response.rbs @@ -0,0 +1,159 @@ +module Lithic + module Models + type external_bank_account_retry_prenote_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::state, + type: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::verification_state, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + + class ExternalBankAccountRetryPrenoteResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::verification_state + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_failed_reason: String? + + def verification_failed_reason=: (String) -> String + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::state, + type: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::verification_state, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?financial_account_token: String, + ?name: String, + ?user_defined_id: String, + ?verification_failed_reason: String + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_retry_prenote_response + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryPrenoteResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryPrenoteResponse::type_] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryPrenoteResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_update_params.rbs b/sig/lithic/models/external_bank_account_update_params.rbs new file mode 100644 index 00000000..3ca2fff8 --- /dev/null +++ b/sig/lithic/models/external_bank_account_update_params.rbs @@ -0,0 +1,90 @@ +module Lithic + module Models + type external_bank_account_update_params = + { + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::Models::owner_type, + type: Lithic::Models::ExternalBankAccountUpdateParams::type_, + user_defined_id: String + } + & Lithic::request_parameters + + class ExternalBankAccountUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader owner: String? + + def owner=: (String) -> String + + attr_reader owner_type: Lithic::Models::owner_type? + + def owner_type=: ( + Lithic::Models::owner_type + ) -> Lithic::Models::owner_type + + attr_reader type: Lithic::Models::ExternalBankAccountUpdateParams::type_? + + def type=: ( + Lithic::Models::ExternalBankAccountUpdateParams::type_ + ) -> Lithic::Models::ExternalBankAccountUpdateParams::type_ + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?owner: String, + ?owner_type: Lithic::Models::owner_type, + ?type: Lithic::Models::ExternalBankAccountUpdateParams::type_, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_update_params + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_update_response.rbs b/sig/lithic/models/external_bank_account_update_response.rbs new file mode 100644 index 00000000..968d17b3 --- /dev/null +++ b/sig/lithic/models/external_bank_account_update_response.rbs @@ -0,0 +1,183 @@ +module Lithic + module Models + type external_bank_account_update_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::state, + type: Lithic::Models::ExternalBankAccountUpdateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::verification_state, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + + class ExternalBankAccountUpdateResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountUpdateResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountUpdateResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::verification_state + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_failed_reason: String? + + def verification_failed_reason=: (String) -> String + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::state, + type: Lithic::Models::ExternalBankAccountUpdateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::verification_state, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?financial_account_token: String, + ?name: String, + ?user_defined_id: String, + ?verification_failed_reason: String + ) -> void + + def to_hash: -> Lithic::Models::external_bank_account_update_response + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_accounts/micro_deposit_create_params.rbs b/sig/lithic/models/external_bank_accounts/micro_deposit_create_params.rbs new file mode 100644 index 00000000..e4dd8030 --- /dev/null +++ b/sig/lithic/models/external_bank_accounts/micro_deposit_create_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + module ExternalBankAccounts + type micro_deposit_create_params = + { micro_deposits: ::Array[Integer] } & Lithic::request_parameters + + class MicroDepositCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor micro_deposits: ::Array[Integer] + + def initialize: ( + micro_deposits: ::Array[Integer], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::ExternalBankAccounts::micro_deposit_create_params + end + end + end +end diff --git a/sig/lithic/models/external_bank_accounts/micro_deposit_create_response.rbs b/sig/lithic/models/external_bank_accounts/micro_deposit_create_response.rbs new file mode 100644 index 00000000..ecaced90 --- /dev/null +++ b/sig/lithic/models/external_bank_accounts/micro_deposit_create_response.rbs @@ -0,0 +1,185 @@ +module Lithic + module Models + module ExternalBankAccounts + type micro_deposit_create_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state, + account_token: String, + address: Lithic::Models::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + financial_account_token: String, + name: String, + user_defined_id: String, + verification_failed_reason: String + } + + class MicroDepositCreateResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::Models::ExternalBankAccountAddress? + + def address=: ( + Lithic::Models::ExternalBankAccountAddress + ) -> Lithic::Models::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_failed_reason: String? + + def verification_failed_reason=: (String) -> String + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?financial_account_token: String, + ?name: String, + ?user_defined_id: String, + ?verification_failed_reason: String + ) -> void + + def to_hash: -> Lithic::Models::ExternalBankAccounts::micro_deposit_create_response + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state] + end + end + end + end +end diff --git a/sig/lithic/models/external_payment.rbs b/sig/lithic/models/external_payment.rbs new file mode 100644 index 00000000..e620bce2 --- /dev/null +++ b/sig/lithic/models/external_payment.rbs @@ -0,0 +1,231 @@ +module Lithic + module Models + type external_payment = + { + token: String, + category: Lithic::Models::ExternalPayment::category, + created: Time, + currency: String, + events: ::Array[Lithic::Models::ExternalPayment::Event], + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::payment_type, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::status, + updated: Time, + user_defined_id: String + } + + class ExternalPayment < Lithic::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::ExternalPayment::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor events: ::Array[Lithic::Models::ExternalPayment::Event] + + attr_accessor financial_account_token: String + + attr_accessor payment_type: Lithic::Models::ExternalPayment::payment_type + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::ExternalPayment::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::ExternalPayment::status + + attr_accessor updated: Time + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + token: String, + category: Lithic::Models::ExternalPayment::category, + created: Time, + currency: String, + events: ::Array[Lithic::Models::ExternalPayment::Event], + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::payment_type, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::status, + updated: Time, + ?user_defined_id: String + ) -> void + + def to_hash: -> Lithic::Models::external_payment + + type category = + :EXTERNAL_WIRE | :EXTERNAL_ACH | :EXTERNAL_CHECK | :EXTERNAL_TRANSFER + + module Category + extend Lithic::Enum + + EXTERNAL_WIRE: :EXTERNAL_WIRE + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::category] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ExternalPayment::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ExternalPayment::Event::result, + type: Lithic::Models::ExternalPayment::Event::type_ + } + + class Event < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::ExternalPayment::Event::detailed_result] + + attr_accessor effective_date: Date + + attr_accessor memo: String + + attr_accessor result: Lithic::Models::ExternalPayment::Event::result + + attr_accessor type: Lithic::Models::ExternalPayment::Event::type_ + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ExternalPayment::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ExternalPayment::Event::result, + type: Lithic::Models::ExternalPayment::Event::type_ + ) -> void + + def to_hash: -> Lithic::Models::ExternalPayment::event + + type detailed_result = :APPROVED + + module DetailedResult + extend Lithic::Enum + + APPROVED: :APPROVED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::Event::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::Event::result] + end + + type type_ = + :EXTERNAL_WIRE_INITIATED + | :EXTERNAL_WIRE_CANCELED + | :EXTERNAL_WIRE_SETTLED + | :EXTERNAL_WIRE_REVERSED + | :EXTERNAL_WIRE_RELEASED + | :EXTERNAL_ACH_INITIATED + | :EXTERNAL_ACH_CANCELED + | :EXTERNAL_ACH_SETTLED + | :EXTERNAL_ACH_REVERSED + | :EXTERNAL_ACH_RELEASED + | :EXTERNAL_TRANSFER_INITIATED + | :EXTERNAL_TRANSFER_CANCELED + | :EXTERNAL_TRANSFER_SETTLED + | :EXTERNAL_TRANSFER_REVERSED + | :EXTERNAL_TRANSFER_RELEASED + | :EXTERNAL_CHECK_INITIATED + | :EXTERNAL_CHECK_CANCELED + | :EXTERNAL_CHECK_SETTLED + | :EXTERNAL_CHECK_REVERSED + | :EXTERNAL_CHECK_RELEASED + + module Type + extend Lithic::Enum + + EXTERNAL_WIRE_INITIATED: :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_CANCELED: :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_SETTLED: :EXTERNAL_WIRE_SETTLED + EXTERNAL_WIRE_REVERSED: :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_RELEASED: :EXTERNAL_WIRE_RELEASED + EXTERNAL_ACH_INITIATED: :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_CANCELED: :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_SETTLED: :EXTERNAL_ACH_SETTLED + EXTERNAL_ACH_REVERSED: :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_RELEASED: :EXTERNAL_ACH_RELEASED + EXTERNAL_TRANSFER_INITIATED: :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_CANCELED: :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_SETTLED: :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_TRANSFER_REVERSED: :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_RELEASED: :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_CHECK_INITIATED: :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_CANCELED: :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_SETTLED: :EXTERNAL_CHECK_SETTLED + EXTERNAL_CHECK_REVERSED: :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_RELEASED: :EXTERNAL_CHECK_RELEASED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::Event::type_] + end + end + + type payment_type = :DEPOSIT | :WITHDRAWAL + + module PaymentType + extend Lithic::Enum + + DEPOSIT: :DEPOSIT + WITHDRAWAL: :WITHDRAWAL + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::payment_type] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::result] + end + + type status = :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED + + module Status + extend Lithic::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::status] + end + end + end +end diff --git a/sig/lithic/models/external_payment_cancel_params.rbs b/sig/lithic/models/external_payment_cancel_params.rbs new file mode 100644 index 00000000..f88954dc --- /dev/null +++ b/sig/lithic/models/external_payment_cancel_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + type external_payment_cancel_params = + { effective_date: Date, memo: String } & Lithic::request_parameters + + class ExternalPaymentCancelParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_payment_cancel_params + end + end +end diff --git a/sig/lithic/models/external_payment_create_params.rbs b/sig/lithic/models/external_payment_create_params.rbs new file mode 100644 index 00000000..18b88d6b --- /dev/null +++ b/sig/lithic/models/external_payment_create_params.rbs @@ -0,0 +1,101 @@ +module Lithic + module Models + type external_payment_create_params = + { + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::category, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type, + token: String, + memo: String, + progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to, + user_defined_id: String + } + & Lithic::request_parameters + + class ExternalPaymentCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::ExternalPaymentCreateParams::category + + attr_accessor effective_date: Date + + attr_accessor financial_account_token: String + + attr_accessor payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to? + + def progress_to=: ( + Lithic::Models::ExternalPaymentCreateParams::progress_to + ) -> Lithic::Models::ExternalPaymentCreateParams::progress_to + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::category, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type, + ?token: String, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_payment_create_params + + type category = + :EXTERNAL_WIRE | :EXTERNAL_ACH | :EXTERNAL_CHECK | :EXTERNAL_TRANSFER + + module Category + extend Lithic::Enum + + EXTERNAL_WIRE: :EXTERNAL_WIRE + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentCreateParams::category] + end + + type payment_type = :DEPOSIT | :WITHDRAWAL + + module PaymentType + extend Lithic::Enum + + DEPOSIT: :DEPOSIT + WITHDRAWAL: :WITHDRAWAL + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentCreateParams::payment_type] + end + + type progress_to = :SETTLED | :RELEASED + + module ProgressTo + extend Lithic::Enum + + SETTLED: :SETTLED + RELEASED: :RELEASED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentCreateParams::progress_to] + end + end + end +end diff --git a/sig/lithic/models/external_payment_list_params.rbs b/sig/lithic/models/external_payment_list_params.rbs new file mode 100644 index 00000000..8556b836 --- /dev/null +++ b/sig/lithic/models/external_payment_list_params.rbs @@ -0,0 +1,124 @@ +module Lithic + module Models + type external_payment_list_params = + { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ExternalPaymentListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::ExternalPaymentListParams::result, + starting_after: String, + status: Lithic::Models::ExternalPaymentListParams::status + } + & Lithic::request_parameters + + class ExternalPaymentListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::ExternalPaymentListParams::category? + + def category=: ( + Lithic::Models::ExternalPaymentListParams::category + ) -> Lithic::Models::ExternalPaymentListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::ExternalPaymentListParams::result? + + def result=: ( + Lithic::Models::ExternalPaymentListParams::result + ) -> Lithic::Models::ExternalPaymentListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::ExternalPaymentListParams::status? + + def status=: ( + Lithic::Models::ExternalPaymentListParams::status + ) -> Lithic::Models::ExternalPaymentListParams::status + + def initialize: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ExternalPaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::ExternalPaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::ExternalPaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_payment_list_params + + type category = + :EXTERNAL_WIRE | :EXTERNAL_ACH | :EXTERNAL_CHECK | :EXTERNAL_TRANSFER + + module Category + extend Lithic::Enum + + EXTERNAL_WIRE: :EXTERNAL_WIRE + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentListParams::result] + end + + type status = :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED + + module Status + extend Lithic::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentListParams::status] + end + end + end +end diff --git a/sig/lithic/models/external_payment_release_params.rbs b/sig/lithic/models/external_payment_release_params.rbs new file mode 100644 index 00000000..f1685f33 --- /dev/null +++ b/sig/lithic/models/external_payment_release_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + type external_payment_release_params = + { effective_date: Date, memo: String } & Lithic::request_parameters + + class ExternalPaymentReleaseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_payment_release_params + end + end +end diff --git a/sig/lithic/models/external_payment_retrieve_params.rbs b/sig/lithic/models/external_payment_retrieve_params.rbs new file mode 100644 index 00000000..569aa53c --- /dev/null +++ b/sig/lithic/models/external_payment_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type external_payment_retrieve_params = { } & Lithic::request_parameters + + class ExternalPaymentRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::external_payment_retrieve_params + end + end +end diff --git a/sig/lithic/models/external_payment_reverse_params.rbs b/sig/lithic/models/external_payment_reverse_params.rbs new file mode 100644 index 00000000..146290a4 --- /dev/null +++ b/sig/lithic/models/external_payment_reverse_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + type external_payment_reverse_params = + { effective_date: Date, memo: String } & Lithic::request_parameters + + class ExternalPaymentReverseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_payment_reverse_params + end + end +end diff --git a/sig/lithic/models/external_payment_settle_params.rbs b/sig/lithic/models/external_payment_settle_params.rbs new file mode 100644 index 00000000..bc2e8acc --- /dev/null +++ b/sig/lithic/models/external_payment_settle_params.rbs @@ -0,0 +1,48 @@ +module Lithic + module Models + type external_payment_settle_params = + { + effective_date: Date, + memo: String, + progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to + } + & Lithic::request_parameters + + class ExternalPaymentSettleParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to? + + def progress_to=: ( + Lithic::Models::ExternalPaymentSettleParams::progress_to + ) -> Lithic::Models::ExternalPaymentSettleParams::progress_to + + def initialize: ( + effective_date: Date, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::external_payment_settle_params + + type progress_to = :SETTLED | :RELEASED + + module ProgressTo + extend Lithic::Enum + + SETTLED: :SETTLED + RELEASED: :RELEASED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentSettleParams::progress_to] + end + end + end +end diff --git a/sig/lithic/models/financial_account.rbs b/sig/lithic/models/financial_account.rbs new file mode 100644 index 00000000..fac23770 --- /dev/null +++ b/sig/lithic/models/financial_account.rbs @@ -0,0 +1,179 @@ +module Lithic + module Models + type financial_account = + { + token: String, + account_token: String?, + created: Time, + credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration?, + is_for_benefit_of: bool, + nickname: String?, + status: Lithic::Models::FinancialAccount::status, + type: Lithic::Models::FinancialAccount::type_, + updated: Time, + account_number: String?, + routing_number: String?, + status_change_reason: Lithic::Models::FinancialAccount::status_change_reason? + } + + class FinancialAccount < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_token: String? + + attr_accessor created: Time + + attr_accessor credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration? + + attr_accessor is_for_benefit_of: bool + + attr_accessor nickname: String? + + attr_accessor status: Lithic::Models::FinancialAccount::status + + attr_accessor type: Lithic::Models::FinancialAccount::type_ + + attr_accessor updated: Time + + attr_accessor account_number: String? + + attr_accessor routing_number: String? + + attr_accessor status_change_reason: Lithic::Models::FinancialAccount::status_change_reason? + + def initialize: ( + token: String, + account_token: String?, + created: Time, + credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration?, + is_for_benefit_of: bool, + nickname: String?, + status: Lithic::Models::FinancialAccount::status, + type: Lithic::Models::FinancialAccount::type_, + updated: Time, + ?account_number: String?, + ?routing_number: String?, + ?status_change_reason: Lithic::Models::FinancialAccount::status_change_reason? + ) -> void + + def to_hash: -> Lithic::Models::financial_account + + type credit_configuration = + { + charged_off_reason: Lithic::Models::FinancialAccount::CreditConfiguration::charged_off_reason?, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + financial_account_state: Lithic::Models::FinancialAccount::CreditConfiguration::financial_account_state?, + is_spend_blocked: bool, + tier: String? + } + + class CreditConfiguration < Lithic::BaseModel + attr_accessor charged_off_reason: Lithic::Models::FinancialAccount::CreditConfiguration::charged_off_reason? + + attr_accessor credit_limit: Integer? + + attr_accessor credit_product_token: String? + + attr_accessor external_bank_account_token: String? + + attr_accessor financial_account_state: Lithic::Models::FinancialAccount::CreditConfiguration::financial_account_state? + + attr_accessor is_spend_blocked: bool + + attr_accessor tier: String? + + def initialize: ( + charged_off_reason: Lithic::Models::FinancialAccount::CreditConfiguration::charged_off_reason?, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + financial_account_state: Lithic::Models::FinancialAccount::CreditConfiguration::financial_account_state?, + is_spend_blocked: bool, + tier: String? + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccount::credit_configuration + + type charged_off_reason = :DELINQUENT | :FRAUD + + module ChargedOffReason + extend Lithic::Enum + + DELINQUENT: :DELINQUENT + FRAUD: :FRAUD + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::CreditConfiguration::charged_off_reason] + end + + type financial_account_state = + :PENDING | :CURRENT | :DELINQUENT | :CHARGED_OFF + + module FinancialAccountState + extend Lithic::Enum + + PENDING: :PENDING + CURRENT: :CURRENT + DELINQUENT: :DELINQUENT + CHARGED_OFF: :CHARGED_OFF + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::CreditConfiguration::financial_account_state] + end + end + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::status] + end + + type type_ = + :ISSUING + | :RESERVE + | :OPERATING + | :CHARGED_OFF_FEES + | :CHARGED_OFF_INTEREST + | :CHARGED_OFF_PRINCIPAL + + module Type + extend Lithic::Enum + + ISSUING: :ISSUING + RESERVE: :RESERVE + OPERATING: :OPERATING + CHARGED_OFF_FEES: :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST: :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL: :CHARGED_OFF_PRINCIPAL + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::type_] + end + + type status_change_reason = + :CHARGED_OFF_DELINQUENT + | :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :DELINQUENT + + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + DELINQUENT: :DELINQUENT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::status_change_reason] + end + end + end +end diff --git a/sig/lithic/models/financial_account_create_params.rbs b/sig/lithic/models/financial_account_create_params.rbs new file mode 100644 index 00000000..facefea4 --- /dev/null +++ b/sig/lithic/models/financial_account_create_params.rbs @@ -0,0 +1,55 @@ +module Lithic + module Models + type financial_account_create_params = + { + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::type_, + account_token: String, + is_for_benefit_of: bool, + idempotency_key: String + } + & Lithic::request_parameters + + class FinancialAccountCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor nickname: String + + attr_accessor type: Lithic::Models::FinancialAccountCreateParams::type_ + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader is_for_benefit_of: bool? + + def is_for_benefit_of=: (bool) -> bool + + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + + def initialize: ( + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::type_, + ?account_token: String, + ?is_for_benefit_of: bool, + ?idempotency_key: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::financial_account_create_params + + type type_ = :OPERATING + + module Type + extend Lithic::Enum + + OPERATING: :OPERATING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountCreateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/financial_account_list_params.rbs b/sig/lithic/models/financial_account_list_params.rbs new file mode 100644 index 00000000..2595bd18 --- /dev/null +++ b/sig/lithic/models/financial_account_list_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + type financial_account_list_params = + { + account_token: String, + business_account_token: String, + type: Lithic::Models::FinancialAccountListParams::type_ + } + & Lithic::request_parameters + + class FinancialAccountListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader type: Lithic::Models::FinancialAccountListParams::type_? + + def type=: ( + Lithic::Models::FinancialAccountListParams::type_ + ) -> Lithic::Models::FinancialAccountListParams::type_ + + def initialize: ( + ?account_token: String, + ?business_account_token: String, + ?type: Lithic::Models::FinancialAccountListParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::financial_account_list_params + + type type_ = :ISSUING | :OPERATING | :RESERVE + + module Type + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountListParams::type_] + end + end + end +end diff --git a/sig/lithic/models/financial_account_retrieve_params.rbs b/sig/lithic/models/financial_account_retrieve_params.rbs new file mode 100644 index 00000000..e368a750 --- /dev/null +++ b/sig/lithic/models/financial_account_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type financial_account_retrieve_params = { } & Lithic::request_parameters + + class FinancialAccountRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::financial_account_retrieve_params + end + end +end diff --git a/sig/lithic/models/financial_account_update_params.rbs b/sig/lithic/models/financial_account_update_params.rbs new file mode 100644 index 00000000..434921ef --- /dev/null +++ b/sig/lithic/models/financial_account_update_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type financial_account_update_params = + { nickname: String } & Lithic::request_parameters + + class FinancialAccountUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader nickname: String? + + def nickname=: (String) -> String + + def initialize: ( + ?nickname: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::financial_account_update_params + end + end +end diff --git a/sig/lithic/models/financial_account_update_status_params.rbs b/sig/lithic/models/financial_account_update_status_params.rbs new file mode 100644 index 00000000..3dde44cc --- /dev/null +++ b/sig/lithic/models/financial_account_update_status_params.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + type financial_account_update_status_params = + { + status: Lithic::Models::FinancialAccountUpdateStatusParams::status, + status_change_reason: Lithic::Models::FinancialAccountUpdateStatusParams::status_change_reason? + } + & Lithic::request_parameters + + class FinancialAccountUpdateStatusParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor status: Lithic::Models::FinancialAccountUpdateStatusParams::status + + attr_accessor status_change_reason: Lithic::Models::FinancialAccountUpdateStatusParams::status_change_reason? + + def initialize: ( + status: Lithic::Models::FinancialAccountUpdateStatusParams::status, + status_change_reason: Lithic::Models::FinancialAccountUpdateStatusParams::status_change_reason?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::financial_account_update_status_params + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountUpdateStatusParams::status] + end + + type status_change_reason = + :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :CHARGED_OFF_DELINQUENT + + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountUpdateStatusParams::status_change_reason] + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/balance_list_params.rbs b/sig/lithic/models/financial_accounts/balance_list_params.rbs new file mode 100644 index 00000000..8fa269d9 --- /dev/null +++ b/sig/lithic/models/financial_accounts/balance_list_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module FinancialAccounts + type balance_list_params = + { balance_date: Time, last_transaction_event_token: String } + & Lithic::request_parameters + + class BalanceListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader balance_date: Time? + + def balance_date=: (Time) -> Time + + attr_reader last_transaction_event_token: String? + + def last_transaction_event_token=: (String) -> String + + def initialize: ( + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::balance_list_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/balance_list_response.rbs b/sig/lithic/models/financial_accounts/balance_list_response.rbs new file mode 100644 index 00000000..4ee1b0d1 --- /dev/null +++ b/sig/lithic/models/financial_accounts/balance_list_response.rbs @@ -0,0 +1,68 @@ +module Lithic + module Models + module FinancialAccounts + type balance_list_response = + { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccounts::BalanceListResponse::type_, + updated: Time + } + + class BalanceListResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor available_amount: Integer + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_transaction_event_token: String + + attr_accessor last_transaction_token: String + + attr_accessor pending_amount: Integer + + attr_accessor total_amount: Integer + + attr_accessor type: Lithic::Models::FinancialAccounts::BalanceListResponse::type_ + + attr_accessor updated: Time + + def initialize: ( + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccounts::BalanceListResponse::type_, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::balance_list_response + + type type_ = :ISSUING | :OPERATING | :RESERVE + + module Type + extend Lithic::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::BalanceListResponse::type_] + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbs b/sig/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbs new file mode 100644 index 00000000..179f73f1 --- /dev/null +++ b/sig/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module FinancialAccounts + type credit_configuration_retrieve_params = + { } & Lithic::request_parameters + + class CreditConfigurationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::credit_configuration_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/credit_configuration_update_params.rbs b/sig/lithic/models/financial_accounts/credit_configuration_update_params.rbs new file mode 100644 index 00000000..8a403d16 --- /dev/null +++ b/sig/lithic/models/financial_accounts/credit_configuration_update_params.rbs @@ -0,0 +1,45 @@ +module Lithic + module Models + module FinancialAccounts + type credit_configuration_update_params = + { + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String + } + & Lithic::request_parameters + + class CreditConfigurationUpdateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader credit_limit: Integer? + + def credit_limit=: (Integer) -> Integer + + attr_reader credit_product_token: String? + + def credit_product_token=: (String) -> String + + attr_reader external_bank_account_token: String? + + def external_bank_account_token=: (String) -> String + + attr_reader tier: String? + + def tier=: (String) -> String + + def initialize: ( + ?credit_limit: Integer, + ?credit_product_token: String, + ?external_bank_account_token: String, + ?tier: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::credit_configuration_update_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/financial_account_credit_config.rbs b/sig/lithic/models/financial_accounts/financial_account_credit_config.rbs new file mode 100644 index 00000000..f307e784 --- /dev/null +++ b/sig/lithic/models/financial_accounts/financial_account_credit_config.rbs @@ -0,0 +1,75 @@ +module Lithic + module Models + class FinancialAccountCreditConfig = FinancialAccounts::FinancialAccountCreditConfig + + module FinancialAccounts + type financial_account_credit_config = + { + account_token: String, + charged_off_reason: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::charged_off_reason?, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + financial_account_state: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::financial_account_state, + is_spend_blocked: bool, + tier: String? + } + + class FinancialAccountCreditConfig < Lithic::BaseModel + attr_accessor account_token: String + + attr_accessor charged_off_reason: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::charged_off_reason? + + attr_accessor credit_limit: Integer? + + attr_accessor credit_product_token: String? + + attr_accessor external_bank_account_token: String? + + attr_accessor financial_account_state: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::financial_account_state + + attr_accessor is_spend_blocked: bool + + attr_accessor tier: String? + + def initialize: ( + account_token: String, + charged_off_reason: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::charged_off_reason?, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + financial_account_state: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::financial_account_state, + is_spend_blocked: bool, + tier: String? + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::financial_account_credit_config + + type charged_off_reason = :DELINQUENT | :FRAUD + + module ChargedOffReason + extend Lithic::Enum + + DELINQUENT: :DELINQUENT + FRAUD: :FRAUD + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::charged_off_reason] + end + + type financial_account_state = + :PENDING | :CURRENT | :DELINQUENT | :CHARGED_OFF + + module FinancialAccountState + extend Lithic::Enum + + PENDING: :PENDING + CURRENT: :CURRENT + DELINQUENT: :DELINQUENT + CHARGED_OFF: :CHARGED_OFF + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::financial_account_state] + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/financial_transaction_list_params.rbs b/sig/lithic/models/financial_accounts/financial_transaction_list_params.rbs new file mode 100644 index 00000000..88fac1de --- /dev/null +++ b/sig/lithic/models/financial_accounts/financial_transaction_list_params.rbs @@ -0,0 +1,109 @@ +module Lithic + module Models + module FinancialAccounts + type financial_transaction_list_params = + { + begin_: Time, + category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category, + end_: Time, + ending_before: String, + result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result, + starting_after: String, + status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status + } + & Lithic::request_parameters + + class FinancialTransactionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category? + + def category=: ( + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category + ) -> Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result? + + def result=: ( + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result + ) -> Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status? + + def status=: ( + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status + ) -> Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status + + def initialize: ( + ?begin_: Time, + ?category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::financial_transaction_list_params + + type category = :ACH | :CARD | :INTERNAL | :TRANSFER + + module Category + extend Lithic::Enum + + ACH: :ACH + CARD: :CARD + INTERNAL: :INTERNAL + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result] + end + + type status = + :DECLINED | :EXPIRED | :PENDING | :RETURNED | :SETTLED | :VOIDED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status] + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbs b/sig/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbs new file mode 100644 index 00000000..6665aa6d --- /dev/null +++ b/sig/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + module FinancialAccounts + type financial_transaction_retrieve_params = + { financial_account_token: String } & Lithic::request_parameters + + class FinancialTransactionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor financial_account_token: String + + def initialize: ( + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::financial_transaction_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape.rbs b/sig/lithic/models/financial_accounts/loan_tape.rbs new file mode 100644 index 00000000..826d53b2 --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape.rbs @@ -0,0 +1,594 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape = + { + token: String, + account_standing: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::Models::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::Models::FinancialAccounts::LoanTape::DayTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails?, + minimum_payment_balance: Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals, + previous_statement_balance: Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::Models::FinancialAccounts::LoanTape::YtdTotals, + tier: String + } + + class LoanTape < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_standing: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding + + attr_accessor available_credit: Integer + + attr_accessor balances: Lithic::Models::FinancialAccounts::LoanTape::Balances + + attr_accessor created: Time + + attr_accessor credit_limit: Integer + + attr_accessor credit_product_token: String + + attr_accessor date: Date + + attr_accessor day_totals: Lithic::Models::FinancialAccounts::LoanTape::DayTotals + + attr_accessor ending_balance: Integer + + attr_accessor excess_credits: Integer + + attr_accessor financial_account_token: String + + attr_accessor interest_details: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails? + + attr_accessor minimum_payment_balance: Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance + + attr_accessor payment_allocation: Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation + + attr_accessor period_totals: Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals + + attr_accessor previous_statement_balance: Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance + + attr_accessor starting_balance: Integer + + attr_accessor updated: Time + + attr_accessor version: Integer + + attr_accessor ytd_totals: Lithic::Models::FinancialAccounts::LoanTape::YtdTotals + + attr_reader tier: String? + + def tier=: (String) -> String + + def initialize: ( + token: String, + account_standing: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::Models::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::Models::FinancialAccounts::LoanTape::DayTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails?, + minimum_payment_balance: Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals, + previous_statement_balance: Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::Models::FinancialAccounts::LoanTape::YtdTotals, + ?tier: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::loan_tape + + type account_standing = + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state + } + + class AccountStanding < Lithic::BaseModel + attr_accessor consecutive_full_payments_made: Integer + + attr_accessor consecutive_minimum_payments_made: Integer + + attr_accessor consecutive_minimum_payments_missed: Integer + + attr_accessor days_past_due: Integer + + attr_accessor financial_account_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState + + attr_accessor has_grace: bool + + attr_accessor period_number: Integer + + attr_accessor period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state + + def initialize: ( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::account_standing + + type financial_account_state = + { + status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status, + status_change_reason: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status_change_reason? + } + + class FinancialAccountState < Lithic::BaseModel + attr_accessor status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status + + attr_accessor status_change_reason: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status_change_reason? + + def initialize: ( + status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status, + ?status_change_reason: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status_change_reason? + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::financial_account_state + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status] + end + + type status_change_reason = + :CHARGED_OFF_DELINQUENT + | :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :DELINQUENT + + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + DELINQUENT: :DELINQUENT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status_change_reason] + end + end + + type period_state = :STANDARD | :PROMO | :PENALTY + + module PeriodState + extend Lithic::Enum + + STANDARD: :STANDARD + PROMO: :PROMO + PENALTY: :PENALTY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state] + end + end + + type balances = + { + due: Lithic::Models::FinancialAccounts::LoanTape::Balances::Due, + next_statement_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue, + past_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue, + past_statements_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue + } + + class Balances < Lithic::BaseModel + attr_accessor due: Lithic::Models::FinancialAccounts::LoanTape::Balances::Due + + attr_accessor next_statement_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue + + attr_accessor past_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue + + attr_accessor past_statements_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue + + def initialize: ( + due: Lithic::Models::FinancialAccounts::LoanTape::Balances::Due, + next_statement_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::NextStatementDue, + past_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastDue, + past_statements_due: Lithic::Models::FinancialAccounts::LoanTape::Balances::PastStatementsDue + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::balances + + type due = { fees: Integer, interest: Integer, principal: Integer } + + class Due < Lithic::BaseModel + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor principal: Integer + + def initialize: ( + fees: Integer, + interest: Integer, + principal: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::Balances::due + end + + type next_statement_due = + { fees: Integer, interest: Integer, principal: Integer } + + class NextStatementDue < Lithic::BaseModel + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor principal: Integer + + def initialize: ( + fees: Integer, + interest: Integer, + principal: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::Balances::next_statement_due + end + + type past_due = + { fees: Integer, interest: Integer, principal: Integer } + + class PastDue < Lithic::BaseModel + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor principal: Integer + + def initialize: ( + fees: Integer, + interest: Integer, + principal: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::Balances::past_due + end + + type past_statements_due = + { fees: Integer, interest: Integer, principal: Integer } + + class PastStatementsDue < Lithic::BaseModel + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor principal: Integer + + def initialize: ( + fees: Integer, + interest: Integer, + principal: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::Balances::past_statements_due + end + end + + type day_totals = + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + + class DayTotals < Lithic::BaseModel + attr_accessor balance_transfers: Integer + + attr_accessor cash_advances: Integer + + attr_accessor credits: Integer + + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor payments: Integer + + attr_accessor purchases: Integer + + def initialize: ( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::day_totals + end + + type interest_details = + { + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts, + effective_apr: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr, + interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod, + prime_rate: String?, + minimum_interest_charged: Integer? + } + + class InterestDetails < Lithic::BaseModel + attr_accessor actual_interest_charged: Integer? + + attr_accessor daily_balance_amounts: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts + + attr_accessor effective_apr: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr + + attr_accessor interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method + + attr_accessor interest_for_period: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod + + attr_accessor prime_rate: String? + + attr_accessor minimum_interest_charged: Integer? + + def initialize: ( + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::DailyBalanceAmounts, + effective_apr: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::EffectiveApr, + interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestForPeriod, + prime_rate: String?, + ?minimum_interest_charged: Integer? + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::interest_details + + type daily_balance_amounts = + { + balance_transfers: String, + cash_advances: String, + purchases: String + } + + class DailyBalanceAmounts < Lithic::BaseModel + attr_accessor balance_transfers: String + + attr_accessor cash_advances: String + + attr_accessor purchases: String + + def initialize: ( + balance_transfers: String, + cash_advances: String, + purchases: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::daily_balance_amounts + end + + type effective_apr = + { + balance_transfers: String, + cash_advances: String, + purchases: String + } + + class EffectiveApr < Lithic::BaseModel + attr_accessor balance_transfers: String + + attr_accessor cash_advances: String + + attr_accessor purchases: String + + def initialize: ( + balance_transfers: String, + cash_advances: String, + purchases: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::effective_apr + end + + type interest_calculation_method = :DAILY | :AVERAGE_DAILY + + module InterestCalculationMethod + extend Lithic::Enum + + DAILY: :DAILY + AVERAGE_DAILY: :AVERAGE_DAILY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method] + end + + type interest_for_period = + { + balance_transfers: String, + cash_advances: String, + purchases: String + } + + class InterestForPeriod < Lithic::BaseModel + attr_accessor balance_transfers: String + + attr_accessor cash_advances: String + + attr_accessor purchases: String + + def initialize: ( + balance_transfers: String, + cash_advances: String, + purchases: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_for_period + end + end + + type minimum_payment_balance = { amount: Integer, remaining: Integer } + + class MinimumPaymentBalance < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor remaining: Integer + + def initialize: (amount: Integer, remaining: Integer) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::minimum_payment_balance + end + + type payment_allocation = + { fees: Integer, interest: Integer, principal: Integer } + + class PaymentAllocation < Lithic::BaseModel + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor principal: Integer + + def initialize: ( + fees: Integer, + interest: Integer, + principal: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::payment_allocation + end + + type period_totals = + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + + class PeriodTotals < Lithic::BaseModel + attr_accessor balance_transfers: Integer + + attr_accessor cash_advances: Integer + + attr_accessor credits: Integer + + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor payments: Integer + + attr_accessor purchases: Integer + + def initialize: ( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::period_totals + end + + type previous_statement_balance = + { amount: Integer, remaining: Integer } + + class PreviousStatementBalance < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor remaining: Integer + + def initialize: (amount: Integer, remaining: Integer) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::previous_statement_balance + end + + type ytd_totals = + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + + class YtdTotals < Lithic::BaseModel + attr_accessor balance_transfers: Integer + + attr_accessor cash_advances: Integer + + attr_accessor credits: Integer + + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor payments: Integer + + attr_accessor purchases: Integer + + def initialize: ( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::LoanTape::ytd_totals + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape_list_params.rbs b/sig/lithic/models/financial_accounts/loan_tape_list_params.rbs new file mode 100644 index 00000000..771a4edb --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape_list_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape_list_params = + { + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::request_parameters + + class LoanTapeListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Date? + + def begin_=: (Date) -> Date + + attr_reader end_: Date? + + def end_=: (Date) -> Date + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::loan_tape_list_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape_retrieve_params.rbs b/sig/lithic/models/financial_accounts/loan_tape_retrieve_params.rbs new file mode 100644 index 00000000..dd61de5f --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape_retrieve_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape_retrieve_params = + { financial_account_token: String } & Lithic::request_parameters + + class LoanTapeRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor financial_account_token: String + + def initialize: ( + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::loan_tape_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statement.rbs b/sig/lithic/models/financial_accounts/statement.rbs new file mode 100644 index 00000000..22cdc373 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statement.rbs @@ -0,0 +1,431 @@ +module Lithic + module Models + module FinancialAccounts + type statement = + { + token: String, + account_standing: Lithic::Models::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::Models::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date?, + period_totals: Lithic::Models::FinancialAccounts::Statement::PeriodTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::statement_type, + updated: Time, + ytd_totals: Lithic::Models::FinancialAccounts::Statement::YtdTotals, + interest_details: Lithic::Models::FinancialAccounts::Statement::InterestDetails?, + next_payment_due_date: Date, + next_statement_end_date: Date + } + + class Statement < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_standing: Lithic::Models::FinancialAccounts::Statement::AccountStanding + + attr_accessor amount_due: Lithic::Models::FinancialAccounts::Statement::AmountDue + + attr_accessor available_credit: Integer + + attr_accessor created: Time + + attr_accessor credit_limit: Integer + + attr_accessor credit_product_token: String + + attr_accessor days_in_billing_cycle: Integer + + attr_accessor ending_balance: Integer + + attr_accessor financial_account_token: String + + attr_accessor payment_due_date: Date? + + attr_accessor period_totals: Lithic::Models::FinancialAccounts::Statement::PeriodTotals + + attr_accessor starting_balance: Integer + + attr_accessor statement_end_date: Date + + attr_accessor statement_start_date: Date + + attr_accessor statement_type: Lithic::Models::FinancialAccounts::Statement::statement_type + + attr_accessor updated: Time + + attr_accessor ytd_totals: Lithic::Models::FinancialAccounts::Statement::YtdTotals + + attr_accessor interest_details: Lithic::Models::FinancialAccounts::Statement::InterestDetails? + + attr_reader next_payment_due_date: Date? + + def next_payment_due_date=: (Date) -> Date + + attr_reader next_statement_end_date: Date? + + def next_statement_end_date=: (Date) -> Date + + def initialize: ( + token: String, + account_standing: Lithic::Models::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::Models::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date?, + period_totals: Lithic::Models::FinancialAccounts::Statement::PeriodTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::statement_type, + updated: Time, + ytd_totals: Lithic::Models::FinancialAccounts::Statement::YtdTotals, + ?interest_details: Lithic::Models::FinancialAccounts::Statement::InterestDetails?, + ?next_payment_due_date: Date, + ?next_statement_end_date: Date + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::statement + + type account_standing = + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state + } + + class AccountStanding < Lithic::BaseModel + attr_accessor consecutive_full_payments_made: Integer + + attr_accessor consecutive_minimum_payments_made: Integer + + attr_accessor consecutive_minimum_payments_missed: Integer + + attr_accessor days_past_due: Integer + + attr_accessor financial_account_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState + + attr_accessor has_grace: bool + + attr_accessor period_number: Integer + + attr_accessor period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state + + def initialize: ( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::account_standing + + type financial_account_state = + { + status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status, + status_change_reason: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status_change_reason? + } + + class FinancialAccountState < Lithic::BaseModel + attr_accessor status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status + + attr_accessor status_change_reason: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status_change_reason? + + def initialize: ( + status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status, + ?status_change_reason: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status_change_reason? + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::AccountStanding::financial_account_state + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status] + end + + type status_change_reason = + :CHARGED_OFF_DELINQUENT + | :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :DELINQUENT + + module StatusChangeReason + extend Lithic::Enum + + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + DELINQUENT: :DELINQUENT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status_change_reason] + end + end + + type period_state = :STANDARD | :PROMO | :PENALTY + + module PeriodState + extend Lithic::Enum + + STANDARD: :STANDARD + PROMO: :PROMO + PENALTY: :PENALTY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state] + end + end + + type amount_due = { amount: Integer, past_due: Integer } + + class AmountDue < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor past_due: Integer + + def initialize: (amount: Integer, past_due: Integer) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::amount_due + end + + type period_totals = + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + + class PeriodTotals < Lithic::BaseModel + attr_accessor balance_transfers: Integer + + attr_accessor cash_advances: Integer + + attr_accessor credits: Integer + + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor payments: Integer + + attr_accessor purchases: Integer + + def initialize: ( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::period_totals + end + + type statement_type = :INITIAL | :PERIOD_END | :FINAL + + module StatementType + extend Lithic::Enum + + INITIAL: :INITIAL + PERIOD_END: :PERIOD_END + FINAL: :FINAL + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::statement_type] + end + + type ytd_totals = + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + } + + class YtdTotals < Lithic::BaseModel + attr_accessor balance_transfers: Integer + + attr_accessor cash_advances: Integer + + attr_accessor credits: Integer + + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor payments: Integer + + attr_accessor purchases: Integer + + def initialize: ( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::ytd_totals + end + + type interest_details = + { + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts, + effective_apr: Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr, + interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod, + prime_rate: String?, + minimum_interest_charged: Integer? + } + + class InterestDetails < Lithic::BaseModel + attr_accessor actual_interest_charged: Integer? + + attr_accessor daily_balance_amounts: Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts + + attr_accessor effective_apr: Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr + + attr_accessor interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method + + attr_accessor interest_for_period: Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod + + attr_accessor prime_rate: String? + + attr_accessor minimum_interest_charged: Integer? + + def initialize: ( + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::Models::FinancialAccounts::Statement::InterestDetails::DailyBalanceAmounts, + effective_apr: Lithic::Models::FinancialAccounts::Statement::InterestDetails::EffectiveApr, + interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestForPeriod, + prime_rate: String?, + ?minimum_interest_charged: Integer? + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::interest_details + + type daily_balance_amounts = + { + balance_transfers: String, + cash_advances: String, + purchases: String + } + + class DailyBalanceAmounts < Lithic::BaseModel + attr_accessor balance_transfers: String + + attr_accessor cash_advances: String + + attr_accessor purchases: String + + def initialize: ( + balance_transfers: String, + cash_advances: String, + purchases: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::InterestDetails::daily_balance_amounts + end + + type effective_apr = + { + balance_transfers: String, + cash_advances: String, + purchases: String + } + + class EffectiveApr < Lithic::BaseModel + attr_accessor balance_transfers: String + + attr_accessor cash_advances: String + + attr_accessor purchases: String + + def initialize: ( + balance_transfers: String, + cash_advances: String, + purchases: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::InterestDetails::effective_apr + end + + type interest_calculation_method = :DAILY | :AVERAGE_DAILY + + module InterestCalculationMethod + extend Lithic::Enum + + DAILY: :DAILY + AVERAGE_DAILY: :AVERAGE_DAILY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method] + end + + type interest_for_period = + { + balance_transfers: String, + cash_advances: String, + purchases: String + } + + class InterestForPeriod < Lithic::BaseModel + attr_accessor balance_transfers: String + + attr_accessor cash_advances: String + + attr_accessor purchases: String + + def initialize: ( + balance_transfers: String, + cash_advances: String, + purchases: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_for_period + end + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statement_list_params.rbs b/sig/lithic/models/financial_accounts/statement_list_params.rbs new file mode 100644 index 00000000..f80854a0 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statement_list_params.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + module FinancialAccounts + type statement_list_params = + { + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: bool, + page_size: Integer, + starting_after: String + } + & Lithic::request_parameters + + class StatementListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Date? + + def begin_=: (Date) -> Date + + attr_reader end_: Date? + + def end_=: (Date) -> Date + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader include_initial_statements: bool? + + def include_initial_statements=: (bool) -> bool + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?include_initial_statements: bool, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::statement_list_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statement_retrieve_params.rbs b/sig/lithic/models/financial_accounts/statement_retrieve_params.rbs new file mode 100644 index 00000000..4035c473 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statement_retrieve_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + module FinancialAccounts + type statement_retrieve_params = + { financial_account_token: String } & Lithic::request_parameters + + class StatementRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor financial_account_token: String + + def initialize: ( + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::statement_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statements.rbs b/sig/lithic/models/financial_accounts/statements.rbs new file mode 100644 index 00000000..6ebc2c3f --- /dev/null +++ b/sig/lithic/models/financial_accounts/statements.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + module FinancialAccounts + type financial_accounts_statements = + { + data: ::Array[Lithic::Models::FinancialAccounts::Statement], + has_more: bool + } + + class FinancialAccountsStatements < Lithic::BaseModel + attr_accessor data: ::Array[Lithic::Models::FinancialAccounts::Statement] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::Models::FinancialAccounts::Statement], + has_more: bool + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::financial_accounts_statements + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statements/line_item_list_params.rbs b/sig/lithic/models/financial_accounts/statements/line_item_list_params.rbs new file mode 100644 index 00000000..32e3f81e --- /dev/null +++ b/sig/lithic/models/financial_accounts/statements/line_item_list_params.rbs @@ -0,0 +1,45 @@ +module Lithic + module Models + module FinancialAccounts + module Statements + type line_item_list_params = + { + financial_account_token: String, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::request_parameters + + class LineItemListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + financial_account_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statements::line_item_list_params + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs new file mode 100644 index 00000000..d3c4cf94 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs @@ -0,0 +1,259 @@ +module Lithic + module Models + module FinancialAccounts + class StatementLineItems = Statements::StatementLineItems + + module Statements + type statement_line_items = + { + data: ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data], + has_more: bool + } + + class StatementLineItems < Lithic::BaseModel + attr_accessor data: ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data], + has_more: bool + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statements::statement_line_items + + type data = + { + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: String, + descriptor: String + } + + class Data < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor effective_date: Date + + attr_accessor event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type + + attr_accessor financial_account_token: String + + attr_accessor financial_transaction_event_token: String + + attr_accessor financial_transaction_token: String + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader descriptor: String? + + def descriptor=: (String) -> String + + def initialize: ( + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + ?card_token: String, + ?descriptor: String + ) -> void + + def to_hash: -> Lithic::Models::FinancialAccounts::Statements::StatementLineItems::data + + type category = + :ACH + | :BALANCE_OR_FUNDING + | :CARD + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_TRANSFER + | :EXTERNAL_WIRE + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_FEE + | :MANAGEMENT_REWARD + + module Category + extend Lithic::Enum + + ACH: :ACH + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + CARD: :CARD + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + EXTERNAL_WIRE: :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category] + end + + type event_type = + :ACH_ORIGINATION_CANCELLED + | :ACH_ORIGINATION_INITIATED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_PROCESSED + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_SETTLED + | :AUTHORIZATION + | :AUTHORIZATION_ADVICE + | :AUTHORIZATION_EXPIRY + | :AUTHORIZATION_REVERSAL + | :BALANCE_INQUIRY + | :BILLING_ERROR + | :BILLING_ERROR_REVERSAL + | :CARD_TO_CARD + | :CASH_BACK + | :CASH_BACK_REVERSAL + | :CLEARING + | :CORRECTION_CREDIT + | :CORRECTION_DEBIT + | :CREDIT_AUTHORIZATION + | :CREDIT_AUTHORIZATION_ADVICE + | :CURRENCY_CONVERSION + | :CURRENCY_CONVERSION_REVERSAL + | :DISPUTE_WON + | :EXTERNAL_ACH_CANCELED + | :EXTERNAL_ACH_INITIATED + | :EXTERNAL_ACH_RELEASED + | :EXTERNAL_ACH_REVERSED + | :EXTERNAL_ACH_SETTLED + | :EXTERNAL_CHECK_CANCELED + | :EXTERNAL_CHECK_INITIATED + | :EXTERNAL_CHECK_RELEASED + | :EXTERNAL_CHECK_REVERSED + | :EXTERNAL_CHECK_SETTLED + | :EXTERNAL_TRANSFER_CANCELED + | :EXTERNAL_TRANSFER_INITIATED + | :EXTERNAL_TRANSFER_RELEASED + | :EXTERNAL_TRANSFER_REVERSED + | :EXTERNAL_TRANSFER_SETTLED + | :EXTERNAL_WIRE_CANCELED + | :EXTERNAL_WIRE_INITIATED + | :EXTERNAL_WIRE_RELEASED + | :EXTERNAL_WIRE_REVERSED + | :EXTERNAL_WIRE_SETTLED + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :INTEREST + | :INTEREST_REVERSAL + | :INTERNAL_ADJUSTMENT + | :LATE_PAYMENT + | :LATE_PAYMENT_REVERSAL + | :PROVISIONAL_CREDIT + | :PROVISIONAL_CREDIT_REVERSAL + | :RETURN + | :RETURN_REVERSAL + | :TRANSFER + | :TRANSFER_INSUFFICIENT_FUNDS + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + + module EventType + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED: :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED: :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + AUTHORIZATION: :AUTHORIZATION + AUTHORIZATION_ADVICE: :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY: :BALANCE_INQUIRY + BILLING_ERROR: :BILLING_ERROR + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + CARD_TO_CARD: :CARD_TO_CARD + CASH_BACK: :CASH_BACK + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CLEARING: :CLEARING + CORRECTION_CREDIT: :CORRECTION_CREDIT + CORRECTION_DEBIT: :CORRECTION_DEBIT + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE: :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON: :DISPUTE_WON + EXTERNAL_ACH_CANCELED: :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED: :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED: :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED: :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED: :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED: :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED: :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED: :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED: :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED: :EXTERNAL_CHECK_SETTLED + EXTERNAL_TRANSFER_CANCELED: :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED: :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED: :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED: :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED: :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED: :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED: :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED: :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED: :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED: :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST: :INTEREST + INTEREST_REVERSAL: :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT: :INTERNAL_ADJUSTMENT + LATE_PAYMENT: :LATE_PAYMENT + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + RETURN: :RETURN + RETURN_REVERSAL: :RETURN_REVERSAL + TRANSFER: :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS: :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type] + end + end + end + end + end + end +end diff --git a/sig/lithic/models/financial_transaction.rbs b/sig/lithic/models/financial_transaction.rbs new file mode 100644 index 00000000..d8450f79 --- /dev/null +++ b/sig/lithic/models/financial_transaction.rbs @@ -0,0 +1,291 @@ +module Lithic + module Models + type financial_transaction = + { + token: String, + category: Lithic::Models::FinancialTransaction::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::Models::FinancialTransaction::Event], + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::status, + updated: Time + } + + class FinancialTransaction < Lithic::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::FinancialTransaction::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor descriptor: String + + attr_accessor events: ::Array[Lithic::Models::FinancialTransaction::Event] + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::FinancialTransaction::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::FinancialTransaction::status + + attr_accessor updated: Time + + def initialize: ( + token: String, + category: Lithic::Models::FinancialTransaction::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::Models::FinancialTransaction::Event], + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::status, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::financial_transaction + + type category = :ACH | :CARD | :INTERNAL | :TRANSFER + + module Category + extend Lithic::Enum + + ACH: :ACH + CARD: :CARD + INTERNAL: :INTERNAL + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::category] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::FinancialTransaction::Event::result, + type: Lithic::Models::FinancialTransaction::Event::type_ + } + + class Event < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader result: Lithic::Models::FinancialTransaction::Event::result? + + def result=: ( + Lithic::Models::FinancialTransaction::Event::result + ) -> Lithic::Models::FinancialTransaction::Event::result + + attr_reader type: Lithic::Models::FinancialTransaction::Event::type_? + + def type=: ( + Lithic::Models::FinancialTransaction::Event::type_ + ) -> Lithic::Models::FinancialTransaction::Event::type_ + + def initialize: ( + ?token: String, + ?amount: Integer, + ?created: Time, + ?result: Lithic::Models::FinancialTransaction::Event::result, + ?type: Lithic::Models::FinancialTransaction::Event::type_ + ) -> void + + def to_hash: -> Lithic::Models::FinancialTransaction::event + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::Event::result] + end + + type type_ = + :ACH_ORIGINATION_CANCELLED + | :ACH_ORIGINATION_INITIATED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_PROCESSED + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_SETTLED + | :AUTHORIZATION + | :AUTHORIZATION_ADVICE + | :AUTHORIZATION_EXPIRY + | :AUTHORIZATION_REVERSAL + | :BALANCE_INQUIRY + | :BILLING_ERROR + | :BILLING_ERROR_REVERSAL + | :CARD_TO_CARD + | :CASH_BACK + | :CASH_BACK_REVERSAL + | :CLEARING + | :CORRECTION_CREDIT + | :CORRECTION_DEBIT + | :CREDIT_AUTHORIZATION + | :CREDIT_AUTHORIZATION_ADVICE + | :CURRENCY_CONVERSION + | :CURRENCY_CONVERSION_REVERSAL + | :DISPUTE_WON + | :EXTERNAL_ACH_CANCELED + | :EXTERNAL_ACH_INITIATED + | :EXTERNAL_ACH_RELEASED + | :EXTERNAL_ACH_REVERSED + | :EXTERNAL_ACH_SETTLED + | :EXTERNAL_CHECK_CANCELED + | :EXTERNAL_CHECK_INITIATED + | :EXTERNAL_CHECK_RELEASED + | :EXTERNAL_CHECK_REVERSED + | :EXTERNAL_CHECK_SETTLED + | :EXTERNAL_TRANSFER_CANCELED + | :EXTERNAL_TRANSFER_INITIATED + | :EXTERNAL_TRANSFER_RELEASED + | :EXTERNAL_TRANSFER_REVERSED + | :EXTERNAL_TRANSFER_SETTLED + | :EXTERNAL_WIRE_CANCELED + | :EXTERNAL_WIRE_INITIATED + | :EXTERNAL_WIRE_RELEASED + | :EXTERNAL_WIRE_REVERSED + | :EXTERNAL_WIRE_SETTLED + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :INTEREST + | :INTEREST_REVERSAL + | :INTERNAL_ADJUSTMENT + | :LATE_PAYMENT + | :LATE_PAYMENT_REVERSAL + | :PROVISIONAL_CREDIT + | :PROVISIONAL_CREDIT_REVERSAL + | :RETURN + | :RETURN_REVERSAL + | :TRANSFER + | :TRANSFER_INSUFFICIENT_FUNDS + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + + module Type + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED: :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED: :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + AUTHORIZATION: :AUTHORIZATION + AUTHORIZATION_ADVICE: :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY: :BALANCE_INQUIRY + BILLING_ERROR: :BILLING_ERROR + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + CARD_TO_CARD: :CARD_TO_CARD + CASH_BACK: :CASH_BACK + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CLEARING: :CLEARING + CORRECTION_CREDIT: :CORRECTION_CREDIT + CORRECTION_DEBIT: :CORRECTION_DEBIT + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE: :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON: :DISPUTE_WON + EXTERNAL_ACH_CANCELED: :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED: :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED: :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED: :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED: :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED: :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED: :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED: :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED: :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED: :EXTERNAL_CHECK_SETTLED + EXTERNAL_TRANSFER_CANCELED: :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED: :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED: :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED: :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED: :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED: :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED: :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED: :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED: :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED: :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST: :INTEREST + INTEREST_REVERSAL: :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT: :INTERNAL_ADJUSTMENT + LATE_PAYMENT: :LATE_PAYMENT + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + RETURN: :RETURN + RETURN_REVERSAL: :RETURN_REVERSAL + TRANSFER: :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS: :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::Event::type_] + end + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::result] + end + + type status = + :DECLINED | :EXPIRED | :PENDING | :RETURNED | :SETTLED | :VOIDED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::status] + end + end + end +end diff --git a/sig/lithic/models/instance_financial_account_type.rbs b/sig/lithic/models/instance_financial_account_type.rbs new file mode 100644 index 00000000..05265a1f --- /dev/null +++ b/sig/lithic/models/instance_financial_account_type.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type instance_financial_account_type = + :ISSUING + | :RESERVE + | :OPERATING + | :CHARGED_OFF_FEES + | :CHARGED_OFF_INTEREST + | :CHARGED_OFF_PRINCIPAL + + module InstanceFinancialAccountType + extend Lithic::Enum + + ISSUING: :ISSUING + RESERVE: :RESERVE + OPERATING: :OPERATING + CHARGED_OFF_FEES: :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST: :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL: :CHARGED_OFF_PRINCIPAL + + def self?.values: -> ::Array[Lithic::Models::instance_financial_account_type] + end + end +end diff --git a/sig/lithic/models/kyb.rbs b/sig/lithic/models/kyb.rbs new file mode 100644 index 00000000..4ca5e20e --- /dev/null +++ b/sig/lithic/models/kyb.rbs @@ -0,0 +1,231 @@ +module Lithic + module Models + type kyb = + { + beneficial_owner_entities: ::Array[Lithic::Models::KYB::BeneficialOwnerEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::KYB::BeneficialOwnerIndividual], + business_entity: Lithic::Models::KYB::BusinessEntity, + control_person: Lithic::Models::KYB::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::KYB::workflow, + external_id: String, + kyb_passed_timestamp: String, + website_url: String + } + + class KYB < Lithic::BaseModel + attr_accessor beneficial_owner_entities: ::Array[Lithic::Models::KYB::BeneficialOwnerEntity] + + attr_accessor beneficial_owner_individuals: ::Array[Lithic::Models::KYB::BeneficialOwnerIndividual] + + attr_accessor business_entity: Lithic::Models::KYB::BusinessEntity + + attr_accessor control_person: Lithic::Models::KYB::ControlPerson + + attr_accessor nature_of_business: String + + attr_accessor tos_timestamp: String + + attr_accessor workflow: Lithic::Models::KYB::workflow + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader kyb_passed_timestamp: String? + + def kyb_passed_timestamp=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + beneficial_owner_entities: ::Array[Lithic::Models::KYB::BeneficialOwnerEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::KYB::BeneficialOwnerIndividual], + business_entity: Lithic::Models::KYB::BusinessEntity, + control_person: Lithic::Models::KYB::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::KYB::workflow, + ?external_id: String, + ?kyb_passed_timestamp: String, + ?website_url: String + ) -> void + + def to_hash: -> Lithic::Models::kyb + + type beneficial_owner_entity = + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String + } + + class BeneficialOwnerEntity < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?dba_business_name: String, + ?parent_company: String + ) -> void + + def to_hash: -> Lithic::Models::KYB::beneficial_owner_entity + end + + type beneficial_owner_individual = + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::KYB::beneficial_owner_individual + end + + type business_entity = + { + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String + } + + class BusinessEntity < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?dba_business_name: String, + ?parent_company: String + ) -> void + + def to_hash: -> Lithic::Models::KYB::business_entity + end + + type control_person = + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::KYB::control_person + end + + type workflow = :KYB_BASIC | :KYB_BYO + + module Workflow + extend Lithic::Enum + + KYB_BASIC: :KYB_BASIC + KYB_BYO: :KYB_BYO + + def self?.values: -> ::Array[Lithic::Models::KYB::workflow] + end + end + end +end diff --git a/sig/lithic/models/kyb_business_entity.rbs b/sig/lithic/models/kyb_business_entity.rbs new file mode 100644 index 00000000..d77ffff5 --- /dev/null +++ b/sig/lithic/models/kyb_business_entity.rbs @@ -0,0 +1,79 @@ +module Lithic + module Models + type kyb_business_entity = + { + address: Lithic::Models::KYBBusinessEntity::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String + } + + class KYBBusinessEntity < Lithic::BaseModel + attr_accessor address: Lithic::Models::KYBBusinessEntity::Address + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Models::KYBBusinessEntity::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?dba_business_name: String, + ?parent_company: String + ) -> void + + def to_hash: -> Lithic::Models::kyb_business_entity + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> Lithic::Models::KYBBusinessEntity::address + end + end + end +end diff --git a/sig/lithic/models/kyc.rbs b/sig/lithic/models/kyc.rbs new file mode 100644 index 00000000..147dbaf9 --- /dev/null +++ b/sig/lithic/models/kyc.rbs @@ -0,0 +1,88 @@ +module Lithic + module Models + type kyc = + { + individual: Lithic::Models::KYC::Individual, + tos_timestamp: String, + workflow: Lithic::Models::KYC::workflow, + external_id: String, + kyc_passed_timestamp: String + } + + class KYC < Lithic::BaseModel + attr_accessor individual: Lithic::Models::KYC::Individual + + attr_accessor tos_timestamp: String + + attr_accessor workflow: Lithic::Models::KYC::workflow + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader kyc_passed_timestamp: String? + + def kyc_passed_timestamp=: (String) -> String + + def initialize: ( + individual: Lithic::Models::KYC::Individual, + tos_timestamp: String, + workflow: Lithic::Models::KYC::workflow, + ?external_id: String, + ?kyc_passed_timestamp: String + ) -> void + + def to_hash: -> Lithic::Models::kyc + + type individual = + { + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Models::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::KYC::individual + end + + type workflow = :KYC_BASIC | :KYC_BYO + + module Workflow + extend Lithic::Enum + + KYC_BASIC: :KYC_BASIC + KYC_BYO: :KYC_BYO + + def self?.values: -> ::Array[Lithic::Models::KYC::workflow] + end + end + end +end diff --git a/sig/lithic/models/kyc_exempt.rbs b/sig/lithic/models/kyc_exempt.rbs new file mode 100644 index 00000000..fb2312f4 --- /dev/null +++ b/sig/lithic/models/kyc_exempt.rbs @@ -0,0 +1,75 @@ +module Lithic + module Models + type kyc_exempt = + { + address: Lithic::Models::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::KYCExempt::kyc_exemption_type, + last_name: String, + phone_number: String, + workflow: Lithic::Models::KYCExempt::workflow, + business_account_token: String, + external_id: String + } + + class KYCExempt < Lithic::BaseModel + attr_accessor address: Lithic::Models::Address + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor kyc_exemption_type: Lithic::Models::KYCExempt::kyc_exemption_type + + attr_accessor last_name: String + + attr_accessor phone_number: String + + attr_accessor workflow: Lithic::Models::KYCExempt::workflow + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + def initialize: ( + address: Lithic::Models::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::KYCExempt::kyc_exemption_type, + last_name: String, + phone_number: String, + workflow: Lithic::Models::KYCExempt::workflow, + ?business_account_token: String, + ?external_id: String + ) -> void + + def to_hash: -> Lithic::Models::kyc_exempt + + type kyc_exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module KYCExemptionType + extend Lithic::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::KYCExempt::kyc_exemption_type] + end + + type workflow = :KYC_EXEMPT + + module Workflow + extend Lithic::Enum + + KYC_EXEMPT: :KYC_EXEMPT + + def self?.values: -> ::Array[Lithic::Models::KYCExempt::workflow] + end + end + end +end diff --git a/sig/lithic/models/management_operation_create_params.rbs b/sig/lithic/models/management_operation_create_params.rbs new file mode 100644 index 00000000..14b8ac7e --- /dev/null +++ b/sig/lithic/models/management_operation_create_params.rbs @@ -0,0 +1,134 @@ +module Lithic + module Models + type management_operation_create_params = + { + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::category, + direction: Lithic::Models::ManagementOperationCreateParams::direction, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::event_type, + financial_account_token: String, + token: String, + memo: String, + subtype: String, + user_defined_id: String + } + & Lithic::request_parameters + + class ManagementOperationCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::ManagementOperationCreateParams::category + + attr_accessor direction: Lithic::Models::ManagementOperationCreateParams::direction + + attr_accessor effective_date: Date + + attr_accessor event_type: Lithic::Models::ManagementOperationCreateParams::event_type + + attr_accessor financial_account_token: String + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader subtype: String? + + def subtype=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::category, + direction: Lithic::Models::ManagementOperationCreateParams::direction, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::event_type, + financial_account_token: String, + ?token: String, + ?memo: String, + ?subtype: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::management_operation_create_params + + type category = + :MANAGEMENT_FEE + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_REWARD + | :MANAGEMENT_ADJUSTMENT + + module Category + extend Lithic::Enum + + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationCreateParams::category] + end + + type direction = :CREDIT | :DEBIT + + module Direction + extend Lithic::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationCreateParams::direction] + end + + type event_type = + :CASH_BACK + | :CURRENCY_CONVERSION + | :INTEREST + | :LATE_PAYMENT + | :BILLING_ERROR + | :PROVISIONAL_CREDIT + | :LOSS_WRITE_OFF + | :CASH_BACK_REVERSAL + | :CURRENCY_CONVERSION_REVERSAL + | :INTEREST_REVERSAL + | :LATE_PAYMENT_REVERSAL + | :BILLING_ERROR_REVERSAL + | :PROVISIONAL_CREDIT_REVERSAL + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + + module EventType + extend Lithic::Enum + + CASH_BACK: :CASH_BACK + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + INTEREST: :INTEREST + LATE_PAYMENT: :LATE_PAYMENT + BILLING_ERROR: :BILLING_ERROR + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + INTEREST_REVERSAL: :INTEREST_REVERSAL + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationCreateParams::event_type] + end + end + end +end diff --git a/sig/lithic/models/management_operation_list_params.rbs b/sig/lithic/models/management_operation_list_params.rbs new file mode 100644 index 00000000..ec688267 --- /dev/null +++ b/sig/lithic/models/management_operation_list_params.rbs @@ -0,0 +1,108 @@ +module Lithic + module Models + type management_operation_list_params = + { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ManagementOperationListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::ManagementOperationListParams::status + } + & Lithic::request_parameters + + class ManagementOperationListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::ManagementOperationListParams::category? + + def category=: ( + Lithic::Models::ManagementOperationListParams::category + ) -> Lithic::Models::ManagementOperationListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::ManagementOperationListParams::status? + + def status=: ( + Lithic::Models::ManagementOperationListParams::status + ) -> Lithic::Models::ManagementOperationListParams::status + + def initialize: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ManagementOperationListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::ManagementOperationListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::management_operation_list_params + + type category = + :MANAGEMENT_FEE + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_REWARD + | :MANAGEMENT_ADJUSTMENT + + module Category + extend Lithic::Enum + + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationListParams::category] + end + + type status = :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED + + module Status + extend Lithic::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationListParams::status] + end + end + end +end diff --git a/sig/lithic/models/management_operation_retrieve_params.rbs b/sig/lithic/models/management_operation_retrieve_params.rbs new file mode 100644 index 00000000..8909f4ed --- /dev/null +++ b/sig/lithic/models/management_operation_retrieve_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type management_operation_retrieve_params = + { } & Lithic::request_parameters + + class ManagementOperationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::management_operation_retrieve_params + end + end +end diff --git a/sig/lithic/models/management_operation_reverse_params.rbs b/sig/lithic/models/management_operation_reverse_params.rbs new file mode 100644 index 00000000..e17f56fc --- /dev/null +++ b/sig/lithic/models/management_operation_reverse_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + type management_operation_reverse_params = + { effective_date: Date, memo: String } & Lithic::request_parameters + + class ManagementOperationReverseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::management_operation_reverse_params + end + end +end diff --git a/sig/lithic/models/management_operation_transaction.rbs b/sig/lithic/models/management_operation_transaction.rbs new file mode 100644 index 00000000..25cb49b2 --- /dev/null +++ b/sig/lithic/models/management_operation_transaction.rbs @@ -0,0 +1,230 @@ +module Lithic + module Models + type management_operation_transaction = + { + token: String, + category: Lithic::Models::ManagementOperationTransaction::category, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::direction, + events: ::Array[Lithic::Models::ManagementOperationTransaction::Event], + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::result, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::status, + updated: Time, + user_defined_id: String + } + + class ManagementOperationTransaction < Lithic::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::ManagementOperationTransaction::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor direction: Lithic::Models::ManagementOperationTransaction::direction + + attr_accessor events: ::Array[Lithic::Models::ManagementOperationTransaction::Event] + + attr_accessor financial_account_token: String + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::ManagementOperationTransaction::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::ManagementOperationTransaction::status + + attr_accessor updated: Time + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + token: String, + category: Lithic::Models::ManagementOperationTransaction::category, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::direction, + events: ::Array[Lithic::Models::ManagementOperationTransaction::Event], + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::result, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::status, + updated: Time, + ?user_defined_id: String + ) -> void + + def to_hash: -> Lithic::Models::management_operation_transaction + + type category = + :MANAGEMENT_FEE + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_REWARD + | :MANAGEMENT_ADJUSTMENT + + module Category + extend Lithic::Enum + + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::category] + end + + type direction = :CREDIT | :DEBIT + + module Direction + extend Lithic::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::direction] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ManagementOperationTransaction::Event::result, + type: Lithic::Models::ManagementOperationTransaction::Event::type_, + subtype: String + } + + class Event < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result] + + attr_accessor effective_date: Date + + attr_accessor memo: String + + attr_accessor result: Lithic::Models::ManagementOperationTransaction::Event::result + + attr_accessor type: Lithic::Models::ManagementOperationTransaction::Event::type_ + + attr_reader subtype: String? + + def subtype=: (String) -> String + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ManagementOperationTransaction::Event::result, + type: Lithic::Models::ManagementOperationTransaction::Event::type_, + ?subtype: String + ) -> void + + def to_hash: -> Lithic::Models::ManagementOperationTransaction::event + + type detailed_result = :APPROVED + + module DetailedResult + extend Lithic::Enum + + APPROVED: :APPROVED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::Event::result] + end + + type type_ = + :CASH_BACK + | :CURRENCY_CONVERSION + | :INTEREST + | :LATE_PAYMENT + | :BILLING_ERROR + | :PROVISIONAL_CREDIT + | :LOSS_WRITE_OFF + | :CASH_BACK_REVERSAL + | :CURRENCY_CONVERSION_REVERSAL + | :INTEREST_REVERSAL + | :LATE_PAYMENT_REVERSAL + | :BILLING_ERROR_REVERSAL + | :PROVISIONAL_CREDIT_REVERSAL + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + + module Type + extend Lithic::Enum + + CASH_BACK: :CASH_BACK + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + INTEREST: :INTEREST + LATE_PAYMENT: :LATE_PAYMENT + BILLING_ERROR: :BILLING_ERROR + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + INTEREST_REVERSAL: :INTEREST_REVERSAL + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::Event::type_] + end + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::result] + end + + type status = :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED + + module Status + extend Lithic::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::status] + end + end + end +end diff --git a/sig/lithic/models/message_attempt.rbs b/sig/lithic/models/message_attempt.rbs new file mode 100644 index 00000000..eb7abe69 --- /dev/null +++ b/sig/lithic/models/message_attempt.rbs @@ -0,0 +1,59 @@ +module Lithic + module Models + type message_attempt = + { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::status, + url: String + } + + class MessageAttempt < Lithic::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor event_subscription_token: String + + attr_accessor event_token: String + + attr_accessor response: String + + attr_accessor response_status_code: Integer + + attr_accessor status: Lithic::Models::MessageAttempt::status + + attr_accessor url: String + + def initialize: ( + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::status, + url: String + ) -> void + + def to_hash: -> Lithic::Models::message_attempt + + type status = :FAILED | :PENDING | :SENDING | :SUCCESS + + module Status + extend Lithic::Enum + + FAILED: :FAILED + PENDING: :PENDING + SENDING: :SENDING + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::MessageAttempt::status] + end + end + end +end diff --git a/sig/lithic/models/owner_type.rbs b/sig/lithic/models/owner_type.rbs new file mode 100644 index 00000000..4ce6be68 --- /dev/null +++ b/sig/lithic/models/owner_type.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type owner_type = :INDIVIDUAL | :BUSINESS + + module OwnerType + extend Lithic::Enum + + INDIVIDUAL: :INDIVIDUAL + BUSINESS: :BUSINESS + + def self?.values: -> ::Array[Lithic::Models::owner_type] + end + end +end diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs new file mode 100644 index 00000000..6a575d72 --- /dev/null +++ b/sig/lithic/models/payment.rbs @@ -0,0 +1,302 @@ +module Lithic + module Models + type payment = + { + token: String, + category: Lithic::Models::Payment::category, + created: Time, + currency: String, + descriptor: String, + direction: Lithic::Models::Payment::direction, + events: ::Array[Lithic::Models::Payment::Event], + external_bank_account_token: String?, + financial_account_token: String, + method_: Lithic::Models::Payment::method_, + method_attributes: Lithic::Models::Payment::MethodAttributes, + pending_amount: Integer, + result: Lithic::Models::Payment::result, + settled_amount: Integer, + source: Lithic::Models::Payment::source, + status: Lithic::Models::Payment::status, + updated: Time, + user_defined_id: String? + } + + class Payment < Lithic::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::Payment::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor descriptor: String + + attr_accessor direction: Lithic::Models::Payment::direction + + attr_accessor events: ::Array[Lithic::Models::Payment::Event] + + attr_accessor external_bank_account_token: String? + + attr_accessor financial_account_token: String + + attr_accessor method_: Lithic::Models::Payment::method_ + + attr_accessor method_attributes: Lithic::Models::Payment::MethodAttributes + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::Payment::result + + attr_accessor settled_amount: Integer + + attr_accessor source: Lithic::Models::Payment::source + + attr_accessor status: Lithic::Models::Payment::status + + attr_accessor updated: Time + + attr_accessor user_defined_id: String? + + def initialize: ( + token: String, + category: Lithic::Models::Payment::category, + created: Time, + currency: String, + descriptor: String, + direction: Lithic::Models::Payment::direction, + events: ::Array[Lithic::Models::Payment::Event], + external_bank_account_token: String?, + financial_account_token: String, + method_: Lithic::Models::Payment::method_, + method_attributes: Lithic::Models::Payment::MethodAttributes, + pending_amount: Integer, + result: Lithic::Models::Payment::result, + settled_amount: Integer, + source: Lithic::Models::Payment::source, + status: Lithic::Models::Payment::status, + updated: Time, + user_defined_id: String? + ) -> void + + def to_hash: -> Lithic::Models::payment + + type category = :ACH + + module Category + extend Lithic::Enum + + ACH: :ACH + + def self?.values: -> ::Array[Lithic::Models::Payment::category] + end + + type direction = :CREDIT | :DEBIT + + module Direction + extend Lithic::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::Payment::direction] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Payment::Event::result, + type: Lithic::Models::Payment::Event::type_, + detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result] + } + + class Event < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor result: Lithic::Models::Payment::Event::result + + attr_accessor type: Lithic::Models::Payment::Event::type_ + + attr_reader detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result]? + + def detailed_results=: ( + ::Array[Lithic::Models::Payment::Event::detailed_result] + ) -> ::Array[Lithic::Models::Payment::Event::detailed_result] + + def initialize: ( + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Payment::Event::result, + type: Lithic::Models::Payment::Event::type_, + ?detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result] + ) -> void + + def to_hash: -> Lithic::Models::Payment::event + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Payment::Event::result] + end + + type type_ = + :ACH_ORIGINATION_CANCELLED + | :ACH_ORIGINATION_INITIATED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_SETTLED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_REVIEWED + | :ACH_RECEIPT_PROCESSED + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_SETTLED + + module Type + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED: :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED: :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + + def self?.values: -> ::Array[Lithic::Models::Payment::Event::type_] + end + + type detailed_result = + :APPROVED + | :FUNDS_INSUFFICIENT + | :ACCOUNT_INVALID + | :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + | :PROGRAM_DAILY_LIMIT_EXCEEDED + | :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + module DetailedResult + extend Lithic::Enum + + APPROVED: :APPROVED + FUNDS_INSUFFICIENT: :FUNDS_INSUFFICIENT + ACCOUNT_INVALID: :ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMIT_EXCEEDED: :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED: :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED: :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + def self?.values: -> ::Array[Lithic::Models::Payment::Event::detailed_result] + end + end + + type method_ = :ACH_NEXT_DAY | :ACH_SAME_DAY + + module Method + extend Lithic::Enum + + ACH_NEXT_DAY: :ACH_NEXT_DAY + ACH_SAME_DAY: :ACH_SAME_DAY + + def self?.values: -> ::Array[Lithic::Models::Payment::method_] + end + + type method_attributes = + { + company_id: String?, + receipt_routing_number: String?, + retries: Integer?, + return_reason_code: String?, + sec_code: Lithic::Models::Payment::MethodAttributes::sec_code, + trace_numbers: ::Array[String?] + } + + class MethodAttributes < Lithic::BaseModel + attr_accessor company_id: String? + + attr_accessor receipt_routing_number: String? + + attr_accessor retries: Integer? + + attr_accessor return_reason_code: String? + + attr_accessor sec_code: Lithic::Models::Payment::MethodAttributes::sec_code + + attr_accessor trace_numbers: ::Array[String?] + + def initialize: ( + company_id: String?, + receipt_routing_number: String?, + retries: Integer?, + return_reason_code: String?, + sec_code: Lithic::Models::Payment::MethodAttributes::sec_code, + trace_numbers: ::Array[String?] + ) -> void + + def to_hash: -> Lithic::Models::Payment::method_attributes + + type sec_code = :CCD | :PPD | :WEB + + module SecCode + extend Lithic::Enum + + CCD: :CCD + PPD: :PPD + WEB: :WEB + + def self?.values: -> ::Array[Lithic::Models::Payment::MethodAttributes::sec_code] + end + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Payment::result] + end + + type source = :CUSTOMER | :LITHIC + + module Source + extend Lithic::Enum + + CUSTOMER: :CUSTOMER + LITHIC: :LITHIC + + def self?.values: -> ::Array[Lithic::Models::Payment::source] + end + + type status = :DECLINED | :PENDING | :RETURNED | :SETTLED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + + def self?.values: -> ::Array[Lithic::Models::Payment::status] + end + end + end +end diff --git a/sig/lithic/models/payment_create_params.rbs b/sig/lithic/models/payment_create_params.rbs new file mode 100644 index 00000000..8eb97fc2 --- /dev/null +++ b/sig/lithic/models/payment_create_params.rbs @@ -0,0 +1,110 @@ +module Lithic + module Models + type payment_create_params = + { + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::method_, + method_attributes: Lithic::Models::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::type_, + token: String, + memo: String, + user_defined_id: String + } + & Lithic::request_parameters + + class PaymentCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor external_bank_account_token: String + + attr_accessor financial_account_token: String + + attr_accessor method_: Lithic::Models::PaymentCreateParams::method_ + + attr_accessor method_attributes: Lithic::Models::PaymentCreateParams::MethodAttributes + + attr_accessor type: Lithic::Models::PaymentCreateParams::type_ + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::method_, + method_attributes: Lithic::Models::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::type_, + ?token: String, + ?memo: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::payment_create_params + + type method_ = :ACH_NEXT_DAY | :ACH_SAME_DAY + + module Method + extend Lithic::Enum + + ACH_NEXT_DAY: :ACH_NEXT_DAY + ACH_SAME_DAY: :ACH_SAME_DAY + + def self?.values: -> ::Array[Lithic::Models::PaymentCreateParams::method_] + end + + type method_attributes = + { + sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code + } + + class MethodAttributes < Lithic::BaseModel + attr_accessor sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code + + def initialize: ( + sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code + ) -> void + + def to_hash: -> Lithic::Models::PaymentCreateParams::method_attributes + + type sec_code = :CCD | :PPD | :WEB + + module SecCode + extend Lithic::Enum + + CCD: :CCD + PPD: :PPD + WEB: :WEB + + def self?.values: -> ::Array[Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code] + end + end + + type type_ = :COLLECTION | :PAYMENT + + module Type + extend Lithic::Enum + + COLLECTION: :COLLECTION + PAYMENT: :PAYMENT + + def self?.values: -> ::Array[Lithic::Models::PaymentCreateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/payment_create_response.rbs b/sig/lithic/models/payment_create_response.rbs new file mode 100644 index 00000000..06e6e89b --- /dev/null +++ b/sig/lithic/models/payment_create_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type payment_create_response = { balance: Lithic::Models::Balance } + + class PaymentCreateResponse < Lithic::Models::Payment + def balance: -> Lithic::Models::Balance? + + def balance=: (Lithic::Models::Balance _) -> Lithic::Models::Balance + + def initialize: (?balance: Lithic::Models::Balance) -> void + + def to_hash: -> Lithic::Models::payment_create_response + end + end +end diff --git a/sig/lithic/models/payment_list_params.rbs b/sig/lithic/models/payment_list_params.rbs new file mode 100644 index 00000000..60a2d78c --- /dev/null +++ b/sig/lithic/models/payment_list_params.rbs @@ -0,0 +1,125 @@ +module Lithic + module Models + type payment_list_params = + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::PaymentListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::PaymentListParams::result, + starting_after: String, + status: Lithic::Models::PaymentListParams::status + } + & Lithic::request_parameters + + class PaymentListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::PaymentListParams::category? + + def category=: ( + Lithic::Models::PaymentListParams::category + ) -> Lithic::Models::PaymentListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::PaymentListParams::result? + + def result=: ( + Lithic::Models::PaymentListParams::result + ) -> Lithic::Models::PaymentListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::PaymentListParams::status? + + def status=: ( + Lithic::Models::PaymentListParams::status + ) -> Lithic::Models::PaymentListParams::status + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::PaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::PaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::PaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::payment_list_params + + type category = :ACH + + module Category + extend Lithic::Enum + + ACH: :ACH + + def self?.values: -> ::Array[Lithic::Models::PaymentListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentListParams::result] + end + + type status = :DECLINED | :PENDING | :RETURNED | :SETTLED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + + def self?.values: -> ::Array[Lithic::Models::PaymentListParams::status] + end + end + end +end diff --git a/sig/lithic/models/payment_retrieve_params.rbs b/sig/lithic/models/payment_retrieve_params.rbs new file mode 100644 index 00000000..9d3d1d8b --- /dev/null +++ b/sig/lithic/models/payment_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type payment_retrieve_params = { } & Lithic::request_parameters + + class PaymentRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::payment_retrieve_params + end + end +end diff --git a/sig/lithic/models/payment_retry_params.rbs b/sig/lithic/models/payment_retry_params.rbs new file mode 100644 index 00000000..d4f898f1 --- /dev/null +++ b/sig/lithic/models/payment_retry_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type payment_retry_params = { } & Lithic::request_parameters + + class PaymentRetryParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::payment_retry_params + end + end +end diff --git a/sig/lithic/models/payment_retry_response.rbs b/sig/lithic/models/payment_retry_response.rbs new file mode 100644 index 00000000..f3c98579 --- /dev/null +++ b/sig/lithic/models/payment_retry_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type payment_retry_response = { balance: Lithic::Models::Balance } + + class PaymentRetryResponse < Lithic::Models::Payment + def balance: -> Lithic::Models::Balance? + + def balance=: (Lithic::Models::Balance _) -> Lithic::Models::Balance + + def initialize: (?balance: Lithic::Models::Balance) -> void + + def to_hash: -> Lithic::Models::payment_retry_response + end + end +end diff --git a/sig/lithic/models/payment_simulate_action_params.rbs b/sig/lithic/models/payment_simulate_action_params.rbs new file mode 100644 index 00000000..656e3327 --- /dev/null +++ b/sig/lithic/models/payment_simulate_action_params.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + type payment_simulate_action_params = + { + event_type: Lithic::Models::PaymentSimulateActionParams::event_type, + decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason, + return_reason_code: String + } + & Lithic::request_parameters + + class PaymentSimulateActionParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor event_type: Lithic::Models::PaymentSimulateActionParams::event_type + + attr_reader decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason? + + def decline_reason=: ( + Lithic::Models::PaymentSimulateActionParams::decline_reason + ) -> Lithic::Models::PaymentSimulateActionParams::decline_reason + + attr_reader return_reason_code: String? + + def return_reason_code=: (String) -> String + + def initialize: ( + event_type: Lithic::Models::PaymentSimulateActionParams::event_type, + ?decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_action_params + + type event_type = + :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_SETTLED + + module EventType + extend Lithic::Enum + + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateActionParams::event_type] + end + + type decline_reason = + :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + | :PROGRAM_DAILY_LIMIT_EXCEEDED + | :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + module DeclineReason + extend Lithic::Enum + + PROGRAM_TRANSACTION_LIMIT_EXCEEDED: :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED: :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED: :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateActionParams::decline_reason] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_action_response.rbs b/sig/lithic/models/payment_simulate_action_response.rbs new file mode 100644 index 00000000..46b3a1c4 --- /dev/null +++ b/sig/lithic/models/payment_simulate_action_response.rbs @@ -0,0 +1,37 @@ +module Lithic + module Models + type payment_simulate_action_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::result, + transaction_event_token: String + } + + class PaymentSimulateActionResponse < Lithic::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateActionResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_action_response + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateActionResponse::result] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_receipt_params.rbs b/sig/lithic/models/payment_simulate_receipt_params.rbs new file mode 100644 index 00000000..76e4ca63 --- /dev/null +++ b/sig/lithic/models/payment_simulate_receipt_params.rbs @@ -0,0 +1,52 @@ +module Lithic + module Models + type payment_simulate_receipt_params = + { + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type, + memo: String + } + & Lithic::request_parameters + + class PaymentSimulateReceiptParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor financial_account_token: String + + attr_accessor receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_receipt_params + + type receipt_type = :RECEIPT_CREDIT | :RECEIPT_DEBIT + + module ReceiptType + extend Lithic::Enum + + RECEIPT_CREDIT: :RECEIPT_CREDIT + RECEIPT_DEBIT: :RECEIPT_DEBIT + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReceiptParams::receipt_type] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_receipt_response.rbs b/sig/lithic/models/payment_simulate_receipt_response.rbs new file mode 100644 index 00000000..04275ec3 --- /dev/null +++ b/sig/lithic/models/payment_simulate_receipt_response.rbs @@ -0,0 +1,37 @@ +module Lithic + module Models + type payment_simulate_receipt_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::result, + transaction_event_token: String + } + + class PaymentSimulateReceiptResponse < Lithic::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateReceiptResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_receipt_response + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReceiptResponse::result] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_release_params.rbs b/sig/lithic/models/payment_simulate_release_params.rbs new file mode 100644 index 00000000..ce5a1c99 --- /dev/null +++ b/sig/lithic/models/payment_simulate_release_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type payment_simulate_release_params = + { payment_token: String } & Lithic::request_parameters + + class PaymentSimulateReleaseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor payment_token: String + + def initialize: ( + payment_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_release_params + end + end +end diff --git a/sig/lithic/models/payment_simulate_release_response.rbs b/sig/lithic/models/payment_simulate_release_response.rbs new file mode 100644 index 00000000..cad9f971 --- /dev/null +++ b/sig/lithic/models/payment_simulate_release_response.rbs @@ -0,0 +1,37 @@ +module Lithic + module Models + type payment_simulate_release_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::result, + transaction_event_token: String + } + + class PaymentSimulateReleaseResponse < Lithic::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateReleaseResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_release_response + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReleaseResponse::result] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_return_params.rbs b/sig/lithic/models/payment_simulate_return_params.rbs new file mode 100644 index 00000000..072f4eca --- /dev/null +++ b/sig/lithic/models/payment_simulate_return_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + type payment_simulate_return_params = + { payment_token: String, return_reason_code: String } + & Lithic::request_parameters + + class PaymentSimulateReturnParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor payment_token: String + + attr_reader return_reason_code: String? + + def return_reason_code=: (String) -> String + + def initialize: ( + payment_token: String, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_return_params + end + end +end diff --git a/sig/lithic/models/payment_simulate_return_response.rbs b/sig/lithic/models/payment_simulate_return_response.rbs new file mode 100644 index 00000000..45aee3b0 --- /dev/null +++ b/sig/lithic/models/payment_simulate_return_response.rbs @@ -0,0 +1,37 @@ +module Lithic + module Models + type payment_simulate_return_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::result, + transaction_event_token: String + } + + class PaymentSimulateReturnResponse < Lithic::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateReturnResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> Lithic::Models::payment_simulate_return_response + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReturnResponse::result] + end + end + end +end diff --git a/sig/lithic/models/reports/settlement/network_total_list_params.rbs b/sig/lithic/models/reports/settlement/network_total_list_params.rbs new file mode 100644 index 00000000..0646eeca --- /dev/null +++ b/sig/lithic/models/reports/settlement/network_total_list_params.rbs @@ -0,0 +1,104 @@ +module Lithic + module Models + module Reports + module Settlement + type network_total_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String + } + & Lithic::request_parameters + + class NetworkTotalListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader institution_id: String? + + def institution_id=: (String) -> String + + attr_reader network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network? + + def network=: ( + Lithic::Models::Reports::Settlement::NetworkTotalListParams::network + ) -> Lithic::Models::Reports::Settlement::NetworkTotalListParams::network + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader report_date: Date? + + def report_date=: (Date) -> Date + + attr_reader report_date_begin: Date? + + def report_date_begin=: (Date) -> Date + + attr_reader report_date_end: Date? + + def report_date_end=: (Date) -> Date + + attr_reader settlement_institution_id: String? + + def settlement_institution_id=: (String) -> String + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?institution_id: String, + ?network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network, + ?page_size: Integer, + ?report_date: Date, + ?report_date_begin: Date, + ?report_date_end: Date, + ?settlement_institution_id: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Reports::Settlement::network_total_list_params + + type network = :VISA | :MASTERCARD | :MAESTRO | :INTERLINK + + module Network + extend Lithic::Enum + + VISA: :VISA + MASTERCARD: :MASTERCARD + MAESTRO: :MAESTRO + INTERLINK: :INTERLINK + + def self?.values: -> ::Array[Lithic::Models::Reports::Settlement::NetworkTotalListParams::network] + end + end + end + end + end +end diff --git a/sig/lithic/models/reports/settlement/network_total_list_response.rbs b/sig/lithic/models/reports/settlement/network_total_list_response.rbs new file mode 100644 index 00000000..92895969 --- /dev/null +++ b/sig/lithic/models/reports/settlement/network_total_list_response.rbs @@ -0,0 +1,106 @@ +module Lithic + module Models + module Reports + module Settlement + type network_total_list_response = + { + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + } + + class NetworkTotalListResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amounts: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor institution_id: String + + attr_accessor network: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::network + + attr_accessor report_date: Date + + attr_accessor settlement_institution_id: String + + attr_accessor settlement_service: String + + attr_accessor updated: Time + + attr_reader cycle: Integer? + + def cycle=: (Integer) -> Integer + + def initialize: ( + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + ?cycle: Integer + ) -> void + + def to_hash: -> Lithic::Models::Reports::Settlement::network_total_list_response + + type amounts = + { + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + } + + class Amounts < Lithic::BaseModel + attr_accessor gross_settlement: Integer + + attr_accessor interchange_fees: Integer + + attr_accessor net_settlement: Integer + + attr_reader visa_charges: Integer? + + def visa_charges=: (Integer) -> Integer + + def initialize: ( + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + ?visa_charges: Integer + ) -> void + + def to_hash: -> Lithic::Models::Reports::Settlement::NetworkTotalListResponse::amounts + end + + type network = :VISA | :MASTERCARD | :MAESTRO | :INTERLINK + + module Network + extend Lithic::Enum + + VISA: :VISA + MASTERCARD: :MASTERCARD + MAESTRO: :MAESTRO + INTERLINK: :INTERLINK + + def self?.values: -> ::Array[Lithic::Models::Reports::Settlement::NetworkTotalListResponse::network] + end + end + end + end + end +end diff --git a/sig/lithic/models/reports/settlement/network_total_retrieve_params.rbs b/sig/lithic/models/reports/settlement/network_total_retrieve_params.rbs new file mode 100644 index 00000000..10cee271 --- /dev/null +++ b/sig/lithic/models/reports/settlement/network_total_retrieve_params.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + module Reports + module Settlement + type network_total_retrieve_params = { } & Lithic::request_parameters + + class NetworkTotalRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Reports::Settlement::network_total_retrieve_params + end + end + end + end +end diff --git a/sig/lithic/models/reports/settlement/network_total_retrieve_response.rbs b/sig/lithic/models/reports/settlement/network_total_retrieve_response.rbs new file mode 100644 index 00000000..96713ea7 --- /dev/null +++ b/sig/lithic/models/reports/settlement/network_total_retrieve_response.rbs @@ -0,0 +1,106 @@ +module Lithic + module Models + module Reports + module Settlement + type network_total_retrieve_response = + { + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + } + + class NetworkTotalRetrieveResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amounts: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor institution_id: String + + attr_accessor network: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::network + + attr_accessor report_date: Date + + attr_accessor settlement_institution_id: String + + attr_accessor settlement_service: String + + attr_accessor updated: Time + + attr_reader cycle: Integer? + + def cycle=: (Integer) -> Integer + + def initialize: ( + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + ?cycle: Integer + ) -> void + + def to_hash: -> Lithic::Models::Reports::Settlement::network_total_retrieve_response + + type amounts = + { + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + } + + class Amounts < Lithic::BaseModel + attr_accessor gross_settlement: Integer + + attr_accessor interchange_fees: Integer + + attr_accessor net_settlement: Integer + + attr_reader visa_charges: Integer? + + def visa_charges=: (Integer) -> Integer + + def initialize: ( + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + ?visa_charges: Integer + ) -> void + + def to_hash: -> Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::amounts + end + + type network = :VISA | :MASTERCARD | :MAESTRO | :INTERLINK + + module Network + extend Lithic::Enum + + VISA: :VISA + MASTERCARD: :MASTERCARD + MAESTRO: :MAESTRO + INTERLINK: :INTERLINK + + def self?.values: -> ::Array[Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::network] + end + end + end + end + end +end diff --git a/sig/lithic/models/reports/settlement_list_details_params.rbs b/sig/lithic/models/reports/settlement_list_details_params.rbs new file mode 100644 index 00000000..391a208f --- /dev/null +++ b/sig/lithic/models/reports/settlement_list_details_params.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + module Reports + type settlement_list_details_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::request_parameters + + class SettlementListDetailsParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::Reports::settlement_list_details_params + end + end + end +end diff --git a/sig/lithic/models/reports/settlement_summary_params.rbs b/sig/lithic/models/reports/settlement_summary_params.rbs new file mode 100644 index 00000000..85988062 --- /dev/null +++ b/sig/lithic/models/reports/settlement_summary_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module Reports + type settlement_summary_params = { } & Lithic::request_parameters + + class SettlementSummaryParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Reports::settlement_summary_params + end + end + end +end diff --git a/sig/lithic/models/required_document.rbs b/sig/lithic/models/required_document.rbs new file mode 100644 index 00000000..4ad66e32 --- /dev/null +++ b/sig/lithic/models/required_document.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + type required_document = + { + entity_token: String, + status_reasons: ::Array[String], + valid_documents: ::Array[String] + } + + class RequiredDocument < Lithic::BaseModel + attr_accessor entity_token: String + + attr_accessor status_reasons: ::Array[String] + + attr_accessor valid_documents: ::Array[String] + + def initialize: ( + entity_token: String, + status_reasons: ::Array[String], + valid_documents: ::Array[String] + ) -> void + + def to_hash: -> Lithic::Models::required_document + end + end +end diff --git a/sig/lithic/models/responder_endpoint_check_status_params.rbs b/sig/lithic/models/responder_endpoint_check_status_params.rbs new file mode 100644 index 00000000..09344676 --- /dev/null +++ b/sig/lithic/models/responder_endpoint_check_status_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + type responder_endpoint_check_status_params = + { type: Lithic::Models::ResponderEndpointCheckStatusParams::type_ } + & Lithic::request_parameters + + class ResponderEndpointCheckStatusParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor type: Lithic::Models::ResponderEndpointCheckStatusParams::type_ + + def initialize: ( + type: Lithic::Models::ResponderEndpointCheckStatusParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::responder_endpoint_check_status_params + + type type_ = + :AUTH_STREAM_ACCESS | :THREE_DS_DECISIONING | :TOKENIZATION_DECISIONING + + module Type + extend Lithic::Enum + + AUTH_STREAM_ACCESS: :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING: :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + + def self?.values: -> ::Array[Lithic::Models::ResponderEndpointCheckStatusParams::type_] + end + end + end +end diff --git a/sig/lithic/models/responder_endpoint_create_params.rbs b/sig/lithic/models/responder_endpoint_create_params.rbs new file mode 100644 index 00000000..68451217 --- /dev/null +++ b/sig/lithic/models/responder_endpoint_create_params.rbs @@ -0,0 +1,46 @@ +module Lithic + module Models + type responder_endpoint_create_params = + { + type: Lithic::Models::ResponderEndpointCreateParams::type_, + url: String + } + & Lithic::request_parameters + + class ResponderEndpointCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader type: Lithic::Models::ResponderEndpointCreateParams::type_? + + def type=: ( + Lithic::Models::ResponderEndpointCreateParams::type_ + ) -> Lithic::Models::ResponderEndpointCreateParams::type_ + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?type: Lithic::Models::ResponderEndpointCreateParams::type_, + ?url: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::responder_endpoint_create_params + + type type_ = + :AUTH_STREAM_ACCESS | :THREE_DS_DECISIONING | :TOKENIZATION_DECISIONING + + module Type + extend Lithic::Enum + + AUTH_STREAM_ACCESS: :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING: :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + + def self?.values: -> ::Array[Lithic::Models::ResponderEndpointCreateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/responder_endpoint_create_response.rbs b/sig/lithic/models/responder_endpoint_create_response.rbs new file mode 100644 index 00000000..a273e7e0 --- /dev/null +++ b/sig/lithic/models/responder_endpoint_create_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type responder_endpoint_create_response = { enrolled: bool } + + class ResponderEndpointCreateResponse < Lithic::BaseModel + attr_reader enrolled: bool? + + def enrolled=: (bool) -> bool + + def initialize: (?enrolled: bool) -> void + + def to_hash: -> Lithic::Models::responder_endpoint_create_response + end + end +end diff --git a/sig/lithic/models/responder_endpoint_delete_params.rbs b/sig/lithic/models/responder_endpoint_delete_params.rbs new file mode 100644 index 00000000..56e502aa --- /dev/null +++ b/sig/lithic/models/responder_endpoint_delete_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + type responder_endpoint_delete_params = + { type: Lithic::Models::ResponderEndpointDeleteParams::type_ } + & Lithic::request_parameters + + class ResponderEndpointDeleteParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor type: Lithic::Models::ResponderEndpointDeleteParams::type_ + + def initialize: ( + type: Lithic::Models::ResponderEndpointDeleteParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::responder_endpoint_delete_params + + type type_ = + :AUTH_STREAM_ACCESS | :THREE_DS_DECISIONING | :TOKENIZATION_DECISIONING + + module Type + extend Lithic::Enum + + AUTH_STREAM_ACCESS: :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING: :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + + def self?.values: -> ::Array[Lithic::Models::ResponderEndpointDeleteParams::type_] + end + end + end +end diff --git a/sig/lithic/models/responder_endpoint_status.rbs b/sig/lithic/models/responder_endpoint_status.rbs new file mode 100644 index 00000000..52e3289a --- /dev/null +++ b/sig/lithic/models/responder_endpoint_status.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + type responder_endpoint_status = { enrolled: bool, url: String? } + + class ResponderEndpointStatus < Lithic::BaseModel + attr_reader enrolled: bool? + + def enrolled=: (bool) -> bool + + attr_accessor url: String? + + def initialize: (?enrolled: bool, ?url: String?) -> void + + def to_hash: -> Lithic::Models::responder_endpoint_status + end + end +end diff --git a/sig/lithic/models/settlement_detail.rbs b/sig/lithic/models/settlement_detail.rbs new file mode 100644 index 00000000..a3071699 --- /dev/null +++ b/sig/lithic/models/settlement_detail.rbs @@ -0,0 +1,153 @@ +module Lithic + module Models + type settlement_detail = + { + token: String, + account_token: String, + card_program_token: String, + card_token: String, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: ::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::network, + other_fees_details: Lithic::Models::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::type_, + updated: Time, + fee_description: String + } + + class SettlementDetail < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor card_program_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor disputes_gross_amount: Integer + + attr_accessor event_tokens: ::Array[String] + + attr_accessor institution: String + + attr_accessor interchange_fee_extended_precision: Integer + + attr_accessor interchange_gross_amount: Integer + + attr_accessor network: Lithic::Models::SettlementDetail::network + + attr_accessor other_fees_details: Lithic::Models::SettlementDetail::OtherFeesDetails + + attr_accessor other_fees_gross_amount: Integer + + attr_accessor report_date: String + + attr_accessor settlement_date: String + + attr_accessor transaction_token: String + + attr_accessor transactions_gross_amount: Integer + + attr_accessor type: Lithic::Models::SettlementDetail::type_ + + attr_accessor updated: Time + + attr_reader fee_description: String? + + def fee_description=: (String) -> String + + def initialize: ( + token: String, + account_token: String, + card_program_token: String, + card_token: String, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: ::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::network, + other_fees_details: Lithic::Models::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::type_, + updated: Time, + ?fee_description: String + ) -> void + + def to_hash: -> Lithic::Models::settlement_detail + + type network = :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Enum + + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::SettlementDetail::network] + end + + type other_fees_details = { isa: Integer } + + class OtherFeesDetails < Lithic::BaseModel + attr_reader isa: Integer? + + def isa=: (Integer) -> Integer + + def initialize: (?isa: Integer) -> void + + def to_hash: -> Lithic::Models::SettlementDetail::other_fees_details + end + + type type_ = + :ADJUSTMENT + | :ARBITRATION + | :CHARGEBACK + | :CLEARING + | :FEE + | :FINANCIAL + | :"NON-FINANCIAL" + | :PREARBITRATION + | :REPRESENTMENT + + module Type + extend Lithic::Enum + + ADJUSTMENT: :ADJUSTMENT + ARBITRATION: :ARBITRATION + CHARGEBACK: :CHARGEBACK + CLEARING: :CLEARING + FEE: :FEE + FINANCIAL: :FINANCIAL + NON_FINANCIAL: :"NON-FINANCIAL" + PREARBITRATION: :PREARBITRATION + REPRESENTMENT: :REPRESENTMENT + + def self?.values: -> ::Array[Lithic::Models::SettlementDetail::type_] + end + end + end +end diff --git a/sig/lithic/models/settlement_report.rbs b/sig/lithic/models/settlement_report.rbs new file mode 100644 index 00000000..e184c57e --- /dev/null +++ b/sig/lithic/models/settlement_report.rbs @@ -0,0 +1,58 @@ +module Lithic + module Models + type settlement_report = + { + created: Time, + currency: String, + details: ::Array[Lithic::Models::SettlementSummaryDetails], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: bool, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + } + + class SettlementReport < Lithic::BaseModel + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor details: ::Array[Lithic::Models::SettlementSummaryDetails] + + attr_accessor disputes_gross_amount: Integer + + attr_accessor interchange_gross_amount: Integer + + attr_accessor is_complete: bool + + attr_accessor other_fees_gross_amount: Integer + + attr_accessor report_date: String + + attr_accessor settled_net_amount: Integer + + attr_accessor transactions_gross_amount: Integer + + attr_accessor updated: Time + + def initialize: ( + created: Time, + currency: String, + details: ::Array[Lithic::Models::SettlementSummaryDetails], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: bool, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + ) -> void + + def to_hash: -> Lithic::Models::settlement_report + end + end +end diff --git a/sig/lithic/models/settlement_summary_details.rbs b/sig/lithic/models/settlement_summary_details.rbs new file mode 100644 index 00000000..39e5dfbf --- /dev/null +++ b/sig/lithic/models/settlement_summary_details.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type settlement_summary_details = + { + currency: String, + disputes_gross_amount: Integer, + institution: String, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementSummaryDetails::network, + other_fees_gross_amount: Integer, + settled_net_amount: Integer, + transactions_gross_amount: Integer + } + + class SettlementSummaryDetails < Lithic::BaseModel + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader disputes_gross_amount: Integer? + + def disputes_gross_amount=: (Integer) -> Integer + + attr_reader institution: String? + + def institution=: (String) -> String + + attr_reader interchange_gross_amount: Integer? + + def interchange_gross_amount=: (Integer) -> Integer + + attr_reader network: Lithic::Models::SettlementSummaryDetails::network? + + def network=: ( + Lithic::Models::SettlementSummaryDetails::network + ) -> Lithic::Models::SettlementSummaryDetails::network + + attr_reader other_fees_gross_amount: Integer? + + def other_fees_gross_amount=: (Integer) -> Integer + + attr_reader settled_net_amount: Integer? + + def settled_net_amount=: (Integer) -> Integer + + attr_reader transactions_gross_amount: Integer? + + def transactions_gross_amount=: (Integer) -> Integer + + def initialize: ( + ?currency: String, + ?disputes_gross_amount: Integer, + ?institution: String, + ?interchange_gross_amount: Integer, + ?network: Lithic::Models::SettlementSummaryDetails::network, + ?other_fees_gross_amount: Integer, + ?settled_net_amount: Integer, + ?transactions_gross_amount: Integer + ) -> void + + def to_hash: -> Lithic::Models::settlement_summary_details + + type network = :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Enum + + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::SettlementSummaryDetails::network] + end + end + end +end diff --git a/sig/lithic/models/shipping_address.rbs b/sig/lithic/models/shipping_address.rbs new file mode 100644 index 00000000..f14a57d4 --- /dev/null +++ b/sig/lithic/models/shipping_address.rbs @@ -0,0 +1,66 @@ +module Lithic + module Models + type shipping_address = + { + :address1 => String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + :address2 => String, + email: String, + :line2_text => String, + phone_number: String + } + + class ShippingAddress < Lithic::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader line2_text: String? + + def line2_text=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + ?address2: String, + ?email: String, + ?line2_text: String, + ?phone_number: String + ) -> void + + def to_hash: -> Lithic::Models::shipping_address + end + end +end diff --git a/sig/lithic/models/spend_limit_duration.rbs b/sig/lithic/models/spend_limit_duration.rbs new file mode 100644 index 00000000..7977576f --- /dev/null +++ b/sig/lithic/models/spend_limit_duration.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type spend_limit_duration = :ANNUALLY | :FOREVER | :MONTHLY | :TRANSACTION + + module SpendLimitDuration + extend Lithic::Enum + + ANNUALLY: :ANNUALLY + FOREVER: :FOREVER + MONTHLY: :MONTHLY + TRANSACTION: :TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::spend_limit_duration] + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_retrieve_params.rbs b/sig/lithic/models/three_ds/authentication_retrieve_params.rbs new file mode 100644 index 00000000..1c3b3d4a --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_retrieve_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module ThreeDS + type authentication_retrieve_params = { } & Lithic::request_parameters + + class AuthenticationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::ThreeDS::authentication_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_retrieve_response.rbs b/sig/lithic/models/three_ds/authentication_retrieve_response.rbs new file mode 100644 index 00000000..160edf77 --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_retrieve_response.rbs @@ -0,0 +1,715 @@ +module Lithic + module Models + module ThreeDS + type authentication_retrieve_response = + { + token: String, + account_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::account_type?, + authentication_result: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_result, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::card_expiry_check, + card_token: String, + cardholder: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder, + channel: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::channel, + created: Time, + merchant: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant, + message_category: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::message_category, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ds_requestor_challenge_indicator, + additional_data: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData?, + app: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App, + authentication_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_request_type?, + browser: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser, + challenge_metadata: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata?, + challenge_orchestrated_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::challenge_orchestrated_by?, + decision_made_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::decision_made_by?, + three_ri_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ri_request_type?, + transaction: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction? + } + + class AuthenticationRetrieveResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::account_type? + + attr_accessor authentication_result: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_result + + attr_accessor card_expiry_check: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::card_expiry_check + + attr_accessor card_token: String + + attr_accessor cardholder: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder + + attr_accessor channel: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::channel + + attr_accessor created: Time + + attr_accessor merchant: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant + + attr_accessor message_category: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::message_category + + attr_accessor three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ds_requestor_challenge_indicator + + attr_accessor additional_data: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData? + + attr_reader app: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App? + + def app=: ( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App + ) -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App + + attr_accessor authentication_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_request_type? + + attr_reader browser: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser? + + def browser=: ( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser + ) -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser + + attr_accessor challenge_metadata: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata? + + attr_accessor challenge_orchestrated_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::challenge_orchestrated_by? + + attr_accessor decision_made_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::decision_made_by? + + attr_accessor three_ri_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ri_request_type? + + attr_accessor transaction: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction? + + def initialize: ( + token: String, + account_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::account_type?, + authentication_result: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_result, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::card_expiry_check, + card_token: String, + cardholder: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder, + channel: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::channel, + created: Time, + merchant: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant, + message_category: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::message_category, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ds_requestor_challenge_indicator, + ?additional_data: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData?, + ?app: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App, + ?authentication_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_request_type?, + ?browser: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser, + ?challenge_metadata: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata?, + ?challenge_orchestrated_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::challenge_orchestrated_by?, + ?decision_made_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::decision_made_by?, + ?three_ri_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ri_request_type?, + ?transaction: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::authentication_retrieve_response + + type account_type = :CREDIT | :DEBIT | :NOT_APPLICABLE + + module AccountType + extend Lithic::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + NOT_APPLICABLE: :NOT_APPLICABLE + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::account_type] + end + + type authentication_result = + :DECLINE | :SUCCESS | :PENDING_CHALLENGE | :PENDING_DECISION + + module AuthenticationResult + extend Lithic::Enum + + DECLINE: :DECLINE + SUCCESS: :SUCCESS + PENDING_CHALLENGE: :PENDING_CHALLENGE + PENDING_DECISION: :PENDING_DECISION + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_result] + end + + type card_expiry_check = :MATCH | :MISMATCH | :NOT_PRESENT + + module CardExpiryCheck + extend Lithic::Enum + + MATCH: :MATCH + MISMATCH: :MISMATCH + NOT_PRESENT: :NOT_PRESENT + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::card_expiry_check] + end + + type cardholder = + { + address_match: bool?, + billing_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress, + email: String?, + name: String?, + phone_number_home: String?, + phone_number_mobile: String?, + phone_number_work: String?, + shipping_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress + } + + class Cardholder < Lithic::BaseModel + attr_accessor address_match: bool? + + attr_reader billing_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress? + + def billing_address=: ( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress + ) -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress + + attr_accessor email: String? + + attr_accessor name: String? + + attr_accessor phone_number_home: String? + + attr_accessor phone_number_mobile: String? + + attr_accessor phone_number_work: String? + + attr_reader shipping_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress? + + def shipping_address=: ( + Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress + ) -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress + + def initialize: ( + ?address_match: bool?, + ?billing_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::BillingAddress, + ?email: String?, + ?name: String?, + ?phone_number_home: String?, + ?phone_number_mobile: String?, + ?phone_number_work: String?, + ?shipping_address: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::ShippingAddress + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::cardholder + + type billing_address = + { + :address1 => String?, + :address2 => String?, + :address3 => String?, + city: String?, + country: String?, + postal_code: String? + } + + class BillingAddress < Lithic::BaseModel + attr_accessor address1: String? + + attr_accessor address2: String? + + attr_accessor address3: String? + + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + def initialize: ( + ?address1: String?, + ?address2: String?, + ?address3: String?, + ?city: String?, + ?country: String?, + ?postal_code: String? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::billing_address + end + + type shipping_address = + { + :address1 => String?, + :address2 => String?, + :address3 => String?, + city: String?, + country: String?, + postal_code: String? + } + + class ShippingAddress < Lithic::BaseModel + attr_accessor address1: String? + + attr_accessor address2: String? + + attr_accessor address3: String? + + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + def initialize: ( + ?address1: String?, + ?address2: String?, + ?address3: String?, + ?city: String?, + ?country: String?, + ?postal_code: String? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder::shipping_address + end + end + + type channel = :APP_BASED | :BROWSER | :THREE_DS_REQUESTOR_INITIATED + + module Channel + extend Lithic::Enum + + APP_BASED: :APP_BASED + BROWSER: :BROWSER + THREE_DS_REQUESTOR_INITIATED: :THREE_DS_REQUESTOR_INITIATED + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::channel] + end + + type merchant = + { + id: String, + country: String, + mcc: String, + name: String, + risk_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator + } + + class Merchant < Lithic::BaseModel + attr_accessor id: String + + attr_accessor country: String + + attr_accessor mcc: String + + attr_accessor name: String + + attr_accessor risk_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator + + def initialize: ( + id: String, + country: String, + mcc: String, + name: String, + risk_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::merchant + + type risk_indicator = + { + delivery_email_address: String?, + delivery_time_frame: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::delivery_time_frame?, + gift_card_amount: Integer?, + gift_card_count: Integer?, + gift_card_currency: String?, + order_availability: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::order_availability?, + pre_order_available_date: Time?, + reorder_items: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::reorder_items?, + shipping_method: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::shipping_method? + } + + class RiskIndicator < Lithic::BaseModel + attr_accessor delivery_email_address: String? + + attr_accessor delivery_time_frame: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::delivery_time_frame? + + attr_accessor gift_card_amount: Integer? + + attr_accessor gift_card_count: Integer? + + attr_accessor gift_card_currency: String? + + attr_accessor order_availability: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::order_availability? + + attr_accessor pre_order_available_date: Time? + + attr_accessor reorder_items: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::reorder_items? + + attr_accessor shipping_method: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::shipping_method? + + def initialize: ( + ?delivery_email_address: String?, + ?delivery_time_frame: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::delivery_time_frame?, + ?gift_card_amount: Integer?, + ?gift_card_count: Integer?, + ?gift_card_currency: String?, + ?order_availability: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::order_availability?, + ?pre_order_available_date: Time?, + ?reorder_items: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::reorder_items?, + ?shipping_method: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::shipping_method? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::risk_indicator + + type delivery_time_frame = + :ELECTRONIC_DELIVERY + | :OVERNIGHT_SHIPPING + | :SAME_DAY_SHIPPING + | :TWO_DAY_OR_MORE_SHIPPING + + module DeliveryTimeFrame + extend Lithic::Enum + + ELECTRONIC_DELIVERY: :ELECTRONIC_DELIVERY + OVERNIGHT_SHIPPING: :OVERNIGHT_SHIPPING + SAME_DAY_SHIPPING: :SAME_DAY_SHIPPING + TWO_DAY_OR_MORE_SHIPPING: :TWO_DAY_OR_MORE_SHIPPING + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::delivery_time_frame] + end + + type order_availability = + :FUTURE_AVAILABILITY | :MERCHANDISE_AVAILABLE + + module OrderAvailability + extend Lithic::Enum + + FUTURE_AVAILABILITY: :FUTURE_AVAILABILITY + MERCHANDISE_AVAILABLE: :MERCHANDISE_AVAILABLE + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::order_availability] + end + + type reorder_items = :FIRST_TIME_ORDERED | :REORDERED + + module ReorderItems + extend Lithic::Enum + + FIRST_TIME_ORDERED: :FIRST_TIME_ORDERED + REORDERED: :REORDERED + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::reorder_items] + end + + type shipping_method = + :DIGITAL_GOODS + | :LOCKER_DELIVERY + | :OTHER + | :PICK_UP_AND_GO_DELIVERY + | :SHIP_TO_BILLING_ADDRESS + | :SHIP_TO_NON_BILLING_ADDRESS + | :SHIP_TO_OTHER_VERIFIED_ADDRESS + | :SHIP_TO_STORE + | :TRAVEL_AND_EVENT_TICKETS + + module ShippingMethod + extend Lithic::Enum + + DIGITAL_GOODS: :DIGITAL_GOODS + LOCKER_DELIVERY: :LOCKER_DELIVERY + OTHER: :OTHER + PICK_UP_AND_GO_DELIVERY: :PICK_UP_AND_GO_DELIVERY + SHIP_TO_BILLING_ADDRESS: :SHIP_TO_BILLING_ADDRESS + SHIP_TO_NON_BILLING_ADDRESS: :SHIP_TO_NON_BILLING_ADDRESS + SHIP_TO_OTHER_VERIFIED_ADDRESS: :SHIP_TO_OTHER_VERIFIED_ADDRESS + SHIP_TO_STORE: :SHIP_TO_STORE + TRAVEL_AND_EVENT_TICKETS: :TRAVEL_AND_EVENT_TICKETS + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant::RiskIndicator::shipping_method] + end + end + end + + type message_category = + :NON_PAYMENT_AUTHENTICATION | :PAYMENT_AUTHENTICATION + + module MessageCategory + extend Lithic::Enum + + NON_PAYMENT_AUTHENTICATION: :NON_PAYMENT_AUTHENTICATION + PAYMENT_AUTHENTICATION: :PAYMENT_AUTHENTICATION + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::message_category] + end + + type three_ds_requestor_challenge_indicator = + :NO_PREFERENCE + | :NO_CHALLENGE_REQUESTED + | :CHALLENGE_PREFERENCE + | :CHALLENGE_MANDATE + | :NO_CHALLENGE_RISK_ALREADY_ASSESSED + | :DATA_SHARE_ONLY + | :OTHER + + module ThreeDSRequestorChallengeIndicator + extend Lithic::Enum + + NO_PREFERENCE: :NO_PREFERENCE + NO_CHALLENGE_REQUESTED: :NO_CHALLENGE_REQUESTED + CHALLENGE_PREFERENCE: :CHALLENGE_PREFERENCE + CHALLENGE_MANDATE: :CHALLENGE_MANDATE + NO_CHALLENGE_RISK_ALREADY_ASSESSED: :NO_CHALLENGE_RISK_ALREADY_ASSESSED + DATA_SHARE_ONLY: :DATA_SHARE_ONLY + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ds_requestor_challenge_indicator] + end + + type additional_data = + { + network_decision: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::network_decision?, + network_risk_score: Integer? + } + + class AdditionalData < Lithic::BaseModel + attr_accessor network_decision: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::network_decision? + + attr_accessor network_risk_score: Integer? + + def initialize: ( + ?network_decision: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::network_decision?, + ?network_risk_score: Integer? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::additional_data + + type network_decision = :LOW_RISK | :NOT_LOW_RISK + + module NetworkDecision + extend Lithic::Enum + + LOW_RISK: :LOW_RISK + NOT_LOW_RISK: :NOT_LOW_RISK + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData::network_decision] + end + end + + type app = { device_info: String?, ip: String } + + class App < Lithic::BaseModel + attr_accessor device_info: String? + + attr_reader ip: String? + + def ip=: (String) -> String + + def initialize: (?device_info: String?, ?ip: String) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::app + end + + type authentication_request_type = + :ADD_CARD + | :BILLING_AGREEMENT + | :DELAYED_SHIPMENT + | :EMV_TOKEN_CARDHOLDER_VERIFICATION + | :INSTALLMENT_TRANSACTION + | :MAINTAIN_CARD + | :PAYMENT_TRANSACTION + | :RECURRING_TRANSACTION + | :SPLIT_PAYMENT + | :SPLIT_SHIPMENT + + module AuthenticationRequestType + extend Lithic::Enum + + ADD_CARD: :ADD_CARD + BILLING_AGREEMENT: :BILLING_AGREEMENT + DELAYED_SHIPMENT: :DELAYED_SHIPMENT + EMV_TOKEN_CARDHOLDER_VERIFICATION: :EMV_TOKEN_CARDHOLDER_VERIFICATION + INSTALLMENT_TRANSACTION: :INSTALLMENT_TRANSACTION + MAINTAIN_CARD: :MAINTAIN_CARD + PAYMENT_TRANSACTION: :PAYMENT_TRANSACTION + RECURRING_TRANSACTION: :RECURRING_TRANSACTION + SPLIT_PAYMENT: :SPLIT_PAYMENT + SPLIT_SHIPMENT: :SPLIT_SHIPMENT + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::authentication_request_type] + end + + type browser = + { + ip: String?, + java_enabled: bool?, + javascript_enabled: bool?, + language: String?, + time_zone: String?, + user_agent: String? + } + + class Browser < Lithic::BaseModel + attr_accessor ip: String? + + attr_accessor java_enabled: bool? + + attr_accessor javascript_enabled: bool? + + attr_accessor language: String? + + attr_accessor time_zone: String? + + attr_accessor user_agent: String? + + def initialize: ( + ?ip: String?, + ?java_enabled: bool?, + ?javascript_enabled: bool?, + ?language: String?, + ?time_zone: String?, + ?user_agent: String? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::browser + end + + type challenge_metadata = + { + method_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::method_type, + phone_number: String? + } + + class ChallengeMetadata < Lithic::BaseModel + attr_accessor method_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::method_type + + attr_accessor phone_number: String? + + def initialize: ( + method_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::method_type, + ?phone_number: String? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::challenge_metadata + + type method_type = :SMS_OTP | :OUT_OF_BAND + + module MethodType + extend Lithic::Enum + + SMS_OTP: :SMS_OTP + OUT_OF_BAND: :OUT_OF_BAND + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata::method_type] + end + end + + type challenge_orchestrated_by = :LITHIC | :CUSTOMER | :NO_CHALLENGE + + module ChallengeOrchestratedBy + extend Lithic::Enum + + LITHIC: :LITHIC + CUSTOMER: :CUSTOMER + NO_CHALLENGE: :NO_CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::challenge_orchestrated_by] + end + + type decision_made_by = + :CUSTOMER_ENDPOINT + | :LITHIC_DEFAULT + | :LITHIC_RULES + | :NETWORK + | :UNKNOWN + + module DecisionMadeBy + extend Lithic::Enum + + CUSTOMER_ENDPOINT: :CUSTOMER_ENDPOINT + LITHIC_DEFAULT: :LITHIC_DEFAULT + LITHIC_RULES: :LITHIC_RULES + NETWORK: :NETWORK + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::decision_made_by] + end + + type three_ri_request_type = + :ACCOUNT_VERIFICATION + | :ADD_CARD + | :BILLING_AGREEMENT + | :CARD_SECURITY_CODE_STATUS_CHECK + | :DELAYED_SHIPMENT + | :DEVICE_BINDING_STATUS_CHECK + | :INSTALLMENT_TRANSACTION + | :MAIL_ORDER + | :MAINTAIN_CARD_INFO + | :OTHER_PAYMENT + | :RECURRING_TRANSACTION + | :SPLIT_PAYMENT + | :SPLIT_SHIPMENT + | :TELEPHONE_ORDER + | :TOP_UP + | :TRUST_LIST_STATUS_CHECK + + module ThreeRiRequestType + extend Lithic::Enum + + ACCOUNT_VERIFICATION: :ACCOUNT_VERIFICATION + ADD_CARD: :ADD_CARD + BILLING_AGREEMENT: :BILLING_AGREEMENT + CARD_SECURITY_CODE_STATUS_CHECK: :CARD_SECURITY_CODE_STATUS_CHECK + DELAYED_SHIPMENT: :DELAYED_SHIPMENT + DEVICE_BINDING_STATUS_CHECK: :DEVICE_BINDING_STATUS_CHECK + INSTALLMENT_TRANSACTION: :INSTALLMENT_TRANSACTION + MAIL_ORDER: :MAIL_ORDER + MAINTAIN_CARD_INFO: :MAINTAIN_CARD_INFO + OTHER_PAYMENT: :OTHER_PAYMENT + RECURRING_TRANSACTION: :RECURRING_TRANSACTION + SPLIT_PAYMENT: :SPLIT_PAYMENT + SPLIT_SHIPMENT: :SPLIT_SHIPMENT + TELEPHONE_ORDER: :TELEPHONE_ORDER + TOP_UP: :TOP_UP + TRUST_LIST_STATUS_CHECK: :TRUST_LIST_STATUS_CHECK + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::three_ri_request_type] + end + + type transaction = + { + amount: Float, + currency: String, + currency_exponent: Float, + date_time: Time, + type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::type_? + } + + class Transaction < Lithic::BaseModel + attr_accessor amount: Float + + attr_accessor currency: String + + attr_accessor currency_exponent: Float + + attr_accessor date_time: Time + + attr_accessor type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::type_? + + def initialize: ( + amount: Float, + currency: String, + currency_exponent: Float, + date_time: Time, + type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::type_? + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::transaction + + type type_ = + :ACCOUNT_FUNDING + | :CHECK_ACCEPTANCE + | :GOODS_SERVICE_PURCHASE + | :PREPAID_ACTIVATION_AND_LOAD + | :QUASI_CASH_TRANSACTION + + module Type + extend Lithic::Enum + + ACCOUNT_FUNDING: :ACCOUNT_FUNDING + CHECK_ACCEPTANCE: :CHECK_ACCEPTANCE + GOODS_SERVICE_PURCHASE: :GOODS_SERVICE_PURCHASE + PREPAID_ACTIVATION_AND_LOAD: :PREPAID_ACTIVATION_AND_LOAD + QUASI_CASH_TRANSACTION: :QUASI_CASH_TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction::type_] + end + end + end + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbs b/sig/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbs new file mode 100644 index 00000000..9b47e280 --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module ThreeDS + type authentication_simulate_otp_entry_params = + { token: String, otp: String } & Lithic::request_parameters + + class AuthenticationSimulateOtpEntryParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor token: String + + attr_accessor otp: String + + def initialize: ( + token: String, + otp: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::authentication_simulate_otp_entry_params + end + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_simulate_params.rbs b/sig/lithic/models/three_ds/authentication_simulate_params.rbs new file mode 100644 index 00000000..0021deee --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_simulate_params.rbs @@ -0,0 +1,87 @@ +module Lithic + module Models + module ThreeDS + type authentication_simulate_params = + { + merchant: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check + } + & Lithic::request_parameters + + class AuthenticationSimulateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor merchant: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant + + attr_accessor pan: String + + attr_accessor transaction: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction + + attr_reader card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check? + + def card_expiry_check=: ( + Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check + ) -> Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check + + def initialize: ( + merchant: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction, + ?card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::authentication_simulate_params + + type merchant = + { id: String, country: String, mcc: String, name: String } + + class Merchant < Lithic::BaseModel + attr_accessor id: String + + attr_accessor country: String + + attr_accessor mcc: String + + attr_accessor name: String + + def initialize: ( + id: String, + country: String, + mcc: String, + name: String + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationSimulateParams::merchant + end + + type transaction = { amount: Integer, currency: String } + + class Transaction < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> Lithic::Models::ThreeDS::AuthenticationSimulateParams::transaction + end + + type card_expiry_check = :MATCH | :MISMATCH | :NOT_PRESENT + + module CardExpiryCheck + extend Lithic::Enum + + MATCH: :MATCH + MISMATCH: :MISMATCH + NOT_PRESENT: :NOT_PRESENT + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check] + end + end + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_simulate_response.rbs b/sig/lithic/models/three_ds/authentication_simulate_response.rbs new file mode 100644 index 00000000..8a8eb157 --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_simulate_response.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type authentication_simulate_response = { token: String } + + class AuthenticationSimulateResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + def initialize: (?token: String) -> void + + def to_hash: -> Lithic::Models::ThreeDS::authentication_simulate_response + end + end + end +end diff --git a/sig/lithic/models/three_ds/challenge_response.rbs b/sig/lithic/models/three_ds/challenge_response.rbs new file mode 100644 index 00000000..957adb4d --- /dev/null +++ b/sig/lithic/models/three_ds/challenge_response.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + module ThreeDS + type challenge_response = + { + token: String, + challenge_response: Lithic::Models::ThreeDS::challenge_result + } + + class ChallengeResponse < Lithic::BaseModel + attr_accessor token: String + + attr_accessor challenge_response: Lithic::Models::ThreeDS::challenge_result + + def initialize: ( + token: String, + challenge_response: Lithic::Models::ThreeDS::challenge_result + ) -> void + + def to_hash: -> Lithic::Models::ThreeDS::challenge_response + end + end + end +end diff --git a/sig/lithic/models/three_ds/challenge_result.rbs b/sig/lithic/models/three_ds/challenge_result.rbs new file mode 100644 index 00000000..e02bb094 --- /dev/null +++ b/sig/lithic/models/three_ds/challenge_result.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module ThreeDS + type challenge_result = :APPROVE | :DECLINE_BY_CUSTOMER + + module ChallengeResult + extend Lithic::Enum + + APPROVE: :APPROVE + DECLINE_BY_CUSTOMER: :DECLINE_BY_CUSTOMER + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::challenge_result] + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_challenge_response_params.rbs b/sig/lithic/models/three_ds/decisioning_challenge_response_params.rbs new file mode 100644 index 00000000..5711a306 --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_challenge_response_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type decisioning_challenge_response_params = + { } & Lithic::request_parameters + + class DecisioningChallengeResponseParams < Lithic::Models::ThreeDS::ChallengeResponse + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::ThreeDS::decisioning_challenge_response_params + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_retrieve_secret_params.rbs b/sig/lithic/models/three_ds/decisioning_retrieve_secret_params.rbs new file mode 100644 index 00000000..7a5be024 --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_retrieve_secret_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type decisioning_retrieve_secret_params = + { } & Lithic::request_parameters + + class DecisioningRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::ThreeDS::decisioning_retrieve_secret_params + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_retrieve_secret_response.rbs b/sig/lithic/models/three_ds/decisioning_retrieve_secret_response.rbs new file mode 100644 index 00000000..dfe578eb --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_retrieve_secret_response.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type decisioning_retrieve_secret_response = { secret: String } + + class DecisioningRetrieveSecretResponse < Lithic::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> Lithic::Models::ThreeDS::decisioning_retrieve_secret_response + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_rotate_secret_params.rbs b/sig/lithic/models/three_ds/decisioning_rotate_secret_params.rbs new file mode 100644 index 00000000..2677a470 --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_rotate_secret_params.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module ThreeDS + type decisioning_rotate_secret_params = { } & Lithic::request_parameters + + class DecisioningRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::ThreeDS::decisioning_rotate_secret_params + end + end + end +end diff --git a/sig/lithic/models/tokenization.rbs b/sig/lithic/models/tokenization.rbs new file mode 100644 index 00000000..23968bb0 --- /dev/null +++ b/sig/lithic/models/tokenization.rbs @@ -0,0 +1,226 @@ +module Lithic + module Models + type tokenization = + { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String?, + status: Lithic::Models::Tokenization::status, + token_requestor_name: Lithic::Models::Tokenization::token_requestor_name, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::tokenization_channel, + updated_at: Time, + digital_card_art_token: String, + events: ::Array[Lithic::Models::Tokenization::Event], + payment_account_reference_id: String? + } + + class Tokenization < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created_at: Time + + attr_accessor dpan: String? + + attr_accessor status: Lithic::Models::Tokenization::status + + attr_accessor token_requestor_name: Lithic::Models::Tokenization::token_requestor_name + + attr_accessor token_unique_reference: String + + attr_accessor tokenization_channel: Lithic::Models::Tokenization::tokenization_channel + + attr_accessor updated_at: Time + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + attr_reader events: ::Array[Lithic::Models::Tokenization::Event]? + + def events=: ( + ::Array[Lithic::Models::Tokenization::Event] + ) -> ::Array[Lithic::Models::Tokenization::Event] + + attr_accessor payment_account_reference_id: String? + + def initialize: ( + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String?, + status: Lithic::Models::Tokenization::status, + token_requestor_name: Lithic::Models::Tokenization::token_requestor_name, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::tokenization_channel, + updated_at: Time, + ?digital_card_art_token: String, + ?events: ::Array[Lithic::Models::Tokenization::Event], + ?payment_account_reference_id: String? + ) -> void + + def to_hash: -> Lithic::Models::tokenization + + type status = + :ACTIVE + | :DEACTIVATED + | :INACTIVE + | :PAUSED + | :PENDING_2FA + | :PENDING_ACTIVATION + | :UNKNOWN + + module Status + extend Lithic::Enum + + ACTIVE: :ACTIVE + DEACTIVATED: :DEACTIVATED + INACTIVE: :INACTIVE + PAUSED: :PAUSED + PENDING_2_FA: :PENDING_2FA + PENDING_ACTIVATION: :PENDING_ACTIVATION + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Tokenization::status] + end + + type token_requestor_name = + :AMAZON_ONE + | :ANDROID_PAY + | :APPLE_PAY + | :FACEBOOK + | :FITBIT_PAY + | :GARMIN_PAY + | :MICROSOFT_PAY + | :NETFLIX + | :SAMSUNG_PAY + | :UNKNOWN + | :VISA_CHECKOUT + + module TokenRequestorName + extend Lithic::Enum + + AMAZON_ONE: :AMAZON_ONE + ANDROID_PAY: :ANDROID_PAY + APPLE_PAY: :APPLE_PAY + FACEBOOK: :FACEBOOK + FITBIT_PAY: :FITBIT_PAY + GARMIN_PAY: :GARMIN_PAY + MICROSOFT_PAY: :MICROSOFT_PAY + NETFLIX: :NETFLIX + SAMSUNG_PAY: :SAMSUNG_PAY + UNKNOWN: :UNKNOWN + VISA_CHECKOUT: :VISA_CHECKOUT + + def self?.values: -> ::Array[Lithic::Models::Tokenization::token_requestor_name] + end + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT + + module TokenizationChannel + extend Lithic::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::Tokenization::tokenization_channel] + end + + type event = + { + token: String, + created_at: Time, + result: Lithic::Models::Tokenization::Event::result, + type: Lithic::Models::Tokenization::Event::type_ + } + + class Event < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader result: Lithic::Models::Tokenization::Event::result? + + def result=: ( + Lithic::Models::Tokenization::Event::result + ) -> Lithic::Models::Tokenization::Event::result + + attr_reader type: Lithic::Models::Tokenization::Event::type_? + + def type=: ( + Lithic::Models::Tokenization::Event::type_ + ) -> Lithic::Models::Tokenization::Event::type_ + + def initialize: ( + ?token: String, + ?created_at: Time, + ?result: Lithic::Models::Tokenization::Event::result, + ?type: Lithic::Models::Tokenization::Event::type_ + ) -> void + + def to_hash: -> Lithic::Models::Tokenization::event + + type result = + :APPROVED + | :DECLINED + | :NOTIFICATION_DELIVERED + | :REQUIRE_ADDITIONAL_AUTHENTICATION + | :TOKEN_ACTIVATED + | :TOKEN_CREATED + | :TOKEN_DEACTIVATED + | :TOKEN_INACTIVE + | :TOKEN_STATE_UNKNOWN + | :TOKEN_SUSPENDED + | :TOKEN_UPDATED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + NOTIFICATION_DELIVERED: :NOTIFICATION_DELIVERED + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + TOKEN_ACTIVATED: :TOKEN_ACTIVATED + TOKEN_CREATED: :TOKEN_CREATED + TOKEN_DEACTIVATED: :TOKEN_DEACTIVATED + TOKEN_INACTIVE: :TOKEN_INACTIVE + TOKEN_STATE_UNKNOWN: :TOKEN_STATE_UNKNOWN + TOKEN_SUSPENDED: :TOKEN_SUSPENDED + TOKEN_UPDATED: :TOKEN_UPDATED + + def self?.values: -> ::Array[Lithic::Models::Tokenization::Event::result] + end + + type type_ = + :TOKENIZATION_2FA + | :TOKENIZATION_AUTHORIZATION + | :TOKENIZATION_DECISIONING + | :TOKENIZATION_ELIGIBILITY_CHECK + | :TOKENIZATION_UPDATED + + module Type + extend Lithic::Enum + + TOKENIZATION_2_FA: :TOKENIZATION_2FA + TOKENIZATION_AUTHORIZATION: :TOKENIZATION_AUTHORIZATION + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + TOKENIZATION_ELIGIBILITY_CHECK: :TOKENIZATION_ELIGIBILITY_CHECK + TOKENIZATION_UPDATED: :TOKENIZATION_UPDATED + + def self?.values: -> ::Array[Lithic::Models::Tokenization::Event::type_] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_activate_params.rbs b/sig/lithic/models/tokenization_activate_params.rbs new file mode 100644 index 00000000..0c630514 --- /dev/null +++ b/sig/lithic/models/tokenization_activate_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type tokenization_activate_params = { } & Lithic::request_parameters + + class TokenizationActivateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::tokenization_activate_params + end + end +end diff --git a/sig/lithic/models/tokenization_deactivate_params.rbs b/sig/lithic/models/tokenization_deactivate_params.rbs new file mode 100644 index 00000000..0e3de576 --- /dev/null +++ b/sig/lithic/models/tokenization_deactivate_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type tokenization_deactivate_params = { } & Lithic::request_parameters + + class TokenizationDeactivateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::tokenization_deactivate_params + end + end +end diff --git a/sig/lithic/models/tokenization_decisioning_retrieve_secret_params.rbs b/sig/lithic/models/tokenization_decisioning_retrieve_secret_params.rbs new file mode 100644 index 00000000..ad11c14d --- /dev/null +++ b/sig/lithic/models/tokenization_decisioning_retrieve_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_decisioning_retrieve_secret_params = + { } & Lithic::request_parameters + + class TokenizationDecisioningRetrieveSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::tokenization_decisioning_retrieve_secret_params + end + end +end diff --git a/sig/lithic/models/tokenization_decisioning_rotate_secret_params.rbs b/sig/lithic/models/tokenization_decisioning_rotate_secret_params.rbs new file mode 100644 index 00000000..d0222da1 --- /dev/null +++ b/sig/lithic/models/tokenization_decisioning_rotate_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_decisioning_rotate_secret_params = + { } & Lithic::request_parameters + + class TokenizationDecisioningRotateSecretParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::tokenization_decisioning_rotate_secret_params + end + end +end diff --git a/sig/lithic/models/tokenization_decisioning_rotate_secret_response.rbs b/sig/lithic/models/tokenization_decisioning_rotate_secret_response.rbs new file mode 100644 index 00000000..48d52262 --- /dev/null +++ b/sig/lithic/models/tokenization_decisioning_rotate_secret_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_decisioning_rotate_secret_response = { secret: String } + + class TokenizationDecisioningRotateSecretResponse < Lithic::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> Lithic::Models::tokenization_decisioning_rotate_secret_response + end + end +end diff --git a/sig/lithic/models/tokenization_list_params.rbs b/sig/lithic/models/tokenization_list_params.rbs new file mode 100644 index 00000000..dda114cd --- /dev/null +++ b/sig/lithic/models/tokenization_list_params.rbs @@ -0,0 +1,81 @@ +module Lithic + module Models + type tokenization_list_params = + { + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel + } + & Lithic::request_parameters + + class TokenizationListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Date? + + def begin_=: (Date) -> Date + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader end_: Date? + + def end_=: (Date) -> Date + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel? + + def tokenization_channel=: ( + Lithic::Models::TokenizationListParams::tokenization_channel + ) -> Lithic::Models::TokenizationListParams::tokenization_channel + + def initialize: ( + ?account_token: String, + ?begin_: Date, + ?card_token: String, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::tokenization_list_params + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT | :ALL + + module TokenizationChannel + extend Lithic::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + ALL: :ALL + + def self?.values: -> ::Array[Lithic::Models::TokenizationListParams::tokenization_channel] + end + end + end +end diff --git a/sig/lithic/models/tokenization_pause_params.rbs b/sig/lithic/models/tokenization_pause_params.rbs new file mode 100644 index 00000000..d12581e8 --- /dev/null +++ b/sig/lithic/models/tokenization_pause_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type tokenization_pause_params = { } & Lithic::request_parameters + + class TokenizationPauseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::tokenization_pause_params + end + end +end diff --git a/sig/lithic/models/tokenization_resend_activation_code_params.rbs b/sig/lithic/models/tokenization_resend_activation_code_params.rbs new file mode 100644 index 00000000..5fe2f7c2 --- /dev/null +++ b/sig/lithic/models/tokenization_resend_activation_code_params.rbs @@ -0,0 +1,39 @@ +module Lithic + module Models + type tokenization_resend_activation_code_params = + { + activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type + } + & Lithic::request_parameters + + class TokenizationResendActivationCodeParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type? + + def activation_method_type=: ( + Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type + ) -> Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type + + def initialize: ( + ?activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::tokenization_resend_activation_code_params + + type activation_method_type = + :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module ActivationMethodType + extend Lithic::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type] + end + end + end +end diff --git a/sig/lithic/models/tokenization_retrieve_params.rbs b/sig/lithic/models/tokenization_retrieve_params.rbs new file mode 100644 index 00000000..8c170280 --- /dev/null +++ b/sig/lithic/models/tokenization_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type tokenization_retrieve_params = { } & Lithic::request_parameters + + class TokenizationRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::tokenization_retrieve_params + end + end +end diff --git a/sig/lithic/models/tokenization_retrieve_response.rbs b/sig/lithic/models/tokenization_retrieve_response.rbs new file mode 100644 index 00000000..b63e4ddb --- /dev/null +++ b/sig/lithic/models/tokenization_retrieve_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_retrieve_response = { data: Lithic::Models::Tokenization } + + class TokenizationRetrieveResponse < Lithic::BaseModel + attr_reader data: Lithic::Models::Tokenization? + + def data=: (Lithic::Models::Tokenization) -> Lithic::Models::Tokenization + + def initialize: (?data: Lithic::Models::Tokenization) -> void + + def to_hash: -> Lithic::Models::tokenization_retrieve_response + end + end +end diff --git a/sig/lithic/models/tokenization_secret.rbs b/sig/lithic/models/tokenization_secret.rbs new file mode 100644 index 00000000..b37236b8 --- /dev/null +++ b/sig/lithic/models/tokenization_secret.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_secret = { secret: String } + + class TokenizationSecret < Lithic::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> Lithic::Models::tokenization_secret + end + end +end diff --git a/sig/lithic/models/tokenization_simulate_params.rbs b/sig/lithic/models/tokenization_simulate_params.rbs new file mode 100644 index 00000000..d4ebf9f0 --- /dev/null +++ b/sig/lithic/models/tokenization_simulate_params.rbs @@ -0,0 +1,87 @@ +module Lithic + module Models + type tokenization_simulate_params = + { + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision + } + & Lithic::request_parameters + + class TokenizationSimulateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor cvv: String + + attr_accessor expiration_date: String + + attr_accessor pan: String + + attr_accessor tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source + + attr_reader account_score: Integer? + + def account_score=: (Integer) -> Integer + + attr_reader device_score: Integer? + + def device_score=: (Integer) -> Integer + + attr_reader entity: String? + + def entity=: (String) -> String + + attr_reader wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision? + + def wallet_recommended_decision=: ( + Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision + ) -> Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision + + def initialize: ( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source, + ?account_score: Integer, + ?device_score: Integer, + ?entity: String, + ?wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::tokenization_simulate_params + + type tokenization_source = :APPLE_PAY | :GOOGLE | :SAMSUNG_PAY | :MERCHANT + + module TokenizationSource + extend Lithic::Enum + + APPLE_PAY: :APPLE_PAY + GOOGLE: :GOOGLE + SAMSUNG_PAY: :SAMSUNG_PAY + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::TokenizationSimulateParams::tokenization_source] + end + + type wallet_recommended_decision = + :APPROVED | :DECLINED | :REQUIRE_ADDITIONAL_AUTHENTICATION + + module WalletRecommendedDecision + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + + def self?.values: -> ::Array[Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision] + end + end + end +end diff --git a/sig/lithic/models/tokenization_simulate_response.rbs b/sig/lithic/models/tokenization_simulate_response.rbs new file mode 100644 index 00000000..57715258 --- /dev/null +++ b/sig/lithic/models/tokenization_simulate_response.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type tokenization_simulate_response = + { data: ::Array[Lithic::Models::Tokenization] } + + class TokenizationSimulateResponse < Lithic::BaseModel + attr_reader data: ::Array[Lithic::Models::Tokenization]? + + def data=: ( + ::Array[Lithic::Models::Tokenization] + ) -> ::Array[Lithic::Models::Tokenization] + + def initialize: (?data: ::Array[Lithic::Models::Tokenization]) -> void + + def to_hash: -> Lithic::Models::tokenization_simulate_response + end + end +end diff --git a/sig/lithic/models/tokenization_unpause_params.rbs b/sig/lithic/models/tokenization_unpause_params.rbs new file mode 100644 index 00000000..d381e1da --- /dev/null +++ b/sig/lithic/models/tokenization_unpause_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type tokenization_unpause_params = { } & Lithic::request_parameters + + class TokenizationUnpauseParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::tokenization_unpause_params + end + end +end diff --git a/sig/lithic/models/tokenization_update_digital_card_art_params.rbs b/sig/lithic/models/tokenization_update_digital_card_art_params.rbs new file mode 100644 index 00000000..86642aa5 --- /dev/null +++ b/sig/lithic/models/tokenization_update_digital_card_art_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type tokenization_update_digital_card_art_params = + { digital_card_art_token: String } & Lithic::request_parameters + + class TokenizationUpdateDigitalCardArtParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + def initialize: ( + ?digital_card_art_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::tokenization_update_digital_card_art_params + end + end +end diff --git a/sig/lithic/models/tokenization_update_digital_card_art_response.rbs b/sig/lithic/models/tokenization_update_digital_card_art_response.rbs new file mode 100644 index 00000000..346c303f --- /dev/null +++ b/sig/lithic/models/tokenization_update_digital_card_art_response.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type tokenization_update_digital_card_art_response = + { data: Lithic::Models::Tokenization } + + class TokenizationUpdateDigitalCardArtResponse < Lithic::BaseModel + attr_reader data: Lithic::Models::Tokenization? + + def data=: (Lithic::Models::Tokenization) -> Lithic::Models::Tokenization + + def initialize: (?data: Lithic::Models::Tokenization) -> void + + def to_hash: -> Lithic::Models::tokenization_update_digital_card_art_response + end + end +end diff --git a/sig/lithic/models/transaction.rbs b/sig/lithic/models/transaction.rbs new file mode 100644 index 00000000..73fd85b0 --- /dev/null +++ b/sig/lithic/models/transaction.rbs @@ -0,0 +1,1333 @@ +module Lithic + module Models + type transaction = + { + token: String, + account_token: String, + acquirer_fee: Integer?, + acquirer_reference_number: String?, + amount: Integer, + amounts: Lithic::Models::Transaction::Amounts, + authorization_amount: Integer?, + authorization_code: String?, + avs: Lithic::Models::Transaction::Avs?, + card_token: String, + cardholder_authentication: Lithic::Models::Transaction::CardholderAuthentication?, + created: Time, + merchant: Lithic::Models::Transaction::Merchant, + merchant_amount: Integer?, + merchant_authorization_amount: Integer?, + merchant_currency: String, + network: Lithic::Models::Transaction::network?, + network_risk_score: Integer?, + pos: Lithic::Models::Transaction::Pos, + result: Lithic::Models::Transaction::result, + settled_amount: Integer, + status: Lithic::Models::Transaction::status, + token_info: Lithic::Models::Transaction::TokenInfo?, + updated: Time, + events: ::Array[Lithic::Models::Transaction::Event] + } + + class Transaction < Lithic::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor acquirer_fee: Integer? + + attr_accessor acquirer_reference_number: String? + + attr_accessor amount: Integer + + attr_accessor amounts: Lithic::Models::Transaction::Amounts + + attr_accessor authorization_amount: Integer? + + attr_accessor authorization_code: String? + + attr_accessor avs: Lithic::Models::Transaction::Avs? + + attr_accessor card_token: String + + attr_accessor cardholder_authentication: Lithic::Models::Transaction::CardholderAuthentication? + + attr_accessor created: Time + + attr_accessor merchant: Lithic::Models::Transaction::Merchant + + attr_accessor merchant_amount: Integer? + + attr_accessor merchant_authorization_amount: Integer? + + attr_accessor merchant_currency: String + + attr_accessor network: Lithic::Models::Transaction::network? + + attr_accessor network_risk_score: Integer? + + attr_accessor pos: Lithic::Models::Transaction::Pos + + attr_accessor result: Lithic::Models::Transaction::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::Transaction::status + + attr_accessor token_info: Lithic::Models::Transaction::TokenInfo? + + attr_accessor updated: Time + + attr_reader events: ::Array[Lithic::Models::Transaction::Event]? + + def events=: ( + ::Array[Lithic::Models::Transaction::Event] + ) -> ::Array[Lithic::Models::Transaction::Event] + + def initialize: ( + token: String, + account_token: String, + acquirer_fee: Integer?, + acquirer_reference_number: String?, + amount: Integer, + amounts: Lithic::Models::Transaction::Amounts, + authorization_amount: Integer?, + authorization_code: String?, + avs: Lithic::Models::Transaction::Avs?, + card_token: String, + cardholder_authentication: Lithic::Models::Transaction::CardholderAuthentication?, + created: Time, + merchant: Lithic::Models::Transaction::Merchant, + merchant_amount: Integer?, + merchant_authorization_amount: Integer?, + merchant_currency: String, + network: Lithic::Models::Transaction::network?, + network_risk_score: Integer?, + pos: Lithic::Models::Transaction::Pos, + result: Lithic::Models::Transaction::result, + settled_amount: Integer, + status: Lithic::Models::Transaction::status, + token_info: Lithic::Models::Transaction::TokenInfo?, + updated: Time, + ?events: ::Array[Lithic::Models::Transaction::Event] + ) -> void + + def to_hash: -> Lithic::Models::transaction + + type amounts = + { + cardholder: Lithic::Models::Transaction::Amounts::Cardholder, + hold: Lithic::Models::Transaction::Amounts::Hold, + merchant: Lithic::Models::Transaction::Amounts::Merchant, + settlement: Lithic::Models::Transaction::Amounts::Settlement + } + + class Amounts < Lithic::BaseModel + attr_accessor cardholder: Lithic::Models::Transaction::Amounts::Cardholder + + attr_accessor hold: Lithic::Models::Transaction::Amounts::Hold + + attr_accessor merchant: Lithic::Models::Transaction::Amounts::Merchant + + attr_accessor settlement: Lithic::Models::Transaction::Amounts::Settlement + + def initialize: ( + cardholder: Lithic::Models::Transaction::Amounts::Cardholder, + hold: Lithic::Models::Transaction::Amounts::Hold, + merchant: Lithic::Models::Transaction::Amounts::Merchant, + settlement: Lithic::Models::Transaction::Amounts::Settlement + ) -> void + + def to_hash: -> Lithic::Models::Transaction::amounts + + type cardholder = + { amount: Integer, conversion_rate: String, currency: String } + + class Cardholder < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor conversion_rate: String + + attr_accessor currency: String + + def initialize: ( + amount: Integer, + conversion_rate: String, + currency: String + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Amounts::cardholder + end + + type hold = { amount: Integer, currency: String } + + class Hold < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> Lithic::Models::Transaction::Amounts::hold + end + + type merchant = { amount: Integer, currency: String } + + class Merchant < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> Lithic::Models::Transaction::Amounts::merchant + end + + type settlement = { amount: Integer, currency: String } + + class Settlement < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> Lithic::Models::Transaction::Amounts::settlement + end + end + + type avs = { address: String, zipcode: String } + + class Avs < Lithic::BaseModel + attr_accessor address: String + + attr_accessor zipcode: String + + def initialize: (address: String, zipcode: String) -> void + + def to_hash: -> Lithic::Models::Transaction::avs + end + + type cardholder_authentication = + { + three_ds_version: String?, + acquirer_exemption: Lithic::Models::Transaction::CardholderAuthentication::acquirer_exemption, + authentication_result: Lithic::Models::Transaction::CardholderAuthentication::authentication_result, + decision_made_by: Lithic::Models::Transaction::CardholderAuthentication::decision_made_by, + liability_shift: Lithic::Models::Transaction::CardholderAuthentication::liability_shift, + three_ds_authentication_token: String?, + verification_attempted: Lithic::Models::Transaction::CardholderAuthentication::verification_attempted, + verification_result: Lithic::Models::Transaction::CardholderAuthentication::verification_result + } + + class CardholderAuthentication < Lithic::BaseModel + attr_accessor three_ds_version: String? + + attr_accessor acquirer_exemption: Lithic::Models::Transaction::CardholderAuthentication::acquirer_exemption + + attr_accessor authentication_result: Lithic::Models::Transaction::CardholderAuthentication::authentication_result + + attr_accessor decision_made_by: Lithic::Models::Transaction::CardholderAuthentication::decision_made_by + + attr_accessor liability_shift: Lithic::Models::Transaction::CardholderAuthentication::liability_shift + + attr_accessor three_ds_authentication_token: String? + + attr_accessor verification_attempted: Lithic::Models::Transaction::CardholderAuthentication::verification_attempted + + attr_accessor verification_result: Lithic::Models::Transaction::CardholderAuthentication::verification_result + + def initialize: ( + three_ds_version: String?, + acquirer_exemption: Lithic::Models::Transaction::CardholderAuthentication::acquirer_exemption, + authentication_result: Lithic::Models::Transaction::CardholderAuthentication::authentication_result, + decision_made_by: Lithic::Models::Transaction::CardholderAuthentication::decision_made_by, + liability_shift: Lithic::Models::Transaction::CardholderAuthentication::liability_shift, + three_ds_authentication_token: String?, + verification_attempted: Lithic::Models::Transaction::CardholderAuthentication::verification_attempted, + verification_result: Lithic::Models::Transaction::CardholderAuthentication::verification_result + ) -> void + + def to_hash: -> Lithic::Models::Transaction::cardholder_authentication + + type acquirer_exemption = + :AUTHENTICATION_OUTAGE_EXCEPTION + | :LOW_VALUE + | :MERCHANT_INITIATED_TRANSACTION + | :NONE + | :RECURRING_PAYMENT + | :SECURE_CORPORATE_PAYMENT + | :STRONG_CUSTOMER_AUTHENTICATION_DELEGATION + | :TRANSACTION_RISK_ANALYSIS + + module AcquirerExemption + extend Lithic::Enum + + AUTHENTICATION_OUTAGE_EXCEPTION: :AUTHENTICATION_OUTAGE_EXCEPTION + LOW_VALUE: :LOW_VALUE + MERCHANT_INITIATED_TRANSACTION: :MERCHANT_INITIATED_TRANSACTION + NONE: :NONE + RECURRING_PAYMENT: :RECURRING_PAYMENT + SECURE_CORPORATE_PAYMENT: :SECURE_CORPORATE_PAYMENT + STRONG_CUSTOMER_AUTHENTICATION_DELEGATION: :STRONG_CUSTOMER_AUTHENTICATION_DELEGATION + TRANSACTION_RISK_ANALYSIS: :TRANSACTION_RISK_ANALYSIS + + def self?.values: -> ::Array[Lithic::Models::Transaction::CardholderAuthentication::acquirer_exemption] + end + + type authentication_result = :ATTEMPTS | :DECLINE | :NONE | :SUCCESS + + module AuthenticationResult + extend Lithic::Enum + + ATTEMPTS: :ATTEMPTS + DECLINE: :DECLINE + NONE: :NONE + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::Transaction::CardholderAuthentication::authentication_result] + end + + type decision_made_by = + :CUSTOMER_ENDPOINT + | :LITHIC_DEFAULT + | :LITHIC_RULES + | :NETWORK + | :UNKNOWN + + module DecisionMadeBy + extend Lithic::Enum + + CUSTOMER_ENDPOINT: :CUSTOMER_ENDPOINT + LITHIC_DEFAULT: :LITHIC_DEFAULT + LITHIC_RULES: :LITHIC_RULES + NETWORK: :NETWORK + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::CardholderAuthentication::decision_made_by] + end + + type liability_shift = + :"3DS_AUTHENTICATED" + | :ACQUIRER_EXEMPTION + | :NONE + | :TOKEN_AUTHENTICATED + + module LiabilityShift + extend Lithic::Enum + + NUMBER_3DS_AUTHENTICATED: :"3DS_AUTHENTICATED" + ACQUIRER_EXEMPTION: :ACQUIRER_EXEMPTION + NONE: :NONE + TOKEN_AUTHENTICATED: :TOKEN_AUTHENTICATED + + def self?.values: -> ::Array[Lithic::Models::Transaction::CardholderAuthentication::liability_shift] + end + + type verification_attempted = :NONE | :OTHER + + module VerificationAttempted + extend Lithic::Enum + + NONE: :NONE + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::Transaction::CardholderAuthentication::verification_attempted] + end + + type verification_result = + :CANCELLED + | :FAILED + | :FRICTIONLESS + | :NOT_ATTEMPTED + | :REJECTED + | :SUCCESS + + module VerificationResult + extend Lithic::Enum + + CANCELLED: :CANCELLED + FAILED: :FAILED + FRICTIONLESS: :FRICTIONLESS + NOT_ATTEMPTED: :NOT_ATTEMPTED + REJECTED: :REJECTED + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::Transaction::CardholderAuthentication::verification_result] + end + end + + type merchant = + { + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + } + + class Merchant < Lithic::BaseModel + attr_accessor acceptor_id: String + + attr_accessor acquiring_institution_id: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor descriptor: String + + attr_accessor mcc: String + + attr_accessor state: String + + def initialize: ( + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + ) -> void + + def to_hash: -> Lithic::Models::Transaction::merchant + end + + type network = :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Enum + + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::Transaction::network] + end + + type pos = + { + entry_mode: Lithic::Models::Transaction::Pos::EntryMode, + terminal: Lithic::Models::Transaction::Pos::Terminal + } + + class Pos < Lithic::BaseModel + attr_accessor entry_mode: Lithic::Models::Transaction::Pos::EntryMode + + attr_accessor terminal: Lithic::Models::Transaction::Pos::Terminal + + def initialize: ( + entry_mode: Lithic::Models::Transaction::Pos::EntryMode, + terminal: Lithic::Models::Transaction::Pos::Terminal + ) -> void + + def to_hash: -> Lithic::Models::Transaction::pos + + type entry_mode = + { + card: Lithic::Models::Transaction::Pos::EntryMode::card, + cardholder: Lithic::Models::Transaction::Pos::EntryMode::cardholder, + pan: Lithic::Models::Transaction::Pos::EntryMode::pan, + pin_entered: bool + } + + class EntryMode < Lithic::BaseModel + attr_accessor card: Lithic::Models::Transaction::Pos::EntryMode::card + + attr_accessor cardholder: Lithic::Models::Transaction::Pos::EntryMode::cardholder + + attr_accessor pan: Lithic::Models::Transaction::Pos::EntryMode::pan + + attr_accessor pin_entered: bool + + def initialize: ( + card: Lithic::Models::Transaction::Pos::EntryMode::card, + cardholder: Lithic::Models::Transaction::Pos::EntryMode::cardholder, + pan: Lithic::Models::Transaction::Pos::EntryMode::pan, + pin_entered: bool + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Pos::entry_mode + + type card = :NOT_PRESENT | :PREAUTHORIZED | :PRESENT | :UNKNOWN + + module Card + extend Lithic::Enum + + NOT_PRESENT: :NOT_PRESENT + PREAUTHORIZED: :PREAUTHORIZED + PRESENT: :PRESENT + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::EntryMode::card] + end + + type cardholder = + :DEFERRED_BILLING + | :ELECTRONIC_ORDER + | :INSTALLMENT + | :MAIL_ORDER + | :NOT_PRESENT + | :PREAUTHORIZED + | :PRESENT + | :REOCCURRING + | :TELEPHONE_ORDER + | :UNKNOWN + + module Cardholder + extend Lithic::Enum + + DEFERRED_BILLING: :DEFERRED_BILLING + ELECTRONIC_ORDER: :ELECTRONIC_ORDER + INSTALLMENT: :INSTALLMENT + MAIL_ORDER: :MAIL_ORDER + NOT_PRESENT: :NOT_PRESENT + PREAUTHORIZED: :PREAUTHORIZED + PRESENT: :PRESENT + REOCCURRING: :REOCCURRING + TELEPHONE_ORDER: :TELEPHONE_ORDER + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::EntryMode::cardholder] + end + + type pan = + :AUTO_ENTRY + | :BAR_CODE + | :CONTACTLESS + | :CREDENTIAL_ON_FILE + | :ECOMMERCE + | :ERROR_KEYED + | :ERROR_MAGNETIC_STRIPE + | :ICC + | :KEY_ENTERED + | :MAGNETIC_STRIPE + | :MANUAL + | :OCR + | :SECURE_CARDLESS + | :UNKNOWN + | :UNSPECIFIED + + module Pan + extend Lithic::Enum + + AUTO_ENTRY: :AUTO_ENTRY + BAR_CODE: :BAR_CODE + CONTACTLESS: :CONTACTLESS + CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE + ECOMMERCE: :ECOMMERCE + ERROR_KEYED: :ERROR_KEYED + ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE + ICC: :ICC + KEY_ENTERED: :KEY_ENTERED + MAGNETIC_STRIPE: :MAGNETIC_STRIPE + MANUAL: :MANUAL + OCR: :OCR + SECURE_CARDLESS: :SECURE_CARDLESS + UNKNOWN: :UNKNOWN + UNSPECIFIED: :UNSPECIFIED + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::EntryMode::pan] + end + end + + type terminal = + { + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::Transaction::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::Transaction::Pos::Terminal::pin_capability, + type: Lithic::Models::Transaction::Pos::Terminal::type_ + } + + class Terminal < Lithic::BaseModel + attr_accessor attended: bool + + attr_accessor card_retention_capable: bool + + attr_accessor on_premise: bool + + attr_accessor operator: Lithic::Models::Transaction::Pos::Terminal::operator + + attr_accessor partial_approval_capable: bool + + attr_accessor pin_capability: Lithic::Models::Transaction::Pos::Terminal::pin_capability + + attr_accessor type: Lithic::Models::Transaction::Pos::Terminal::type_ + + def initialize: ( + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::Transaction::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::Transaction::Pos::Terminal::pin_capability, + type: Lithic::Models::Transaction::Pos::Terminal::type_ + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Pos::terminal + + type operator = + :ADMINISTRATIVE | :CARDHOLDER | :CARD_ACCEPTOR | :UNKNOWN + + module Operator + extend Lithic::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + CARDHOLDER: :CARDHOLDER + CARD_ACCEPTOR: :CARD_ACCEPTOR + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::Terminal::operator] + end + + type pin_capability = + :CAPABLE | :INOPERATIVE | :NOT_CAPABLE | :UNSPECIFIED + + module PinCapability + extend Lithic::Enum + + CAPABLE: :CAPABLE + INOPERATIVE: :INOPERATIVE + NOT_CAPABLE: :NOT_CAPABLE + UNSPECIFIED: :UNSPECIFIED + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::Terminal::pin_capability] + end + + type type_ = + :ADMINISTRATIVE + | :ATM + | :AUTHORIZATION + | :COUPON_MACHINE + | :DIAL_TERMINAL + | :ECOMMERCE + | :ECR + | :FUEL_MACHINE + | :HOME_TERMINAL + | :MICR + | :OFF_PREMISE + | :PAYMENT + | :PDA + | :PHONE + | :POINT + | :POS_TERMINAL + | :PUBLIC_UTILITY + | :SELF_SERVICE + | :TELEVISION + | :TELLER + | :TRAVELERS_CHECK_MACHINE + | :VENDING + | :VOICE + | :UNKNOWN + + module Type + extend Lithic::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + ATM: :ATM + AUTHORIZATION: :AUTHORIZATION + COUPON_MACHINE: :COUPON_MACHINE + DIAL_TERMINAL: :DIAL_TERMINAL + ECOMMERCE: :ECOMMERCE + ECR: :ECR + FUEL_MACHINE: :FUEL_MACHINE + HOME_TERMINAL: :HOME_TERMINAL + MICR: :MICR + OFF_PREMISE: :OFF_PREMISE + PAYMENT: :PAYMENT + PDA: :PDA + PHONE: :PHONE + POINT: :POINT + POS_TERMINAL: :POS_TERMINAL + PUBLIC_UTILITY: :PUBLIC_UTILITY + SELF_SERVICE: :SELF_SERVICE + TELEVISION: :TELEVISION + TELLER: :TELLER + TRAVELERS_CHECK_MACHINE: :TRAVELERS_CHECK_MACHINE + VENDING: :VENDING + VOICE: :VOICE + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::Terminal::type_] + end + end + end + + type result = + :ACCOUNT_STATE_TRANSACTION_FAIL + | :APPROVED + | :BANK_CONNECTION_ERROR + | :BANK_NOT_VERIFIED + | :CARD_CLOSED + | :CARD_PAUSED + | :DECLINED + | :FRAUD_ADVICE + | :IGNORED_TTL_EXPIRY + | :INACTIVE_ACCOUNT + | :INCORRECT_PIN + | :INVALID_CARD_DETAILS + | :INSUFFICIENT_FUNDS + | :INSUFFICIENT_FUNDS_PRELOAD + | :INVALID_TRANSACTION + | :MERCHANT_BLACKLIST + | :ORIGINAL_NOT_FOUND + | :PREVIOUSLY_COMPLETED + | :SINGLE_USE_RECHARGED + | :SWITCH_INOPERATIVE_ADVICE + | :UNAUTHORIZED_MERCHANT + | :UNKNOWN_HOST_TIMEOUT + | :USER_TRANSACTION_LIMIT + + module Result + extend Lithic::Enum + + ACCOUNT_STATE_TRANSACTION_FAIL: :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED: :APPROVED + BANK_CONNECTION_ERROR: :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED: :BANK_NOT_VERIFIED + CARD_CLOSED: :CARD_CLOSED + CARD_PAUSED: :CARD_PAUSED + DECLINED: :DECLINED + FRAUD_ADVICE: :FRAUD_ADVICE + IGNORED_TTL_EXPIRY: :IGNORED_TTL_EXPIRY + INACTIVE_ACCOUNT: :INACTIVE_ACCOUNT + INCORRECT_PIN: :INCORRECT_PIN + INVALID_CARD_DETAILS: :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD: :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION: :INVALID_TRANSACTION + MERCHANT_BLACKLIST: :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND: :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED: :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED: :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE: :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT: :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT: :USER_TRANSACTION_LIMIT + + def self?.values: -> ::Array[Lithic::Models::Transaction::result] + end + + type status = :DECLINED | :EXPIRED | :PENDING | :SETTLED | :VOIDED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::Transaction::status] + end + + type token_info = + { wallet_type: Lithic::Models::Transaction::TokenInfo::wallet_type } + + class TokenInfo < Lithic::BaseModel + attr_accessor wallet_type: Lithic::Models::Transaction::TokenInfo::wallet_type + + def initialize: ( + wallet_type: Lithic::Models::Transaction::TokenInfo::wallet_type + ) -> void + + def to_hash: -> Lithic::Models::Transaction::token_info + + type wallet_type = + :APPLE_PAY + | :GOOGLE_PAY + | :MASTERPASS + | :MERCHANT + | :OTHER + | :SAMSUNG_PAY + + module WalletType + extend Lithic::Enum + + APPLE_PAY: :APPLE_PAY + GOOGLE_PAY: :GOOGLE_PAY + MASTERPASS: :MASTERPASS + MERCHANT: :MERCHANT + OTHER: :OTHER + SAMSUNG_PAY: :SAMSUNG_PAY + + def self?.values: -> ::Array[Lithic::Models::Transaction::TokenInfo::wallet_type] + end + end + + type event = + { + token: String, + amount: Integer, + amounts: Lithic::Models::Transaction::Event::Amounts, + created: Time, + detailed_results: ::Array[Lithic::Models::Transaction::Event::detailed_result], + effective_polarity: Lithic::Models::Transaction::Event::effective_polarity, + network_info: Lithic::Models::Transaction::Event::NetworkInfo?, + result: Lithic::Models::Transaction::Event::result, + rule_results: ::Array[Lithic::Models::Transaction::Event::RuleResult], + type: Lithic::Models::Transaction::Event::type_ + } + + class Event < Lithic::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor amounts: Lithic::Models::Transaction::Event::Amounts + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::Transaction::Event::detailed_result] + + attr_accessor effective_polarity: Lithic::Models::Transaction::Event::effective_polarity + + attr_accessor network_info: Lithic::Models::Transaction::Event::NetworkInfo? + + attr_accessor result: Lithic::Models::Transaction::Event::result + + attr_accessor rule_results: ::Array[Lithic::Models::Transaction::Event::RuleResult] + + attr_accessor type: Lithic::Models::Transaction::Event::type_ + + def initialize: ( + token: String, + amount: Integer, + amounts: Lithic::Models::Transaction::Event::Amounts, + created: Time, + detailed_results: ::Array[Lithic::Models::Transaction::Event::detailed_result], + effective_polarity: Lithic::Models::Transaction::Event::effective_polarity, + network_info: Lithic::Models::Transaction::Event::NetworkInfo?, + result: Lithic::Models::Transaction::Event::result, + rule_results: ::Array[Lithic::Models::Transaction::Event::RuleResult], + type: Lithic::Models::Transaction::Event::type_ + ) -> void + + def to_hash: -> Lithic::Models::Transaction::event + + type amounts = + { + cardholder: Lithic::Models::Transaction::Event::Amounts::Cardholder, + merchant: Lithic::Models::Transaction::Event::Amounts::Merchant, + settlement: Lithic::Models::Transaction::Event::Amounts::Settlement? + } + + class Amounts < Lithic::BaseModel + attr_accessor cardholder: Lithic::Models::Transaction::Event::Amounts::Cardholder + + attr_accessor merchant: Lithic::Models::Transaction::Event::Amounts::Merchant + + attr_accessor settlement: Lithic::Models::Transaction::Event::Amounts::Settlement? + + def initialize: ( + cardholder: Lithic::Models::Transaction::Event::Amounts::Cardholder, + merchant: Lithic::Models::Transaction::Event::Amounts::Merchant, + settlement: Lithic::Models::Transaction::Event::Amounts::Settlement? + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::amounts + + type cardholder = + { amount: Integer, conversion_rate: String, currency: String } + + class Cardholder < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor conversion_rate: String + + attr_accessor currency: String + + def initialize: ( + amount: Integer, + conversion_rate: String, + currency: String + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::Amounts::cardholder + end + + type merchant = { amount: Integer, currency: String } + + class Merchant < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::Amounts::merchant + end + + type settlement = + { amount: Integer, conversion_rate: String, currency: String } + + class Settlement < Lithic::BaseModel + attr_accessor amount: Integer + + attr_accessor conversion_rate: String + + attr_accessor currency: String + + def initialize: ( + amount: Integer, + conversion_rate: String, + currency: String + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::Amounts::settlement + end + end + + type detailed_result = + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_DELINQUENT + | :ACCOUNT_INACTIVE + | :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_UNDER_REVIEW + | :ADDRESS_INCORRECT + | :APPROVED + | :AUTH_RULE_ALLOWED_COUNTRY + | :AUTH_RULE_ALLOWED_MCC + | :AUTH_RULE_BLOCKED_COUNTRY + | :AUTH_RULE_BLOCKED_MCC + | :CARD_CLOSED + | :CARD_CRYPTOGRAM_VALIDATION_FAILURE + | :CARD_EXPIRED + | :CARD_EXPIRY_DATE_INCORRECT + | :CARD_INVALID + | :CARD_NOT_ACTIVATED + | :CARD_PAUSED + | :CARD_PIN_INCORRECT + | :CARD_RESTRICTED + | :CARD_SECURITY_CODE_INCORRECT + | :CARD_SPEND_LIMIT_EXCEEDED + | :CONTACT_CARD_ISSUER + | :CUSTOMER_ASA_TIMEOUT + | :CUSTOM_ASA_RESULT + | :DECLINED + | :DO_NOT_HONOR + | :DRIVER_NUMBER_INVALID + | :FORMAT_ERROR + | :INSUFFICIENT_FUNDING_SOURCE_BALANCE + | :INSUFFICIENT_FUNDS + | :LITHIC_SYSTEM_ERROR + | :LITHIC_SYSTEM_RATE_LIMIT + | :MALFORMED_ASA_RESPONSE + | :MERCHANT_INVALID + | :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + | :MERCHANT_NOT_PERMITTED + | :OVER_REVERSAL_ATTEMPTED + | :PIN_BLOCKED + | :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + | :PROGRAM_SUSPENDED + | :PROGRAM_USAGE_RESTRICTION + | :REVERSAL_UNMATCHED + | :SECURITY_VIOLATION + | :SINGLE_USE_CARD_REATTEMPTED + | :TRANSACTION_INVALID + | :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + | :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + | :TRANSACTION_PREVIOUSLY_COMPLETED + | :UNAUTHORIZED_MERCHANT + | :VEHICLE_NUMBER_INVALID + + module DetailedResult + extend Lithic::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT: :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE: :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED: :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_UNDER_REVIEW: :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT: :ADDRESS_INCORRECT + APPROVED: :APPROVED + AUTH_RULE_ALLOWED_COUNTRY: :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC: :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY: :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC: :AUTH_RULE_BLOCKED_MCC + CARD_CLOSED: :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE: :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED: :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT: :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID: :CARD_INVALID + CARD_NOT_ACTIVATED: :CARD_NOT_ACTIVATED + CARD_PAUSED: :CARD_PAUSED + CARD_PIN_INCORRECT: :CARD_PIN_INCORRECT + CARD_RESTRICTED: :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT: :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED: :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER: :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT: :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT: :CUSTOM_ASA_RESULT + DECLINED: :DECLINED + DO_NOT_HONOR: :DO_NOT_HONOR + DRIVER_NUMBER_INVALID: :DRIVER_NUMBER_INVALID + FORMAT_ERROR: :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE: :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR: :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT: :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE: :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID: :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE: :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED: :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED: :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED: :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED: :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED: :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION: :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED: :REVERSAL_UNMATCHED + SECURITY_VIOLATION: :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED: :SINGLE_USE_CARD_REATTEMPTED + TRANSACTION_INVALID: :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL: :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER: :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED: :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID: :VEHICLE_NUMBER_INVALID + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::detailed_result] + end + + type effective_polarity = :CREDIT | :DEBIT + + module EffectivePolarity + extend Lithic::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::effective_polarity] + end + + type network_info = + { + acquirer: Lithic::Models::Transaction::Event::NetworkInfo::Acquirer?, + mastercard: Lithic::Models::Transaction::Event::NetworkInfo::Mastercard?, + visa: Lithic::Models::Transaction::Event::NetworkInfo::Visa? + } + + class NetworkInfo < Lithic::BaseModel + attr_accessor acquirer: Lithic::Models::Transaction::Event::NetworkInfo::Acquirer? + + attr_accessor mastercard: Lithic::Models::Transaction::Event::NetworkInfo::Mastercard? + + attr_accessor visa: Lithic::Models::Transaction::Event::NetworkInfo::Visa? + + def initialize: ( + acquirer: Lithic::Models::Transaction::Event::NetworkInfo::Acquirer?, + mastercard: Lithic::Models::Transaction::Event::NetworkInfo::Mastercard?, + visa: Lithic::Models::Transaction::Event::NetworkInfo::Visa? + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::network_info + + type acquirer = + { + acquirer_reference_number: String?, + retrieval_reference_number: String? + } + + class Acquirer < Lithic::BaseModel + attr_accessor acquirer_reference_number: String? + + attr_accessor retrieval_reference_number: String? + + def initialize: ( + acquirer_reference_number: String?, + retrieval_reference_number: String? + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::NetworkInfo::acquirer + end + + type mastercard = + { + banknet_reference_number: String?, + original_banknet_reference_number: String?, + original_switch_serial_number: String?, + switch_serial_number: String? + } + + class Mastercard < Lithic::BaseModel + attr_accessor banknet_reference_number: String? + + attr_accessor original_banknet_reference_number: String? + + attr_accessor original_switch_serial_number: String? + + attr_accessor switch_serial_number: String? + + def initialize: ( + banknet_reference_number: String?, + original_banknet_reference_number: String?, + original_switch_serial_number: String?, + switch_serial_number: String? + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::NetworkInfo::mastercard + end + + type visa = + { original_transaction_id: String?, transaction_id: String? } + + class Visa < Lithic::BaseModel + attr_accessor original_transaction_id: String? + + attr_accessor transaction_id: String? + + def initialize: ( + original_transaction_id: String?, + transaction_id: String? + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::NetworkInfo::visa + end + end + + type result = + :ACCOUNT_STATE_TRANSACTION_FAIL + | :APPROVED + | :BANK_CONNECTION_ERROR + | :BANK_NOT_VERIFIED + | :CARD_CLOSED + | :CARD_PAUSED + | :DECLINED + | :FRAUD_ADVICE + | :IGNORED_TTL_EXPIRY + | :INACTIVE_ACCOUNT + | :INCORRECT_PIN + | :INVALID_CARD_DETAILS + | :INSUFFICIENT_FUNDS + | :INSUFFICIENT_FUNDS_PRELOAD + | :INVALID_TRANSACTION + | :MERCHANT_BLACKLIST + | :ORIGINAL_NOT_FOUND + | :PREVIOUSLY_COMPLETED + | :SINGLE_USE_RECHARGED + | :SWITCH_INOPERATIVE_ADVICE + | :UNAUTHORIZED_MERCHANT + | :UNKNOWN_HOST_TIMEOUT + | :USER_TRANSACTION_LIMIT + + module Result + extend Lithic::Enum + + ACCOUNT_STATE_TRANSACTION_FAIL: :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED: :APPROVED + BANK_CONNECTION_ERROR: :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED: :BANK_NOT_VERIFIED + CARD_CLOSED: :CARD_CLOSED + CARD_PAUSED: :CARD_PAUSED + DECLINED: :DECLINED + FRAUD_ADVICE: :FRAUD_ADVICE + IGNORED_TTL_EXPIRY: :IGNORED_TTL_EXPIRY + INACTIVE_ACCOUNT: :INACTIVE_ACCOUNT + INCORRECT_PIN: :INCORRECT_PIN + INVALID_CARD_DETAILS: :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD: :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION: :INVALID_TRANSACTION + MERCHANT_BLACKLIST: :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND: :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED: :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED: :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE: :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT: :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT: :USER_TRANSACTION_LIMIT + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::result] + end + + type rule_result = + { + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::Transaction::Event::RuleResult::result + } + + class RuleResult < Lithic::BaseModel + attr_accessor auth_rule_token: String? + + attr_accessor explanation: String? + + attr_accessor name: String? + + attr_accessor result: Lithic::Models::Transaction::Event::RuleResult::result + + def initialize: ( + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::Transaction::Event::RuleResult::result + ) -> void + + def to_hash: -> Lithic::Models::Transaction::Event::rule_result + + type result = + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_DELINQUENT + | :ACCOUNT_INACTIVE + | :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_UNDER_REVIEW + | :ADDRESS_INCORRECT + | :APPROVED + | :AUTH_RULE_ALLOWED_COUNTRY + | :AUTH_RULE_ALLOWED_MCC + | :AUTH_RULE_BLOCKED_COUNTRY + | :AUTH_RULE_BLOCKED_MCC + | :CARD_CLOSED + | :CARD_CRYPTOGRAM_VALIDATION_FAILURE + | :CARD_EXPIRED + | :CARD_EXPIRY_DATE_INCORRECT + | :CARD_INVALID + | :CARD_NOT_ACTIVATED + | :CARD_PAUSED + | :CARD_PIN_INCORRECT + | :CARD_RESTRICTED + | :CARD_SECURITY_CODE_INCORRECT + | :CARD_SPEND_LIMIT_EXCEEDED + | :CONTACT_CARD_ISSUER + | :CUSTOMER_ASA_TIMEOUT + | :CUSTOM_ASA_RESULT + | :DECLINED + | :DO_NOT_HONOR + | :DRIVER_NUMBER_INVALID + | :FORMAT_ERROR + | :INSUFFICIENT_FUNDING_SOURCE_BALANCE + | :INSUFFICIENT_FUNDS + | :LITHIC_SYSTEM_ERROR + | :LITHIC_SYSTEM_RATE_LIMIT + | :MALFORMED_ASA_RESPONSE + | :MERCHANT_INVALID + | :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + | :MERCHANT_NOT_PERMITTED + | :OVER_REVERSAL_ATTEMPTED + | :PIN_BLOCKED + | :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + | :PROGRAM_SUSPENDED + | :PROGRAM_USAGE_RESTRICTION + | :REVERSAL_UNMATCHED + | :SECURITY_VIOLATION + | :SINGLE_USE_CARD_REATTEMPTED + | :TRANSACTION_INVALID + | :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + | :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + | :TRANSACTION_PREVIOUSLY_COMPLETED + | :UNAUTHORIZED_MERCHANT + | :VEHICLE_NUMBER_INVALID + + module Result + extend Lithic::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT: :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE: :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED: :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_UNDER_REVIEW: :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT: :ADDRESS_INCORRECT + APPROVED: :APPROVED + AUTH_RULE_ALLOWED_COUNTRY: :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC: :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY: :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC: :AUTH_RULE_BLOCKED_MCC + CARD_CLOSED: :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE: :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED: :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT: :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID: :CARD_INVALID + CARD_NOT_ACTIVATED: :CARD_NOT_ACTIVATED + CARD_PAUSED: :CARD_PAUSED + CARD_PIN_INCORRECT: :CARD_PIN_INCORRECT + CARD_RESTRICTED: :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT: :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED: :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER: :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT: :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT: :CUSTOM_ASA_RESULT + DECLINED: :DECLINED + DO_NOT_HONOR: :DO_NOT_HONOR + DRIVER_NUMBER_INVALID: :DRIVER_NUMBER_INVALID + FORMAT_ERROR: :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE: :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR: :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT: :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE: :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID: :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE: :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED: :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED: :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED: :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED: :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED: :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION: :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED: :REVERSAL_UNMATCHED + SECURITY_VIOLATION: :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED: :SINGLE_USE_CARD_REATTEMPTED + TRANSACTION_INVALID: :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL: :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER: :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED: :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID: :VEHICLE_NUMBER_INVALID + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::RuleResult::result] + end + end + + type type_ = + :AUTHORIZATION + | :AUTHORIZATION_ADVICE + | :AUTHORIZATION_EXPIRY + | :AUTHORIZATION_REVERSAL + | :BALANCE_INQUIRY + | :CLEARING + | :CORRECTION_CREDIT + | :CORRECTION_DEBIT + | :CREDIT_AUTHORIZATION + | :CREDIT_AUTHORIZATION_ADVICE + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :RETURN + | :RETURN_REVERSAL + + module Type + extend Lithic::Enum + + AUTHORIZATION: :AUTHORIZATION + AUTHORIZATION_ADVICE: :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY: :BALANCE_INQUIRY + CLEARING: :CLEARING + CORRECTION_CREDIT: :CORRECTION_CREDIT + CORRECTION_DEBIT: :CORRECTION_DEBIT + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE: :CREDIT_AUTHORIZATION_ADVICE + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + RETURN: :RETURN + RETURN_REVERSAL: :RETURN_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::type_] + end + end + end + end +end diff --git a/sig/lithic/models/transaction_expire_authorization_params.rbs b/sig/lithic/models/transaction_expire_authorization_params.rbs new file mode 100644 index 00000000..d2f200f4 --- /dev/null +++ b/sig/lithic/models/transaction_expire_authorization_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type transaction_expire_authorization_params = + { } & Lithic::request_parameters + + class TransactionExpireAuthorizationParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::transaction_expire_authorization_params + end + end +end diff --git a/sig/lithic/models/transaction_list_params.rbs b/sig/lithic/models/transaction_list_params.rbs new file mode 100644 index 00000000..01aa670f --- /dev/null +++ b/sig/lithic/models/transaction_list_params.rbs @@ -0,0 +1,102 @@ +module Lithic + module Models + type transaction_list_params = + { + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::Models::TransactionListParams::result, + starting_after: String, + status: Lithic::Models::TransactionListParams::status + } + & Lithic::request_parameters + + class TransactionListParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::TransactionListParams::result? + + def result=: ( + Lithic::Models::TransactionListParams::result + ) -> Lithic::Models::TransactionListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::TransactionListParams::status? + + def status=: ( + Lithic::Models::TransactionListParams::status + ) -> Lithic::Models::TransactionListParams::status + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?card_token: String, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?result: Lithic::Models::TransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::TransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_list_params + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::TransactionListParams::result] + end + + type status = :PENDING | :VOIDED | :SETTLED | :DECLINED | :EXPIRED + + module Status + extend Lithic::Enum + + PENDING: :PENDING + VOIDED: :VOIDED + SETTLED: :SETTLED + DECLINED: :DECLINED + EXPIRED: :EXPIRED + + def self?.values: -> ::Array[Lithic::Models::TransactionListParams::status] + end + end + end +end diff --git a/sig/lithic/models/transaction_retrieve_params.rbs b/sig/lithic/models/transaction_retrieve_params.rbs new file mode 100644 index 00000000..f6ce4539 --- /dev/null +++ b/sig/lithic/models/transaction_retrieve_params.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type transaction_retrieve_params = { } & Lithic::request_parameters + + class TransactionRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::transaction_retrieve_params + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_advice_params.rbs b/sig/lithic/models/transaction_simulate_authorization_advice_params.rbs new file mode 100644 index 00000000..6cea1784 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_advice_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type transaction_simulate_authorization_advice_params = + { token: String, amount: Integer } & Lithic::request_parameters + + class TransactionSimulateAuthorizationAdviceParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor token: String + + attr_accessor amount: Integer + + def initialize: ( + token: String, + amount: Integer, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_authorization_advice_params + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_advice_response.rbs b/sig/lithic/models/transaction_simulate_authorization_advice_response.rbs new file mode 100644 index 00000000..dd85cb82 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_advice_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_authorization_advice_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateAuthorizationAdviceResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_authorization_advice_response + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_params.rbs b/sig/lithic/models/transaction_simulate_authorization_params.rbs new file mode 100644 index 00000000..4bc9763e --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_params.rbs @@ -0,0 +1,94 @@ +module Lithic + module Models + type transaction_simulate_authorization_params = + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: bool, + pin: String, + status: Lithic::Models::TransactionSimulateAuthorizationParams::status + } + & Lithic::request_parameters + + class TransactionSimulateAuthorizationParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor descriptor: String + + attr_accessor pan: String + + attr_reader mcc: String? + + def mcc=: (String) -> String + + attr_reader merchant_acceptor_id: String? + + def merchant_acceptor_id=: (String) -> String + + attr_reader merchant_amount: Integer? + + def merchant_amount=: (Integer) -> Integer + + attr_reader merchant_currency: String? + + def merchant_currency=: (String) -> String + + attr_reader partial_approval_capable: bool? + + def partial_approval_capable=: (bool) -> bool + + attr_reader pin: String? + + def pin=: (String) -> String + + attr_reader status: Lithic::Models::TransactionSimulateAuthorizationParams::status? + + def status=: ( + Lithic::Models::TransactionSimulateAuthorizationParams::status + ) -> Lithic::Models::TransactionSimulateAuthorizationParams::status + + def initialize: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_id: String, + ?merchant_amount: Integer, + ?merchant_currency: String, + ?partial_approval_capable: bool, + ?pin: String, + ?status: Lithic::Models::TransactionSimulateAuthorizationParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_authorization_params + + type status = + :AUTHORIZATION + | :BALANCE_INQUIRY + | :CREDIT_AUTHORIZATION + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + + module Status + extend Lithic::Enum + + AUTHORIZATION: :AUTHORIZATION + BALANCE_INQUIRY: :BALANCE_INQUIRY + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + + def self?.values: -> ::Array[Lithic::Models::TransactionSimulateAuthorizationParams::status] + end + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_response.rbs b/sig/lithic/models/transaction_simulate_authorization_response.rbs new file mode 100644 index 00000000..0048d211 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_authorization_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateAuthorizationResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_authorization_response + end + end +end diff --git a/sig/lithic/models/transaction_simulate_clearing_params.rbs b/sig/lithic/models/transaction_simulate_clearing_params.rbs new file mode 100644 index 00000000..6bb9fedb --- /dev/null +++ b/sig/lithic/models/transaction_simulate_clearing_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + type transaction_simulate_clearing_params = + { token: String, amount: Integer } & Lithic::request_parameters + + class TransactionSimulateClearingParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor token: String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + def initialize: ( + token: String, + ?amount: Integer, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_clearing_params + end + end +end diff --git a/sig/lithic/models/transaction_simulate_clearing_response.rbs b/sig/lithic/models/transaction_simulate_clearing_response.rbs new file mode 100644 index 00000000..5e8be34d --- /dev/null +++ b/sig/lithic/models/transaction_simulate_clearing_response.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type transaction_simulate_clearing_response = + { debugging_request_id: String } + + class TransactionSimulateClearingResponse < Lithic::BaseModel + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?debugging_request_id: String) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_clearing_response + end + end +end diff --git a/sig/lithic/models/transaction_simulate_credit_authorization_params.rbs b/sig/lithic/models/transaction_simulate_credit_authorization_params.rbs new file mode 100644 index 00000000..e0eabefc --- /dev/null +++ b/sig/lithic/models/transaction_simulate_credit_authorization_params.rbs @@ -0,0 +1,43 @@ +module Lithic + module Models + type transaction_simulate_credit_authorization_params = + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_id: String + } + & Lithic::request_parameters + + class TransactionSimulateCreditAuthorizationParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor descriptor: String + + attr_accessor pan: String + + attr_reader mcc: String? + + def mcc=: (String) -> String + + attr_reader merchant_acceptor_id: String? + + def merchant_acceptor_id=: (String) -> String + + def initialize: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_credit_authorization_params + end + end +end diff --git a/sig/lithic/models/transaction_simulate_credit_authorization_response.rbs b/sig/lithic/models/transaction_simulate_credit_authorization_response.rbs new file mode 100644 index 00000000..cd00b03a --- /dev/null +++ b/sig/lithic/models/transaction_simulate_credit_authorization_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_credit_authorization_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateCreditAuthorizationResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_credit_authorization_response + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_params.rbs b/sig/lithic/models/transaction_simulate_return_params.rbs new file mode 100644 index 00000000..e83473be --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_params.rbs @@ -0,0 +1,27 @@ +module Lithic + module Models + type transaction_simulate_return_params = + { amount: Integer, descriptor: String, pan: String } + & Lithic::request_parameters + + class TransactionSimulateReturnParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor descriptor: String + + attr_accessor pan: String + + def initialize: ( + amount: Integer, + descriptor: String, + pan: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_return_params + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_response.rbs b/sig/lithic/models/transaction_simulate_return_response.rbs new file mode 100644 index 00000000..03852f21 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_return_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateReturnResponse < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_return_response + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_reversal_params.rbs b/sig/lithic/models/transaction_simulate_return_reversal_params.rbs new file mode 100644 index 00000000..55d842e0 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_reversal_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_return_reversal_params = + { token: String } & Lithic::request_parameters + + class TransactionSimulateReturnReversalParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor token: String + + def initialize: ( + token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_return_reversal_params + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_reversal_response.rbs b/sig/lithic/models/transaction_simulate_return_reversal_response.rbs new file mode 100644 index 00000000..5b32a051 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_reversal_response.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type transaction_simulate_return_reversal_response = + { debugging_request_id: String } + + class TransactionSimulateReturnReversalResponse < Lithic::BaseModel + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?debugging_request_id: String) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_return_reversal_response + end + end +end diff --git a/sig/lithic/models/transaction_simulate_void_params.rbs b/sig/lithic/models/transaction_simulate_void_params.rbs new file mode 100644 index 00000000..678e34b9 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_void_params.rbs @@ -0,0 +1,48 @@ +module Lithic + module Models + type transaction_simulate_void_params = + { + token: String, + amount: Integer, + type: Lithic::Models::TransactionSimulateVoidParams::type_ + } + & Lithic::request_parameters + + class TransactionSimulateVoidParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor token: String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader type: Lithic::Models::TransactionSimulateVoidParams::type_? + + def type=: ( + Lithic::Models::TransactionSimulateVoidParams::type_ + ) -> Lithic::Models::TransactionSimulateVoidParams::type_ + + def initialize: ( + token: String, + ?amount: Integer, + ?type: Lithic::Models::TransactionSimulateVoidParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_void_params + + type type_ = :AUTHORIZATION_EXPIRY | :AUTHORIZATION_REVERSAL + + module Type + extend Lithic::Enum + + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::TransactionSimulateVoidParams::type_] + end + end + end +end diff --git a/sig/lithic/models/transaction_simulate_void_response.rbs b/sig/lithic/models/transaction_simulate_void_response.rbs new file mode 100644 index 00000000..41cd6bc6 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_void_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type transaction_simulate_void_response = { debugging_request_id: String } + + class TransactionSimulateVoidResponse < Lithic::BaseModel + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?debugging_request_id: String) -> void + + def to_hash: -> Lithic::Models::transaction_simulate_void_response + end + end +end diff --git a/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbs b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbs new file mode 100644 index 00000000..1761b7c3 --- /dev/null +++ b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module Transactions + type enhanced_commercial_data_retrieve_params = + { } & Lithic::request_parameters + + class EnhancedCommercialDataRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Transactions::enhanced_commercial_data_retrieve_params + end + end + end +end diff --git a/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbs b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbs new file mode 100644 index 00000000..d4cb2258 --- /dev/null +++ b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + module Transactions + type enhanced_commercial_data_retrieve_response = + { data: ::Array[Lithic::Models::Transactions::Events::EnhancedData] } + + class EnhancedCommercialDataRetrieveResponse < Lithic::BaseModel + attr_accessor data: ::Array[Lithic::Models::Transactions::Events::EnhancedData] + + def initialize: ( + data: ::Array[Lithic::Models::Transactions::Events::EnhancedData] + ) -> void + + def to_hash: -> Lithic::Models::Transactions::enhanced_commercial_data_retrieve_response + end + end + end +end diff --git a/sig/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbs b/sig/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbs new file mode 100644 index 00000000..bf9c71e2 --- /dev/null +++ b/sig/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbs @@ -0,0 +1,19 @@ +module Lithic + module Models + module Transactions + module Events + type enhanced_commercial_data_retrieve_params = + { } & Lithic::request_parameters + + class EnhancedCommercialDataRetrieveParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::enhanced_commercial_data_retrieve_params + end + end + end + end +end diff --git a/sig/lithic/models/transactions/events/enhanced_data.rbs b/sig/lithic/models/transactions/events/enhanced_data.rbs new file mode 100644 index 00000000..53bbcc30 --- /dev/null +++ b/sig/lithic/models/transactions/events/enhanced_data.rbs @@ -0,0 +1,547 @@ +module Lithic + module Models + module Transactions + module Events + type enhanced_data = + { + token: String, + common: Lithic::Models::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet], + transaction_token: String + } + + class EnhancedData < Lithic::BaseModel + attr_accessor token: String + + attr_accessor common: Lithic::Models::Transactions::Events::EnhancedData::Common + + attr_accessor event_token: String + + attr_accessor fleet: ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet] + + attr_accessor transaction_token: String + + def initialize: ( + token: String, + common: Lithic::Models::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet], + transaction_token: String + ) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::enhanced_data + + type common = + { + line_items: ::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::LineItem], + tax: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax, + customer_reference_number: String, + merchant_reference_number: String, + order_date: Date + } + + class Common < Lithic::BaseModel + attr_accessor line_items: ::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::LineItem] + + attr_accessor tax: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax + + attr_reader customer_reference_number: String? + + def customer_reference_number=: (String) -> String + + attr_reader merchant_reference_number: String? + + def merchant_reference_number=: (String) -> String + + attr_reader order_date: Date? + + def order_date=: (Date) -> Date + + def initialize: ( + line_items: ::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::LineItem], + tax: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax, + ?customer_reference_number: String, + ?merchant_reference_number: String, + ?order_date: Date + ) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::EnhancedData::common + + type line_item = + { + amount: Float, + description: String, + product_code: String, + quantity: Float + } + + class LineItem < Lithic::BaseModel + attr_reader amount: Float? + + def amount=: (Float) -> Float + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader product_code: String? + + def product_code=: (String) -> String + + attr_reader quantity: Float? + + def quantity=: (Float) -> Float + + def initialize: ( + ?amount: Float, + ?description: String, + ?product_code: String, + ?quantity: Float + ) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::EnhancedData::Common::line_item + end + + type tax = + { + amount: Integer, + exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt, + merchant_tax_id: String + } + + class Tax < Lithic::BaseModel + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt? + + def exempt=: ( + Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt + ) -> Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt + + attr_reader merchant_tax_id: String? + + def merchant_tax_id=: (String) -> String + + def initialize: ( + ?amount: Integer, + ?exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt, + ?merchant_tax_id: String + ) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::EnhancedData::Common::tax + + type exempt = :TAX_INCLUDED | :TAX_NOT_INCLUDED | :NOT_SUPPORTED + + module Exempt + extend Lithic::Enum + + TAX_INCLUDED: :TAX_INCLUDED + TAX_NOT_INCLUDED: :TAX_NOT_INCLUDED + NOT_SUPPORTED: :NOT_SUPPORTED + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt] + end + end + end + + type fleet = + { + amount_totals: Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals, + fuel: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel, + driver_number: String, + odometer: Integer, + service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type, + vehicle_number: String + } + + class Fleet < Lithic::BaseModel + attr_accessor amount_totals: Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals + + attr_accessor fuel: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel + + attr_reader driver_number: String? + + def driver_number=: (String) -> String + + attr_reader odometer: Integer? + + def odometer=: (Integer) -> Integer + + attr_reader service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type? + + def service_type=: ( + Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type + ) -> Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type + + attr_reader vehicle_number: String? + + def vehicle_number=: (String) -> String + + def initialize: ( + amount_totals: Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals, + fuel: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel, + ?driver_number: String, + ?odometer: Integer, + ?service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type, + ?vehicle_number: String + ) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::EnhancedData::fleet + + type amount_totals = + { discount: Integer, gross_sale: Integer, net_sale: Integer } + + class AmountTotals < Lithic::BaseModel + attr_reader discount: Integer? + + def discount=: (Integer) -> Integer + + attr_reader gross_sale: Integer? + + def gross_sale=: (Integer) -> Integer + + attr_reader net_sale: Integer? + + def net_sale=: (Integer) -> Integer + + def initialize: ( + ?discount: Integer, + ?gross_sale: Integer, + ?net_sale: Integer + ) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::EnhancedData::Fleet::amount_totals + end + + type fuel = + { + quantity: Float, + type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_, + unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure, + unit_price: Integer + } + + class Fuel < Lithic::BaseModel + attr_reader quantity: Float? + + def quantity=: (Float) -> Float + + attr_reader type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_? + + def type=: ( + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_ + ) -> Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_ + + attr_reader unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure? + + def unit_of_measure=: ( + Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure + ) -> Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure + + attr_reader unit_price: Integer? + + def unit_price=: (Integer) -> Integer + + def initialize: ( + ?quantity: Float, + ?type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_, + ?unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure, + ?unit_price: Integer + ) -> void + + def to_hash: -> Lithic::Models::Transactions::Events::EnhancedData::Fleet::fuel + + type type_ = + :UNKNOWN + | :REGULAR + | :MID_PLUS + | :PREMIUM_SUPER + | :MID_PLUS_2 + | :PREMIUM_SUPER_2 + | :ETHANOL_5_7_BLEND + | :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND + | :ETHANOL_7_7_PERCENT_BLEND + | :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND + | :GREEN_GASOLINE_REGULAR + | :GREEN_GASOLINE_MID_PLUS + | :GREEN_GASOLINE_PREMIUM_SUPER + | :REGULAR_DIESEL_2 + | :PREMIUM_DIESEL_2 + | :REGULAR_DIESEL_1 + | :COMPRESSED_NATURAL_GAS + | :LIQUID_PROPANE_GAS + | :LIQUID_NATURAL_GAS + | :E_85 + | :REFORMULATED_1 + | :REFORMULATED_2 + | :REFORMULATED_3 + | :REFORMULATED_4 + | :REFORMULATED_5 + | :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE + | :DIESEL_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE + | :UNDEFINED_FUEL + | :RACING_FUEL + | :MID_PLUS_2_10_PERCENT_BLEND + | :PREMIUM_SUPER_2_10_PERCENT_BLEND + | :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND + | :REGULAR_ETHANOL_10_PERCENT_BLEND + | :MID_PLUS_ETHANOL_10_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND + | :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL + | :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL + | :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL + | :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL + | :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL + | :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL + | :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL + | :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL + | :ADDITIZED_DIESEL_2 + | :ADDITIZED_DIESEL_3 + | :RENEWABLE_DIESEL_R95 + | :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT + | :DIESEL_EXHAUST_FLUID + | :PREMIUM_DIESEL_1 + | :REGULAR_ETHANOL_15_PERCENT_BLEND + | :MID_PLUS_ETHANOL_15_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND + | :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL + | :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL + | :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL + | :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL + | :MISCELLANEOUS_FUEL + | :JET_FUEL + | :AVIATION_FUEL_REGULAR + | :AVIATION_FUEL_PREMIUM + | :AVIATION_FUEL_JP8 + | :AVIATION_FUEL_4 + | :AVIATION_FUEL_5 + | :BIOJET_DIESEL + | :AVIATION_BIOFUEL_GASOLINE + | :MISCELLANEOUS_AVIATION_FUEL + | :MARINE_FUEL_1 + | :MARINE_FUEL_2 + | :MARINE_FUEL_3 + | :MARINE_FUEL_4 + | :MARINE_FUEL_5 + | :MARINE_OTHER + | :MARINE_DIESEL + | :MISCELLANEOUS_MARINE_FUEL + | :KEROSENE_LOW_SULFUR + | :WHITE_GAS + | :HEATING_OIL + | :OTHER_FUEL_NON_TAXABLE + | :KEROSENE_ULTRA_LOW_SULFUR + | :KEROSENE_LOW_SULFUR_NON_TAXABLE + | :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE + | :EVC_1_LEVEL_1_CHARGE_110V_15_AMP + | :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP + | :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE + | :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE + | :DIESEL_1_OFF_ROAD_NON_TAXABLE + | :DIESEL_2_OFF_ROAD_NON_TAXABLE + | :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE + | :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE + | :ADDITIVE_DOSAGE + | :ETHANOL_BLENDS_E16_E84 + | :LOW_OCTANE_UNL + | :BLENDED_DIESEL_1_AND_2 + | :OFF_ROAD_REGULAR_NON_TAXABLE + | :OFF_ROAD_MID_PLUS_NON_TAXABLE + | :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE + | :OFF_ROAD_MID_PLUS_2_NON_TAXABLE + | :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE + | :RECREATIONAL_FUEL_90_OCTANE + | :HYDROGEN_H35 + | :HYDROGEN_H70 + | :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE + | :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE + | :MISCELLANEOUS_OTHER_FUEL + + module Type + extend Lithic::Enum + + UNKNOWN: :UNKNOWN + REGULAR: :REGULAR + MID_PLUS: :MID_PLUS + PREMIUM_SUPER: :PREMIUM_SUPER + MID_PLUS_2: :MID_PLUS_2 + PREMIUM_SUPER_2: :PREMIUM_SUPER_2 + ETHANOL_5_7_BLEND: :ETHANOL_5_7_BLEND + MID_PLUS_ETHANOL_5_7_PERCENT_BLEND: :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND + ETHANOL_7_7_PERCENT_BLEND: :ETHANOL_7_7_PERCENT_BLEND + MID_PLUS_ETHANOL_7_7_PERCENT_BLEND: :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND + GREEN_GASOLINE_REGULAR: :GREEN_GASOLINE_REGULAR + GREEN_GASOLINE_MID_PLUS: :GREEN_GASOLINE_MID_PLUS + GREEN_GASOLINE_PREMIUM_SUPER: :GREEN_GASOLINE_PREMIUM_SUPER + REGULAR_DIESEL_2: :REGULAR_DIESEL_2 + PREMIUM_DIESEL_2: :PREMIUM_DIESEL_2 + REGULAR_DIESEL_1: :REGULAR_DIESEL_1 + COMPRESSED_NATURAL_GAS: :COMPRESSED_NATURAL_GAS + LIQUID_PROPANE_GAS: :LIQUID_PROPANE_GAS + LIQUID_NATURAL_GAS: :LIQUID_NATURAL_GAS + E_85: :E_85 + REFORMULATED_1: :REFORMULATED_1 + REFORMULATED_2: :REFORMULATED_2 + REFORMULATED_3: :REFORMULATED_3 + REFORMULATED_4: :REFORMULATED_4 + REFORMULATED_5: :REFORMULATED_5 + DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE: :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE + DIESEL_OFF_ROAD_NON_TAXABLE: :DIESEL_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE + UNDEFINED_FUEL: :UNDEFINED_FUEL + RACING_FUEL: :RACING_FUEL + MID_PLUS_2_10_PERCENT_BLEND: :MID_PLUS_2_10_PERCENT_BLEND + PREMIUM_SUPER_2_10_PERCENT_BLEND: :PREMIUM_SUPER_2_10_PERCENT_BLEND + MID_PLUS_ETHANOL_2_15_PERCENT_BLEND: :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND + REGULAR_ETHANOL_10_PERCENT_BLEND: :REGULAR_ETHANOL_10_PERCENT_BLEND + MID_PLUS_ETHANOL_10_PERCENT_BLEND: :MID_PLUS_ETHANOL_10_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND + B2_DIESEL_BLEND_2_PERCENT_BIODIESEL: :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL + B5_DIESEL_BLEND_5_PERCENT_BIODIESEL: :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL + B10_DIESEL_BLEND_10_PERCENT_BIODIESEL: :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL + B11_DIESEL_BLEND_11_PERCENT_BIODIESEL: :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL + B15_DIESEL_BLEND_15_PERCENT_BIODIESEL: :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL + B20_DIESEL_BLEND_20_PERCENT_BIODIESEL: :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL + B100_DIESEL_BLEND_100_PERCENT_BIODIESEL: :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL + B1_DIESEL_BLEND_1_PERCENT_BIODIESEL: :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL + ADDITIZED_DIESEL_2: :ADDITIZED_DIESEL_2 + ADDITIZED_DIESEL_3: :ADDITIZED_DIESEL_3 + RENEWABLE_DIESEL_R95: :RENEWABLE_DIESEL_R95 + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT: :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT + DIESEL_EXHAUST_FLUID: :DIESEL_EXHAUST_FLUID + PREMIUM_DIESEL_1: :PREMIUM_DIESEL_1 + REGULAR_ETHANOL_15_PERCENT_BLEND: :REGULAR_ETHANOL_15_PERCENT_BLEND + MID_PLUS_ETHANOL_15_PERCENT_BLEND: :MID_PLUS_ETHANOL_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND + PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL: :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL + PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL: :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL + B75_DIESEL_BLEND_75_PERCENT_BIODIESEL: :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL + B99_DIESEL_BLEND_99_PERCENT_BIODIESEL: :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL + MISCELLANEOUS_FUEL: :MISCELLANEOUS_FUEL + JET_FUEL: :JET_FUEL + AVIATION_FUEL_REGULAR: :AVIATION_FUEL_REGULAR + AVIATION_FUEL_PREMIUM: :AVIATION_FUEL_PREMIUM + AVIATION_FUEL_JP8: :AVIATION_FUEL_JP8 + AVIATION_FUEL_4: :AVIATION_FUEL_4 + AVIATION_FUEL_5: :AVIATION_FUEL_5 + BIOJET_DIESEL: :BIOJET_DIESEL + AVIATION_BIOFUEL_GASOLINE: :AVIATION_BIOFUEL_GASOLINE + MISCELLANEOUS_AVIATION_FUEL: :MISCELLANEOUS_AVIATION_FUEL + MARINE_FUEL_1: :MARINE_FUEL_1 + MARINE_FUEL_2: :MARINE_FUEL_2 + MARINE_FUEL_3: :MARINE_FUEL_3 + MARINE_FUEL_4: :MARINE_FUEL_4 + MARINE_FUEL_5: :MARINE_FUEL_5 + MARINE_OTHER: :MARINE_OTHER + MARINE_DIESEL: :MARINE_DIESEL + MISCELLANEOUS_MARINE_FUEL: :MISCELLANEOUS_MARINE_FUEL + KEROSENE_LOW_SULFUR: :KEROSENE_LOW_SULFUR + WHITE_GAS: :WHITE_GAS + HEATING_OIL: :HEATING_OIL + OTHER_FUEL_NON_TAXABLE: :OTHER_FUEL_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR: :KEROSENE_ULTRA_LOW_SULFUR + KEROSENE_LOW_SULFUR_NON_TAXABLE: :KEROSENE_LOW_SULFUR_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE: :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE + EVC_1_LEVEL_1_CHARGE_110_V_15_AMP: :EVC_1_LEVEL_1_CHARGE_110V_15_AMP + EVC_2_LEVEL_2_CHARGE_240_V_15_40_AMP: :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP + EVC_3_LEVEL_3_CHARGE_480_V_3_PHASE_CHARGE: :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE + BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE + DIESEL_1_OFF_ROAD_NON_TAXABLE: :DIESEL_1_OFF_ROAD_NON_TAXABLE + DIESEL_2_OFF_ROAD_NON_TAXABLE: :DIESEL_2_OFF_ROAD_NON_TAXABLE + DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE: :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE + DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE: :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE + ADDITIVE_DOSAGE: :ADDITIVE_DOSAGE + ETHANOL_BLENDS_E16_E84: :ETHANOL_BLENDS_E16_E84 + LOW_OCTANE_UNL: :LOW_OCTANE_UNL + BLENDED_DIESEL_1_AND_2: :BLENDED_DIESEL_1_AND_2 + OFF_ROAD_REGULAR_NON_TAXABLE: :OFF_ROAD_REGULAR_NON_TAXABLE + OFF_ROAD_MID_PLUS_NON_TAXABLE: :OFF_ROAD_MID_PLUS_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE: :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE + OFF_ROAD_MID_PLUS_2_NON_TAXABLE: :OFF_ROAD_MID_PLUS_2_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE: :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE + RECREATIONAL_FUEL_90_OCTANE: :RECREATIONAL_FUEL_90_OCTANE + HYDROGEN_H35: :HYDROGEN_H35 + HYDROGEN_H70: :HYDROGEN_H70 + RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE: :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE: :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE + MISCELLANEOUS_OTHER_FUEL: :MISCELLANEOUS_OTHER_FUEL + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_] + end + + type unit_of_measure = + :GALLONS + | :LITERS + | :POUNDS + | :KILOGRAMS + | :IMPERIAL_GALLONS + | :NOT_APPLICABLE + | :UNKNOWN + + module UnitOfMeasure + extend Lithic::Enum + + GALLONS: :GALLONS + LITERS: :LITERS + POUNDS: :POUNDS + KILOGRAMS: :KILOGRAMS + IMPERIAL_GALLONS: :IMPERIAL_GALLONS + NOT_APPLICABLE: :NOT_APPLICABLE + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure] + end + end + + type service_type = + :UNKNOWN + | :UNDEFINED + | :SELF_SERVICE + | :FULL_SERVICE + | :NON_FUEL_ONLY + + module ServiceType + extend Lithic::Enum + + UNKNOWN: :UNKNOWN + UNDEFINED: :UNDEFINED + SELF_SERVICE: :SELF_SERVICE + FULL_SERVICE: :FULL_SERVICE + NON_FUEL_ONLY: :NON_FUEL_ONLY + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type] + end + end + end + end + end + end +end diff --git a/sig/lithic/models/transfer.rbs b/sig/lithic/models/transfer.rbs new file mode 100644 index 00000000..6c511a03 --- /dev/null +++ b/sig/lithic/models/transfer.rbs @@ -0,0 +1,332 @@ +module Lithic + module Models + type transfer = + { + token: String, + category: Lithic::Models::Transfer::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::Models::Transfer::Event], + from_balance: ::Array[Lithic::Models::Balance], + pending_amount: Integer, + result: Lithic::Models::Transfer::result, + settled_amount: Integer, + status: Lithic::Models::Transfer::status, + to_balance: ::Array[Lithic::Models::Balance], + updated: Time + } + + class Transfer < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader category: Lithic::Models::Transfer::category? + + def category=: ( + Lithic::Models::Transfer::category + ) -> Lithic::Models::Transfer::category + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader descriptor: String? + + def descriptor=: (String) -> String + + attr_reader events: ::Array[Lithic::Models::Transfer::Event]? + + def events=: ( + ::Array[Lithic::Models::Transfer::Event] + ) -> ::Array[Lithic::Models::Transfer::Event] + + attr_reader from_balance: ::Array[Lithic::Models::Balance]? + + def from_balance=: ( + ::Array[Lithic::Models::Balance] + ) -> ::Array[Lithic::Models::Balance] + + attr_reader pending_amount: Integer? + + def pending_amount=: (Integer) -> Integer + + attr_reader result: Lithic::Models::Transfer::result? + + def result=: ( + Lithic::Models::Transfer::result + ) -> Lithic::Models::Transfer::result + + attr_reader settled_amount: Integer? + + def settled_amount=: (Integer) -> Integer + + attr_reader status: Lithic::Models::Transfer::status? + + def status=: ( + Lithic::Models::Transfer::status + ) -> Lithic::Models::Transfer::status + + attr_reader to_balance: ::Array[Lithic::Models::Balance]? + + def to_balance=: ( + ::Array[Lithic::Models::Balance] + ) -> ::Array[Lithic::Models::Balance] + + attr_reader updated: Time? + + def updated=: (Time) -> Time + + def initialize: ( + ?token: String, + ?category: Lithic::Models::Transfer::category, + ?created: Time, + ?currency: String, + ?descriptor: String, + ?events: ::Array[Lithic::Models::Transfer::Event], + ?from_balance: ::Array[Lithic::Models::Balance], + ?pending_amount: Integer, + ?result: Lithic::Models::Transfer::result, + ?settled_amount: Integer, + ?status: Lithic::Models::Transfer::status, + ?to_balance: ::Array[Lithic::Models::Balance], + ?updated: Time + ) -> void + + def to_hash: -> Lithic::Models::transfer + + type category = :TRANSFER + + module Category + extend Lithic::Enum + + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::Transfer::category] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Transfer::Event::result, + type: Lithic::Models::Transfer::Event::type_ + } + + class Event < Lithic::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader result: Lithic::Models::Transfer::Event::result? + + def result=: ( + Lithic::Models::Transfer::Event::result + ) -> Lithic::Models::Transfer::Event::result + + attr_reader type: Lithic::Models::Transfer::Event::type_? + + def type=: ( + Lithic::Models::Transfer::Event::type_ + ) -> Lithic::Models::Transfer::Event::type_ + + def initialize: ( + ?token: String, + ?amount: Integer, + ?created: Time, + ?result: Lithic::Models::Transfer::Event::result, + ?type: Lithic::Models::Transfer::Event::type_ + ) -> void + + def to_hash: -> Lithic::Models::Transfer::event + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Transfer::Event::result] + end + + type type_ = + :ACH_ORIGINATION_CANCELLED + | :ACH_ORIGINATION_INITIATED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_PROCESSED + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_SETTLED + | :AUTHORIZATION + | :AUTHORIZATION_ADVICE + | :AUTHORIZATION_EXPIRY + | :AUTHORIZATION_REVERSAL + | :BALANCE_INQUIRY + | :BILLING_ERROR + | :BILLING_ERROR_REVERSAL + | :CARD_TO_CARD + | :CASH_BACK + | :CASH_BACK_REVERSAL + | :CLEARING + | :CORRECTION_CREDIT + | :CORRECTION_DEBIT + | :CREDIT_AUTHORIZATION + | :CREDIT_AUTHORIZATION_ADVICE + | :CURRENCY_CONVERSION + | :CURRENCY_CONVERSION_REVERSAL + | :DISPUTE_WON + | :EXTERNAL_ACH_CANCELED + | :EXTERNAL_ACH_INITIATED + | :EXTERNAL_ACH_RELEASED + | :EXTERNAL_ACH_REVERSED + | :EXTERNAL_ACH_SETTLED + | :EXTERNAL_CHECK_CANCELED + | :EXTERNAL_CHECK_INITIATED + | :EXTERNAL_CHECK_RELEASED + | :EXTERNAL_CHECK_REVERSED + | :EXTERNAL_CHECK_SETTLED + | :EXTERNAL_TRANSFER_CANCELED + | :EXTERNAL_TRANSFER_INITIATED + | :EXTERNAL_TRANSFER_RELEASED + | :EXTERNAL_TRANSFER_REVERSED + | :EXTERNAL_TRANSFER_SETTLED + | :EXTERNAL_WIRE_CANCELED + | :EXTERNAL_WIRE_INITIATED + | :EXTERNAL_WIRE_RELEASED + | :EXTERNAL_WIRE_REVERSED + | :EXTERNAL_WIRE_SETTLED + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :INTEREST + | :INTEREST_REVERSAL + | :INTERNAL_ADJUSTMENT + | :LATE_PAYMENT + | :LATE_PAYMENT_REVERSAL + | :PROVISIONAL_CREDIT + | :PROVISIONAL_CREDIT_REVERSAL + | :RETURN + | :RETURN_REVERSAL + | :TRANSFER + | :TRANSFER_INSUFFICIENT_FUNDS + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + + module Type + extend Lithic::Enum + + ACH_ORIGINATION_CANCELLED: :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED: :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + AUTHORIZATION: :AUTHORIZATION + AUTHORIZATION_ADVICE: :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY: :BALANCE_INQUIRY + BILLING_ERROR: :BILLING_ERROR + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + CARD_TO_CARD: :CARD_TO_CARD + CASH_BACK: :CASH_BACK + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CLEARING: :CLEARING + CORRECTION_CREDIT: :CORRECTION_CREDIT + CORRECTION_DEBIT: :CORRECTION_DEBIT + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE: :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON: :DISPUTE_WON + EXTERNAL_ACH_CANCELED: :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED: :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED: :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED: :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED: :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED: :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED: :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED: :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED: :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED: :EXTERNAL_CHECK_SETTLED + EXTERNAL_TRANSFER_CANCELED: :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED: :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED: :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED: :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED: :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED: :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED: :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED: :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED: :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED: :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST: :INTEREST + INTEREST_REVERSAL: :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT: :INTERNAL_ADJUSTMENT + LATE_PAYMENT: :LATE_PAYMENT + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + RETURN: :RETURN + RETURN_REVERSAL: :RETURN_REVERSAL + TRANSFER: :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS: :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::Transfer::Event::type_] + end + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Transfer::result] + end + + type status = :DECLINED | :EXPIRED | :PENDING | :SETTLED | :VOIDED + + module Status + extend Lithic::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::Transfer::status] + end + end + end +end diff --git a/sig/lithic/models/transfer_create_params.rbs b/sig/lithic/models/transfer_create_params.rbs new file mode 100644 index 00000000..0603c312 --- /dev/null +++ b/sig/lithic/models/transfer_create_params.rbs @@ -0,0 +1,37 @@ +module Lithic + module Models + type transfer_create_params = + { amount: Integer, from: String, to: String, token: String, memo: String } + & Lithic::request_parameters + + class TransferCreateParams < Lithic::BaseModel + extend Lithic::RequestParameters::Converter + include Lithic::RequestParameters + + attr_accessor amount: Integer + + attr_accessor from: String + + attr_accessor to: String + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + amount: Integer, + from: String, + to: String, + ?token: String, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> Lithic::Models::transfer_create_params + end + end +end diff --git a/sig/lithic/models/verification_method.rbs b/sig/lithic/models/verification_method.rbs new file mode 100644 index 00000000..364ba53f --- /dev/null +++ b/sig/lithic/models/verification_method.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type verification_method = + :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE | :EXTERNALLY_VERIFIED + + module VerificationMethod + extend Lithic::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + EXTERNALLY_VERIFIED: :EXTERNALLY_VERIFIED + + def self?.values: -> ::Array[Lithic::Models::verification_method] + end + end +end diff --git a/sig/lithic/pooled_net_requester.rbs b/sig/lithic/pooled_net_requester.rbs new file mode 100644 index 00000000..7470e644 --- /dev/null +++ b/sig/lithic/pooled_net_requester.rbs @@ -0,0 +1,37 @@ +module Lithic + class PooledNetRequester + type request = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + deadline: Float + } + + KEEP_ALIVE_TIMEOUT: 30 + + def self.connect: (URI::Generic url) -> top + + def self.calibrate_socket_timeout: (top conn, Float deadline) -> void + + def self.build_request: ( + Lithic::PooledNetRequester::request request + ) { + (String arg0) -> void + } -> top + + private def with_pool: ( + URI::Generic url, + deadline: Float + ) { + (top arg0) -> void + } -> void + + def execute: ( + Lithic::PooledNetRequester::request request + ) -> [Integer, top, Enumerable[String]] + + def initialize: (?size: Integer) -> void + end +end diff --git a/sig/lithic/request_options.rbs b/sig/lithic/request_options.rbs new file mode 100644 index 00000000..521cf241 --- /dev/null +++ b/sig/lithic/request_options.rbs @@ -0,0 +1,44 @@ +module Lithic + type request_opts = + Lithic::RequestOptions | Lithic::request_options | ::Hash[Symbol, top] + + type request_parameters = { request_options: Lithic::request_opts } + + module RequestParameters + attr_accessor request_options: Lithic::request_opts + + module Converter + def dump_request: (top params) -> [top, ::Hash[Symbol, top]] + end + end + + type request_options = + { + idempotency_key: String?, + extra_query: ::Hash[String, (::Array[String] | String)?]?, + extra_headers: ::Hash[String, String?]?, + extra_body: top?, + max_retries: Integer?, + timeout: Float? + } + + class RequestOptions < Lithic::BaseModel + def self.validate!: (self | ::Hash[Symbol, top] opts) -> void + + attr_accessor idempotency_key: String? + + attr_accessor extra_query: ::Hash[String, (::Array[String] | String)?]? + + attr_accessor extra_headers: ::Hash[String, String?]? + + attr_accessor extra_body: top? + + attr_accessor max_retries: Integer? + + attr_accessor timeout: Float? + + def initialize: ( + ?Lithic::request_options | ::Hash[Symbol, top] values + ) -> void + end +end diff --git a/sig/lithic/resources/account_holders.rbs b/sig/lithic/resources/account_holders.rbs new file mode 100644 index 00000000..5d0d2107 --- /dev/null +++ b/sig/lithic/resources/account_holders.rbs @@ -0,0 +1,103 @@ +module Lithic + module Resources + class AccountHolders + def create: ( + beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerEntity], + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderCreateParams::BeneficialOwnerIndividual], + business_entity: Lithic::Models::AccountHolderCreateParams::BusinessEntity, + control_person: Lithic::Models::AccountHolderCreateParams::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::AccountHolderCreateParams::workflow, + individual: Lithic::Models::AccountHolderCreateParams::Individual, + address: Lithic::Models::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::AccountHolderCreateParams::kyc_exemption_type, + last_name: String, + phone_number: String, + ?external_id: String, + ?kyb_passed_timestamp: String, + ?website_url: String, + ?kyc_passed_timestamp: String, + ?business_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolderCreateResponse + + def retrieve: ( + String account_holder_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolder + + def update: ( + String account_holder_token, + ?beneficial_owner_entities: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerEntity], + ?beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateParams::BeneficialOwnerIndividual], + ?business_entity: Lithic::Models::AccountHolderUpdateParams::BusinessEntity, + ?control_person: Lithic::Models::AccountHolderUpdateParams::ControlPerson, + ?external_id: String, + ?nature_of_business: String, + ?website_url: String, + ?individual: Lithic::Models::AccountHolderUpdateParams::Individual, + ?address: Lithic::Models::AddressUpdate, + ?business_account_token: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::account_holder_update_response + + def list: ( + ?begin_: Time, + ?email: String, + ?end_: Time, + ?ending_before: String, + ?external_id: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?limit: Integer, + ?phone_number: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::AccountHolder] + + def list_documents: ( + String account_holder_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolderListDocumentsResponse + + def retrieve_document: ( + String document_token, + account_holder_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Document + + def simulate_enrollment_document_review: ( + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status, + ?accepted_entity_status_reasons: ::Array[String], + ?status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Document + + def simulate_enrollment_review: ( + ?account_holder_token: String, + ?status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse + + def upload_document: ( + String account_holder_token, + document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type, + entity_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Document + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/accounts.rbs b/sig/lithic/resources/accounts.rbs new file mode 100644 index 00000000..2ae5be4f --- /dev/null +++ b/sig/lithic/resources/accounts.rbs @@ -0,0 +1,36 @@ +module Lithic + module Resources + class Accounts + def retrieve: ( + String account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Account + + def update: ( + String account_token, + ?daily_spend_limit: Integer, + ?lifetime_spend_limit: Integer, + ?monthly_spend_limit: Integer, + ?state: Lithic::Models::AccountUpdateParams::state, + ?verification_address: Lithic::Models::AccountUpdateParams::VerificationAddress, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Account + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Account] + + def retrieve_spend_limits: ( + String account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountSpendLimits + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/aggregate_balances.rbs b/sig/lithic/resources/aggregate_balances.rbs new file mode 100644 index 00000000..585ac72f --- /dev/null +++ b/sig/lithic/resources/aggregate_balances.rbs @@ -0,0 +1,12 @@ +module Lithic + module Resources + class AggregateBalances + def list: ( + ?financial_account_type: Lithic::Models::AggregateBalanceListParams::financial_account_type, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::AggregateBalance] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/auth_rules.rbs b/sig/lithic/resources/auth_rules.rbs new file mode 100644 index 00000000..a9a36ea3 --- /dev/null +++ b/sig/lithic/resources/auth_rules.rbs @@ -0,0 +1,9 @@ +module Lithic + module Resources + class AuthRules + attr_reader v2: Lithic::Resources::AuthRules::V2 + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/auth_rules/v2.rbs b/sig/lithic/resources/auth_rules/v2.rbs new file mode 100644 index 00000000..0e29360e --- /dev/null +++ b/sig/lithic/resources/auth_rules/v2.rbs @@ -0,0 +1,77 @@ +module Lithic + module Resources + class AuthRules + class V2 + attr_reader backtests: Lithic::Resources::AuthRules::V2::Backtests + + def create: ( + account_tokens: ::Array[String], + card_tokens: ::Array[String], + program_level: bool, + ?name: String?, + ?parameters: Lithic::Models::AuthRules::V2CreateParams::parameters, + ?type: Lithic::Models::AuthRules::V2CreateParams::type_, + ?excluded_card_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2CreateResponse + + def retrieve: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2RetrieveResponse + + def update: ( + String auth_rule_token, + ?account_tokens: ::Array[String], + ?name: String?, + ?state: Lithic::Models::AuthRules::V2UpdateParams::state, + ?card_tokens: ::Array[String], + ?excluded_card_tokens: ::Array[String], + ?program_level: bool, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2UpdateResponse + + def list: ( + ?account_token: String, + ?card_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::AuthRules::V2ListResponse] + + def delete: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> nil + + def apply: ( + String auth_rule_token, + account_tokens: ::Array[String], + card_tokens: ::Array[String], + program_level: bool, + ?excluded_card_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2ApplyResponse + + def draft: ( + String auth_rule_token, + ?parameters: Lithic::Models::AuthRules::V2DraftParams::parameters?, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2DraftResponse + + def promote: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2PromoteResponse + + def report: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2ReportResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/auth_rules/v2/backtests.rbs b/sig/lithic/resources/auth_rules/v2/backtests.rbs new file mode 100644 index 00000000..528c4dc9 --- /dev/null +++ b/sig/lithic/resources/auth_rules/v2/backtests.rbs @@ -0,0 +1,24 @@ +module Lithic + module Resources + class AuthRules + class V2 + class Backtests + def create: ( + String auth_rule_token, + ?end_: Time, + ?start: Time, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2::BacktestCreateResponse + + def retrieve: ( + String auth_rule_backtest_token, + auth_rule_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2::BacktestResults + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/auth_stream_enrollment.rbs b/sig/lithic/resources/auth_stream_enrollment.rbs new file mode 100644 index 00000000..032b7ae4 --- /dev/null +++ b/sig/lithic/resources/auth_stream_enrollment.rbs @@ -0,0 +1,13 @@ +module Lithic + module Resources + class AuthStreamEnrollment + def retrieve_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthStreamSecret + + def rotate_secret: (?request_options: Lithic::request_opts) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/balances.rbs b/sig/lithic/resources/balances.rbs new file mode 100644 index 00000000..5c481a6c --- /dev/null +++ b/sig/lithic/resources/balances.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class Balances + def list: ( + ?account_token: String, + ?balance_date: Time, + ?business_account_token: String, + ?financial_account_type: Lithic::Models::BalanceListParams::financial_account_type, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::Balance] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/book_transfers.rbs b/sig/lithic/resources/book_transfers.rbs new file mode 100644 index 00000000..74ff9e22 --- /dev/null +++ b/sig/lithic/resources/book_transfers.rbs @@ -0,0 +1,45 @@ +module Lithic + module Resources + class BookTransfers + def create: ( + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::category, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::type_, + ?token: String, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::BookTransferResponse + + def retrieve: ( + String book_transfer_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::BookTransferResponse + + def list: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::BookTransferListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::BookTransferListParams::result, + ?starting_after: String, + ?status: Lithic::Models::BookTransferListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::BookTransferResponse] + + def reverse: ( + String book_transfer_token, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::BookTransferResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/card_programs.rbs b/sig/lithic/resources/card_programs.rbs new file mode 100644 index 00000000..f42d2baf --- /dev/null +++ b/sig/lithic/resources/card_programs.rbs @@ -0,0 +1,19 @@ +module Lithic + module Resources + class CardPrograms + def retrieve: ( + String card_program_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::CardProgram + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::CardProgram] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/cards.rbs b/sig/lithic/resources/cards.rbs new file mode 100644 index 00000000..457ef774 --- /dev/null +++ b/sig/lithic/resources/cards.rbs @@ -0,0 +1,118 @@ +module Lithic + module Resources + class Cards + attr_reader aggregate_balances: Lithic::Resources::Cards::AggregateBalances + + attr_reader balances: Lithic::Resources::Cards::Balances + + attr_reader financial_transactions: Lithic::Resources::Cards::FinancialTransactions + + def create: ( + type: Lithic::Models::CardCreateParams::type_, + ?account_token: String, + ?card_program_token: String, + ?carrier: Lithic::Models::Carrier, + ?digital_card_art_token: String, + ?exp_month: String, + ?exp_year: String, + ?memo: String, + ?pin: String, + ?product_id: String, + ?replacement_account_token: String, + ?replacement_for: String, + ?shipping_address: Lithic::Models::ShippingAddress, + ?shipping_method: Lithic::Models::CardCreateParams::shipping_method, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardCreateParams::state, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Card + + def retrieve: ( + String card_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Card + + def update: ( + String card_token, + ?digital_card_art_token: String, + ?memo: String, + ?pin: String, + ?pin_status: Lithic::Models::CardUpdateParams::pin_status, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardUpdateParams::state, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Card + + def list: ( + ?account_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?state: Lithic::Models::CardListParams::state, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Card] + + def convert_physical: ( + String card_token, + shipping_address: Lithic::Models::ShippingAddress, + ?carrier: Lithic::Models::Carrier, + ?product_id: String, + ?shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Card + + def embed: ( + embed_request: String, + hmac: String, + ?request_options: Lithic::request_opts + ) -> String + + def provision: ( + String card_token, + ?certificate: String, + ?client_device_id: String, + ?client_wallet_account_id: String, + ?digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet, + ?nonce: String, + ?nonce_signature: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::CardProvisionResponse + + def reissue: ( + String card_token, + ?carrier: Lithic::Models::Carrier, + ?product_id: String, + ?shipping_address: Lithic::Models::ShippingAddress, + ?shipping_method: Lithic::Models::CardReissueParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Card + + def renew: ( + String card_token, + shipping_address: Lithic::Models::ShippingAddress, + ?carrier: Lithic::Models::Carrier, + ?exp_month: String, + ?exp_year: String, + ?product_id: String, + ?shipping_method: Lithic::Models::CardRenewParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Card + + def retrieve_spend_limits: ( + String card_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::CardSpendLimits + + def search_by_pan: ( + pan: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Card + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/cards/aggregate_balances.rbs b/sig/lithic/resources/cards/aggregate_balances.rbs new file mode 100644 index 00000000..0de94ad1 --- /dev/null +++ b/sig/lithic/resources/cards/aggregate_balances.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class Cards + class AggregateBalances + def list: ( + ?account_token: String, + ?business_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::Cards::AggregateBalanceListResponse] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/cards/balances.rbs b/sig/lithic/resources/cards/balances.rbs new file mode 100644 index 00000000..d95d6355 --- /dev/null +++ b/sig/lithic/resources/cards/balances.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class Cards + class Balances + def list: ( + String card_token, + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::Cards::BalanceListResponse] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/cards/financial_transactions.rbs b/sig/lithic/resources/cards/financial_transactions.rbs new file mode 100644 index 00000000..57f6a623 --- /dev/null +++ b/sig/lithic/resources/cards/financial_transactions.rbs @@ -0,0 +1,27 @@ +module Lithic + module Resources + class Cards + class FinancialTransactions + def retrieve: ( + String financial_transaction_token, + card_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialTransaction + + def list: ( + String card_token, + ?begin_: Time, + ?category: Lithic::Models::Cards::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::Cards::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::Cards::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::FinancialTransaction] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/credit_products.rbs b/sig/lithic/resources/credit_products.rbs new file mode 100644 index 00000000..d45757f6 --- /dev/null +++ b/sig/lithic/resources/credit_products.rbs @@ -0,0 +1,11 @@ +module Lithic + module Resources + class CreditProducts + attr_reader extended_credit: Lithic::Resources::CreditProducts::ExtendedCredit + + attr_reader prime_rates: Lithic::Resources::CreditProducts::PrimeRates + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/credit_products/extended_credit.rbs b/sig/lithic/resources/credit_products/extended_credit.rbs new file mode 100644 index 00000000..e481df31 --- /dev/null +++ b/sig/lithic/resources/credit_products/extended_credit.rbs @@ -0,0 +1,14 @@ +module Lithic + module Resources + class CreditProducts + class ExtendedCredit + def retrieve: ( + String credit_product_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::CreditProducts::CreditProductsExtendedCredit + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/credit_products/prime_rates.rbs b/sig/lithic/resources/credit_products/prime_rates.rbs new file mode 100644 index 00000000..87dba96e --- /dev/null +++ b/sig/lithic/resources/credit_products/prime_rates.rbs @@ -0,0 +1,23 @@ +module Lithic + module Resources + class CreditProducts + class PrimeRates + def create: ( + String credit_product_token, + effective_date: Date, + rate: String, + ?request_options: Lithic::request_opts + ) -> nil + + def retrieve: ( + String credit_product_token, + ?ending_before: Date, + ?starting_after: Date, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::CreditProducts::PrimeRateRetrieveResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/digital_card_art.rbs b/sig/lithic/resources/digital_card_art.rbs new file mode 100644 index 00000000..4a30622d --- /dev/null +++ b/sig/lithic/resources/digital_card_art.rbs @@ -0,0 +1,19 @@ +module Lithic + module Resources + class DigitalCardArt + def retrieve: ( + String digital_card_art_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::DigitalCardArtAPI + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::DigitalCardArtAPI] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/disputes.rbs b/sig/lithic/resources/disputes.rbs new file mode 100644 index 00000000..79d8f97b --- /dev/null +++ b/sig/lithic/resources/disputes.rbs @@ -0,0 +1,74 @@ +module Lithic + module Resources + class Disputes + def create: ( + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::reason, + transaction_token: String, + ?customer_filed_date: Time, + ?customer_note: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Dispute + + def retrieve: ( + String dispute_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Dispute + + def update: ( + String dispute_token, + ?amount: Integer, + ?customer_filed_date: Time, + ?customer_note: String, + ?reason: Lithic::Models::DisputeUpdateParams::reason, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Dispute + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::DisputeListParams::status, + ?transaction_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Dispute] + + def delete: ( + String dispute_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Dispute + + def delete_evidence: ( + String evidence_token, + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::DisputeEvidence + + def initiate_evidence_upload: ( + String dispute_token, + ?filename: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::DisputeEvidence + + def list_evidences: ( + String dispute_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::DisputeEvidence] + + def retrieve_evidence: ( + String evidence_token, + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::DisputeEvidence + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/events.rbs b/sig/lithic/resources/events.rbs new file mode 100644 index 00000000..fd4d3b3d --- /dev/null +++ b/sig/lithic/resources/events.rbs @@ -0,0 +1,36 @@ +module Lithic + module Resources + class Events + attr_reader subscriptions: Lithic::Resources::Events::Subscriptions + + def retrieve: ( + String event_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Event + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?event_types: ::Array[Lithic::Models::EventListParams::event_type], + ?page_size: Integer, + ?starting_after: String, + ?with_content: bool, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Event] + + def list_attempts: ( + String event_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::EventListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::MessageAttempt] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/events/subscriptions.rbs b/sig/lithic/resources/events/subscriptions.rbs new file mode 100644 index 00000000..a5ee4a3c --- /dev/null +++ b/sig/lithic/resources/events/subscriptions.rbs @@ -0,0 +1,84 @@ +module Lithic + module Resources + class Events + class Subscriptions + def create: ( + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::EventSubscription + + def retrieve: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::EventSubscription + + def update: ( + String event_subscription_token, + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::EventSubscription + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::EventSubscription] + + def delete: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> nil + + def list_attempts: ( + String event_subscription_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::Events::SubscriptionListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::MessageAttempt] + + def recover: ( + String event_subscription_token, + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> nil + + def replay_missing: ( + String event_subscription_token, + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> nil + + def retrieve_secret: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Events::SubscriptionRetrieveSecretResponse + + def rotate_secret: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> nil + + def send_simulated_example: ( + String event_subscription_token, + ?event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/external_bank_accounts.rbs b/sig/lithic/resources/external_bank_accounts.rbs new file mode 100644 index 00000000..adea9edd --- /dev/null +++ b/sig/lithic/resources/external_bank_accounts.rbs @@ -0,0 +1,75 @@ +module Lithic + module Resources + class ExternalBankAccounts + attr_reader micro_deposits: Lithic::Resources::ExternalBankAccounts::MicroDeposits + + def create: ( + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::type_, + verification_method: Lithic::Models::ExternalBankAccountCreateParams::verification_method, + processor_token: String, + ?account_token: String, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?user_defined_id: String, + ?verification_enforcement: bool, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountCreateResponse + + def retrieve: ( + String external_bank_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountRetrieveResponse + + def update: ( + String external_bank_account_token, + ?address: Lithic::Models::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?owner: String, + ?owner_type: Lithic::Models::owner_type, + ?type: Lithic::Models::ExternalBankAccountUpdateParams::type_, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountUpdateResponse + + def list: ( + ?account_token: String, + ?account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type], + ?countries: ::Array[String], + ?ending_before: String, + ?owner_types: ::Array[Lithic::Models::owner_type], + ?page_size: Integer, + ?starting_after: String, + ?states: ::Array[Lithic::Models::ExternalBankAccountListParams::state], + ?verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state], + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::ExternalBankAccountListResponse] + + def retry_micro_deposits: ( + String external_bank_account_token, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse + + def retry_prenote: ( + String external_bank_account_token, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountRetryPrenoteResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/external_bank_accounts/micro_deposits.rbs b/sig/lithic/resources/external_bank_accounts/micro_deposits.rbs new file mode 100644 index 00000000..836cdd0b --- /dev/null +++ b/sig/lithic/resources/external_bank_accounts/micro_deposits.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class ExternalBankAccounts + class MicroDeposits + def create: ( + String external_bank_account_token, + micro_deposits: ::Array[Integer], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/external_payments.rbs b/sig/lithic/resources/external_payments.rbs new file mode 100644 index 00000000..f1d91123 --- /dev/null +++ b/sig/lithic/resources/external_payments.rbs @@ -0,0 +1,68 @@ +module Lithic + module Resources + class ExternalPayments + def create: ( + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::category, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type, + ?token: String, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalPayment + + def retrieve: ( + String external_payment_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalPayment + + def list: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ExternalPaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::ExternalPaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::ExternalPaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::ExternalPayment] + + def cancel: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalPayment + + def release: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalPayment + + def reverse: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalPayment + + def settle: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalPayment + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/financial_accounts.rbs b/sig/lithic/resources/financial_accounts.rbs new file mode 100644 index 00000000..fc5d37e0 --- /dev/null +++ b/sig/lithic/resources/financial_accounts.rbs @@ -0,0 +1,51 @@ +module Lithic + module Resources + class FinancialAccounts + attr_reader balances: Lithic::Resources::FinancialAccounts::Balances + + attr_reader financial_transactions: Lithic::Resources::FinancialAccounts::FinancialTransactions + + attr_reader credit_configuration: Lithic::Resources::FinancialAccounts::CreditConfiguration + + attr_reader statements: Lithic::Resources::FinancialAccounts::Statements + + attr_reader loan_tapes: Lithic::Resources::FinancialAccounts::LoanTapes + + def create: ( + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::type_, + ?account_token: String, + ?is_for_benefit_of: bool, + ?idempotency_key: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccount + + def retrieve: ( + String financial_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccount + + def update: ( + String financial_account_token, + ?nickname: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccount + + def list: ( + ?account_token: String, + ?business_account_token: String, + ?type: Lithic::Models::FinancialAccountListParams::type_, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::FinancialAccount] + + def update_status: ( + String financial_account_token, + status: Lithic::Models::FinancialAccountUpdateStatusParams::status, + status_change_reason: Lithic::Models::FinancialAccountUpdateStatusParams::status_change_reason?, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccount + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/financial_accounts/balances.rbs b/sig/lithic/resources/financial_accounts/balances.rbs new file mode 100644 index 00000000..b4a30296 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/balances.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class FinancialAccounts + class Balances + def list: ( + String financial_account_token, + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::FinancialAccounts::BalanceListResponse] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/credit_configuration.rbs b/sig/lithic/resources/financial_accounts/credit_configuration.rbs new file mode 100644 index 00000000..ba6724d7 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/credit_configuration.rbs @@ -0,0 +1,23 @@ +module Lithic + module Resources + class FinancialAccounts + class CreditConfiguration + def retrieve: ( + String financial_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig + + def update: ( + String financial_account_token, + ?credit_limit: Integer, + ?credit_product_token: String, + ?external_bank_account_token: String, + ?tier: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/financial_transactions.rbs b/sig/lithic/resources/financial_accounts/financial_transactions.rbs new file mode 100644 index 00000000..8dee80a9 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/financial_transactions.rbs @@ -0,0 +1,27 @@ +module Lithic + module Resources + class FinancialAccounts + class FinancialTransactions + def retrieve: ( + String financial_transaction_token, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialTransaction + + def list: ( + String financial_account_token, + ?begin_: Time, + ?category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::SinglePage[Lithic::Models::FinancialTransaction] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/loan_tapes.rbs b/sig/lithic/resources/financial_accounts/loan_tapes.rbs new file mode 100644 index 00000000..9be061c6 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/loan_tapes.rbs @@ -0,0 +1,25 @@ +module Lithic + module Resources + class FinancialAccounts + class LoanTapes + def retrieve: ( + String loan_tape_token, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccounts::LoanTape + + def list: ( + String financial_account_token, + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::FinancialAccounts::LoanTape] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/statements.rbs b/sig/lithic/resources/financial_accounts/statements.rbs new file mode 100644 index 00000000..da8a5383 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/statements.rbs @@ -0,0 +1,28 @@ +module Lithic + module Resources + class FinancialAccounts + class Statements + attr_reader line_items: Lithic::Resources::FinancialAccounts::Statements::LineItems + + def retrieve: ( + String statement_token, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FinancialAccounts::Statement + + def list: ( + String financial_account_token, + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?include_initial_statements: bool, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::FinancialAccounts::Statement] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/statements/line_items.rbs b/sig/lithic/resources/financial_accounts/statements/line_items.rbs new file mode 100644 index 00000000..09d24f83 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/statements/line_items.rbs @@ -0,0 +1,20 @@ +module Lithic + module Resources + class FinancialAccounts + class Statements + class LineItems + def list: ( + String statement_token, + financial_account_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data] + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/management_operations.rbs b/sig/lithic/resources/management_operations.rbs new file mode 100644 index 00000000..def57c00 --- /dev/null +++ b/sig/lithic/resources/management_operations.rbs @@ -0,0 +1,46 @@ +module Lithic + module Resources + class ManagementOperations + def create: ( + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::category, + direction: Lithic::Models::ManagementOperationCreateParams::direction, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::event_type, + financial_account_token: String, + ?token: String, + ?memo: String, + ?subtype: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ManagementOperationTransaction + + def retrieve: ( + String management_operation_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ManagementOperationTransaction + + def list: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ManagementOperationListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::ManagementOperationListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::ManagementOperationTransaction] + + def reverse: ( + String management_operation_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ManagementOperationTransaction + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/payments.rbs b/sig/lithic/resources/payments.rbs new file mode 100644 index 00000000..7ba244a6 --- /dev/null +++ b/sig/lithic/resources/payments.rbs @@ -0,0 +1,73 @@ +module Lithic + module Resources + class Payments + def create: ( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::method_, + method_attributes: Lithic::Models::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::type_, + ?token: String, + ?memo: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentCreateResponse + + def retrieve: ( + String payment_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Payment + + def list: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::PaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::PaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::PaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Payment] + + def retry_: ( + String payment_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentRetryResponse + + def simulate_action: ( + String payment_token, + event_type: Lithic::Models::PaymentSimulateActionParams::event_type, + ?decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateActionResponse + + def simulate_receipt: ( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateReceiptResponse + + def simulate_release: ( + payment_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateReleaseResponse + + def simulate_return: ( + payment_token: String, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateReturnResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/reports.rbs b/sig/lithic/resources/reports.rbs new file mode 100644 index 00000000..ed0b6840 --- /dev/null +++ b/sig/lithic/resources/reports.rbs @@ -0,0 +1,9 @@ +module Lithic + module Resources + class Reports + attr_reader settlement: Lithic::Resources::Reports::Settlement + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/reports/settlement.rbs b/sig/lithic/resources/reports/settlement.rbs new file mode 100644 index 00000000..62b82abc --- /dev/null +++ b/sig/lithic/resources/reports/settlement.rbs @@ -0,0 +1,24 @@ +module Lithic + module Resources + class Reports + class Settlement + attr_reader network_totals: Lithic::Resources::Reports::Settlement::NetworkTotals + + def list_details: ( + Date report_date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::SettlementDetail] + + def summary: ( + Date report_date, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::SettlementReport + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/reports/settlement/network_totals.rbs b/sig/lithic/resources/reports/settlement/network_totals.rbs new file mode 100644 index 00000000..66b490a1 --- /dev/null +++ b/sig/lithic/resources/reports/settlement/network_totals.rbs @@ -0,0 +1,31 @@ +module Lithic + module Resources + class Reports + class Settlement + class NetworkTotals + def retrieve: ( + String token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?institution_id: String, + ?network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network, + ?page_size: Integer, + ?report_date: Date, + ?report_date_begin: Date, + ?report_date_end: Date, + ?settlement_institution_id: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Reports::Settlement::NetworkTotalListResponse] + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/responder_endpoints.rbs b/sig/lithic/resources/responder_endpoints.rbs new file mode 100644 index 00000000..f9a81444 --- /dev/null +++ b/sig/lithic/resources/responder_endpoints.rbs @@ -0,0 +1,23 @@ +module Lithic + module Resources + class ResponderEndpoints + def create: ( + ?type: Lithic::Models::ResponderEndpointCreateParams::type_, + ?url: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ResponderEndpointCreateResponse + + def delete: ( + type: Lithic::Models::ResponderEndpointDeleteParams::type_, + ?request_options: Lithic::request_opts + ) -> nil + + def check_status: ( + type: Lithic::Models::ResponderEndpointCheckStatusParams::type_, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ResponderEndpointStatus + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/three_ds.rbs b/sig/lithic/resources/three_ds.rbs new file mode 100644 index 00000000..5149a56d --- /dev/null +++ b/sig/lithic/resources/three_ds.rbs @@ -0,0 +1,11 @@ +module Lithic + module Resources + class ThreeDS + attr_reader authentication: Lithic::Resources::ThreeDS::Authentication + + attr_reader decisioning: Lithic::Resources::ThreeDS::Decisioning + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/three_ds/authentication.rbs b/sig/lithic/resources/three_ds/authentication.rbs new file mode 100644 index 00000000..800389ca --- /dev/null +++ b/sig/lithic/resources/three_ds/authentication.rbs @@ -0,0 +1,28 @@ +module Lithic + module Resources + class ThreeDS + class Authentication + def retrieve: ( + String three_ds_authentication_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ThreeDS::AuthenticationRetrieveResponse + + def simulate: ( + merchant: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction, + ?card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ThreeDS::AuthenticationSimulateResponse + + def simulate_otp_entry: ( + token: String, + otp: String, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/three_ds/decisioning.rbs b/sig/lithic/resources/three_ds/decisioning.rbs new file mode 100644 index 00000000..f5f7a7b7 --- /dev/null +++ b/sig/lithic/resources/three_ds/decisioning.rbs @@ -0,0 +1,21 @@ +module Lithic + module Resources + class ThreeDS + class Decisioning + def challenge_response: ( + token: String, + challenge_response: Lithic::Models::ThreeDS::challenge_result, + ?request_options: Lithic::request_opts + ) -> nil + + def retrieve_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse + + def rotate_secret: (?request_options: Lithic::request_opts) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/tokenization_decisioning.rbs b/sig/lithic/resources/tokenization_decisioning.rbs new file mode 100644 index 00000000..a90ec905 --- /dev/null +++ b/sig/lithic/resources/tokenization_decisioning.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class TokenizationDecisioning + def retrieve_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TokenizationSecret + + def rotate_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TokenizationDecisioningRotateSecretResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/tokenizations.rbs b/sig/lithic/resources/tokenizations.rbs new file mode 100644 index 00000000..46104cc9 --- /dev/null +++ b/sig/lithic/resources/tokenizations.rbs @@ -0,0 +1,68 @@ +module Lithic + module Resources + class Tokenizations + def retrieve: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TokenizationRetrieveResponse + + def list: ( + ?account_token: String, + ?begin_: Date, + ?card_token: String, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Tokenization] + + def activate: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def deactivate: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def pause: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def resend_activation_code: ( + String tokenization_token, + ?activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type, + ?request_options: Lithic::request_opts + ) -> nil + + def simulate: ( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source, + ?account_score: Integer, + ?device_score: Integer, + ?entity: String, + ?wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TokenizationSimulateResponse + + def unpause: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def update_digital_card_art: ( + String tokenization_token, + ?digital_card_art_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TokenizationUpdateDigitalCardArtResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/transactions.rbs b/sig/lithic/resources/transactions.rbs new file mode 100644 index 00000000..2c055563 --- /dev/null +++ b/sig/lithic/resources/transactions.rbs @@ -0,0 +1,88 @@ +module Lithic + module Resources + class Transactions + attr_reader enhanced_commercial_data: Lithic::Resources::Transactions::EnhancedCommercialData + + attr_reader events: Lithic::Resources::Transactions::Events + + def retrieve: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Transaction + + def list: ( + ?account_token: String, + ?begin_: Time, + ?card_token: String, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?result: Lithic::Models::TransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::TransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CursorPage[Lithic::Models::Transaction] + + def expire_authorization: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> nil + + def simulate_authorization: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_id: String, + ?merchant_amount: Integer, + ?merchant_currency: String, + ?partial_approval_capable: bool, + ?pin: String, + ?status: Lithic::Models::TransactionSimulateAuthorizationParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateAuthorizationResponse + + def simulate_authorization_advice: ( + token: String, + amount: Integer, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateAuthorizationAdviceResponse + + def simulate_clearing: ( + token: String, + ?amount: Integer, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateClearingResponse + + def simulate_credit_authorization: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateCreditAuthorizationResponse + + def simulate_return: ( + amount: Integer, + descriptor: String, + pan: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateReturnResponse + + def simulate_return_reversal: ( + token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateReturnReversalResponse + + def simulate_void: ( + token: String, + ?amount: Integer, + ?type: Lithic::Models::TransactionSimulateVoidParams::type_, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateVoidResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/transactions/enhanced_commercial_data.rbs b/sig/lithic/resources/transactions/enhanced_commercial_data.rbs new file mode 100644 index 00000000..3557adbb --- /dev/null +++ b/sig/lithic/resources/transactions/enhanced_commercial_data.rbs @@ -0,0 +1,14 @@ +module Lithic + module Resources + class Transactions + class EnhancedCommercialData + def retrieve: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/transactions/events.rbs b/sig/lithic/resources/transactions/events.rbs new file mode 100644 index 00000000..135ac859 --- /dev/null +++ b/sig/lithic/resources/transactions/events.rbs @@ -0,0 +1,11 @@ +module Lithic + module Resources + class Transactions + class Events + attr_reader enhanced_commercial_data: Lithic::Resources::Transactions::Events::EnhancedCommercialData + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/transactions/events/enhanced_commercial_data.rbs b/sig/lithic/resources/transactions/events/enhanced_commercial_data.rbs new file mode 100644 index 00000000..7d14a129 --- /dev/null +++ b/sig/lithic/resources/transactions/events/enhanced_commercial_data.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class Transactions + class Events + class EnhancedCommercialData + def retrieve: ( + String event_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Transactions::Events::EnhancedData + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/transfers.rbs b/sig/lithic/resources/transfers.rbs new file mode 100644 index 00000000..f91ffd7a --- /dev/null +++ b/sig/lithic/resources/transfers.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class Transfers + def create: ( + amount: Integer, + from: String, + to: String, + ?token: String, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Transfer + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/single_page.rbs b/sig/lithic/single_page.rbs new file mode 100644 index 00000000..46cf2a85 --- /dev/null +++ b/sig/lithic/single_page.rbs @@ -0,0 +1,11 @@ +module Lithic + class SinglePage[Elem] + include Lithic::BasePage[Elem] + + attr_accessor data: ::Array[Elem]? + + attr_accessor has_more: bool + + def inspect: -> String + end +end diff --git a/sig/lithic/util.rbs b/sig/lithic/util.rbs new file mode 100644 index 00000000..13e3a1f1 --- /dev/null +++ b/sig/lithic/util.rbs @@ -0,0 +1,132 @@ +module Lithic + module Util + def self?.monotonic_secs: -> Float + + def self?.arch: -> String + + def self?.os: -> String + + def self?.primitive?: (top input) -> bool + + def self?.coerce_boolean: (top input) -> (bool | top) + + def self?.coerce_boolean!: (top input) -> bool? + + def self?.coerce_integer: (top input) -> (Integer | top) + + def self?.coerce_float: (top input) -> (Float | top) + + def self?.coerce_hash: (top input) -> (::Hash[top, top] | top) + + OMIT: top + + def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top + + def self?.deep_merge: ( + *::Array[top] values, + ?sentinel: top?, + ?concat: bool + ) -> top + + def self?.dig: ( + ::Hash[Symbol, top] | ::Array[top] | top data, + (Symbol | Integer | ::Array[(Symbol | Integer)])? pick, + ?top? sentinel + ) { + -> top? + } -> top? + + def self?.uri_origin: (URI::Generic uri) -> String + + def self?.interpolate_path: (String | ::Array[String] path) -> String + + def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] + + def self?.encode_query: ( + ::Hash[String, (::Array[String] | String)?]? query + ) -> String? + + type parsed_uri = + { + scheme: String?, + host: String?, + port: Integer?, + path: String?, + query: ::Hash[String, ::Array[String]] + } + + def self?.parse_uri: (URI::Generic | String url) -> Lithic::Util::parsed_uri + + def self?.unparse_uri: (Lithic::Util::parsed_uri parsed) -> URI::Generic + + def self?.join_parsed_uri: ( + Lithic::Util::parsed_uri lhs, + Lithic::Util::parsed_uri rhs + ) -> URI::Generic + + def self?.normalized_headers: ( + *::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?] headers + ) -> ::Hash[String, String] + + class ReadIOAdapter + private def read_enum: (Integer? max_len) -> String + + def read: (?Integer? max_len, ?String? out_string) -> String? + + def initialize: ( + String | IO | StringIO | Enumerable[String] stream + ) { + (String arg0) -> void + } -> void + end + + def self?.string_io: { + (Enumerator::Yielder y) -> void + } -> Enumerable[String] + + def self?.encode_multipart_formdata: ( + Enumerator::Yielder y, + boundary: String, + key: Symbol | String, + val: top + ) -> void + + def self?.encode_multipart_streaming: ( + top body + ) -> [String, Enumerable[String]] + + def self?.encode_content: (::Hash[String, String] headers, top body) -> top + + def self?.decode_content: ( + ::Hash[String, String] headers, + stream: Enumerable[String], + ?suppress_error: bool + ) -> top + + def self?.fused_enum: ( + Enumerable[top] enum, + ?external: bool + ) { + -> void + } -> Enumerable[top] + + def self?.close_fused!: (Enumerable[top]? enum) -> void + + def self?.chain_fused: ( + Enumerable[top]? enum + ) { + (Enumerator::Yielder arg0) -> void + } -> Enumerable[top] + + type server_sent_event = + { event: String?, data: String?, id: String?, retry: Integer? } + + def self?.decode_lines: (Enumerable[String] enum) -> Enumerable[String] + + def self?.decode_sse: ( + Enumerable[String] lines + ) -> Lithic::Util::server_sent_event + end +end diff --git a/sig/lithic/version.rbs b/sig/lithic/version.rbs new file mode 100644 index 00000000..ed0a6b48 --- /dev/null +++ b/sig/lithic/version.rbs @@ -0,0 +1,3 @@ +module Lithic + VERSION: "0.0.1-alpha.0" +end diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 00000000..538c1528 --- /dev/null +++ b/sorbet/config @@ -0,0 +1,2 @@ +--dir=rbi +--ignore=test/ diff --git a/test/lithic/base_model_test.rb b/test/lithic/base_model_test.rb new file mode 100644 index 00000000..ed948f5b --- /dev/null +++ b/test/lithic/base_model_test.rb @@ -0,0 +1,381 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class Lithic::Test::BaseModelTest < Minitest::Test + module E1 + extend Lithic::Enum + + A = :a + B = :b + end + + A1 = Lithic::ArrayOf[-> { Integer }] + A2 = Lithic::ArrayOf[enum: -> { E1 }] + + def test_basic + assert(E1.is_a?(Lithic::Converter)) + assert(A1.is_a?(Lithic::Converter)) + end + + def test_basic_coerce + assert_pattern do + Lithic::Converter.coerce(A1, [1.0, 2.0, 3.0]) => [1, 2, 3] + end + + assert_pattern do + Lithic::Converter.coerce(A2, %w[a b c]) => [:a, :b, "c"] + end + end + + def test_basic_dump + assert_pattern do + Lithic::Converter.dump(A1, [1.0, 2.0, 3.0]) => [1, 2, 3] + end + + assert_pattern do + Lithic::Converter.dump(A2, %w[a b c]) => %w[a b c] + end + end + + def test_primitive_try_strict_coerce + d_now = Date.today + t_now = Time.now + + cases = { + [NilClass, :a] => [true, nil, 0], + [NilClass, nil] => [true, nil, 1], + [Integer, 1.0] => [true, 1, 1], + [Float, 1] => [true, 1.0, 1], + [Date, d_now] => [true, d_now, 1], + [Time, t_now] => [true, t_now, 1] + } + + cases.each do |test, expect| + type, input = test + assert_pattern do + Lithic::Converter.try_strict_coerce(type, input) => ^expect + end + end + end + + def test_basic_enum_try_strict_coerce + cases = { + :a => [true, :a, 1], + "a" => [true, :a, 1], + :c => [false, true, 0], + 1 => [false, false, 0] + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.try_strict_coerce(E1, input) => ^expect + end + end + end + + def test_basic_array_try_strict_coerce + cases = { + [] => [true, [], 0], + nil => [false, false, 0], + [1, 2, 3] => [true, [1, 2, 3], 3], + [1.0, 2.0, 3.0] => [true, [1, 2, 3], 3], + [1, nil, 3] => [true, [1, nil, 3], 2], + [1, nil, nil] => [true, [1, nil, nil], 1], + [1, "two", 3] => [false, true, 2] + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.try_strict_coerce(A1, input) => ^expect + end + end + end + + def test_nested_array_try_strict_coerce + cases = { + %w[a b] => [true, [:a, :b], 2], + %w[a b c] => [false, true, 2] + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.try_strict_coerce(A2, input) => ^expect + end + end + end + + class M1 < Lithic::BaseModel + required :a, Time + optional :b, E1, api_name: :renamed + required :c, A1 + + request_only do + required :w, Integer + optional :x, String + end + + response_only do + required :y, Integer + optional :z, String + end + end + + class M2 < M1 + required :c, M1 + end + + def test_model_accessors + now = Time.now.round(0) + model = M2.new(a: now.to_s, b: "b", renamed: "a", c: [1.0, 2.0, 3.0], w: 1, y: 1) + + cases = [ + [model.a, now], + [model.b, :a], + [model.c, [1, 2, 3]], + [model.w, 1], + [model.y, 1] + ] + + cases.each do |input, expect| + assert_pattern do + input => ^expect + end + end + end + + def test_model_conversion_accessor + model = M2.new(c: {}) + assert_pattern do + model.c => M1 + end + end + + def test_model_equality + now = Time.now + model1 = M2.new(a: now, b: "b", renamed: "a", c: M1.new, w: 1, y: 1) + model2 = M2.new(a: now, b: "b", renamed: "a", c: M1.new, w: 1, y: 1) + + assert_pattern do + model2 => ^model1 + end + end + + def test_basic_model_coerce + cases = { + {} => M2.new, + {a: nil, b: :a, c: [1.0, 2.0, 3.0], w: 1} => M2.new(a: nil, b: :a, c: [1.0, 2.0, 3.0], w: 1) + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.coerce(M2, input) => ^expect + end + end + end + + def test_basic_model_dump + cases = { + nil => nil, + {} => {}, + {w: 1, x: "x", y: 1, z: "z"} => {w: 1, x: "x"}, + [1, 2, 3] => [1, 2, 3] + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.dump(M2, input) => ^expect + end + end + end + + def test_basic_model_try_strict_coerce + raw = {a: Time.now, c: [2], y: 1} + addn = {x: "x", n: "n"} + expect_exact = M1.new(raw) + expect_addn = M1.new(**raw, **addn) + + cases = { + {} => [false, true, 0], + raw => [true, expect_exact, 3], + {**raw, **addn} => [true, expect_addn, 4] + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.try_strict_coerce(M1, input) => ^expect + end + end + end + + def test_nested_model_dump + now = Time.now + models = [M1, M2] + inputs = [ + M1.new(a: now, b: "a", c: [1.0, 2.0, 3.0], y: 1), + {a: now, b: "a", c: [1.0, 2.0, 3.0], y: 1}, + {"a" => now, b: "", "b" => "a", "c" => [], :c => [1.0, 2.0, 3.0], "y" => 1} + ] + + models.product(inputs).each do |model, input| + assert_pattern do + Lithic::Converter.dump(model, input) => {a: now, renamed: "a", c: [1, 2, 3]} + end + end + end + + class M4 < M2 + required :c, M1 + required :d, Lithic::ArrayOf[M4] + required :e, M2, api_name: :f + end + + def test_model_to_h + model = M4.new(a: "wow", c: {}, d: [{}, 2, {c: {}}], f: {}) + assert_pattern do + model.to_h => {a: "wow", c: M1, d: [M4, 2, M4 => child], f: M2} + assert_equal({c: M1.new}, child.to_h) + end + end + + A3 = Lithic::ArrayOf[A1] + + class M3 < M1 + optional :b, E1, api_name: :renamed_again + end + + module U1 + extend Lithic::Union + + discriminator :type + variant :a, M1 + variant :b, M3 + end + + module U2 + extend Lithic::Union + + variant A1 + variant A3 + end + + def test_basic_union + assert(U1.is_a?(Lithic::Converter)) + + assert_pattern do + M1.new => U1 + M3.new => U1 + end + end + + def test_basic_discriminated_union_coerce + common = {a: Time.now, c: [], w: 1} + cases = { + nil => nil, + {type: "a", **common} => M1.new(type: "a", **common), + {type: :b, **common} => M3.new(type: :b, **common), + {type: :c, xyz: 1} => {type: :c, xyz: 1} + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.coerce(U1, input) => ^expect + end + end + end + + def test_basic_discriminated_union_dump + now = Time.now + cases = { + nil => nil, + M1.new(a: now, b: :a, c: [1.0, 2.0, 3.0], y: 1) => {a: now, renamed: :a, c: [1, 2, 3]}, + M3.new(b: "a", y: 1) => {renamed_again: "a"}, + {type: :a, b: "a", y: 1} => {type: :a, renamed: "a"}, + {type: "b", b: "a", y: 1} => {type: "b", renamed_again: "a"}, + {type: :c, xyz: 1} => {type: :c, xyz: 1} + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.dump(U1, input) => ^expect + end + end + end + + def test_basic_undifferentiated_union_try_strict_coerce + cases = { + [] => [true, [], 0], + [[]] => [true, [[]], 0], + # [nil] => [false, true, 0], + [1, 2, 3] => [true, [1, 2, 3], 3], + [[1, 2, 3], [4, 5, 6]] => [true, [[1, 2, 3], [4, 5, 6]], 6] + } + + cases.each do |input, expect| + assert_pattern do + Lithic::Converter.try_strict_coerce(U2, input) => ^expect + end + end + end + + class C1 < Lithic::BaseModel + required :a, const: :a + required :b, const: :b, nil?: true + optional :c, const: :c + end + + def test_basic_const + assert_pattern do + C1.dump(C1.new) => {a: :a} + C1.new => {a: :a} + C1.new(a: "a") => {a: :a} + C1.new(b: 2) => {b: 2} + C1.new.a => :a + C1.new.b => nil + C1.new.c => nil + end + end + + module E2 + extend Lithic::Enum + + A = :a + B = :b + end + + module U3 + extend Lithic::Union + + discriminator :type + variant :a, M1 + variant :b, M3 + end + + def test_basic_eql + assert_equal(Lithic::Unknown, Lithic::Unknown) + refute_equal(Lithic::Unknown, Lithic::BooleanModel) + assert_equal(Lithic::BooleanModel, Lithic::BooleanModel) + + assert_equal(E1, E2) + assert_equal(E1, E2) + + refute_equal(U1, U2) + assert_equal(U1, U3) + end + + module U4 + extend Lithic::Union + + variant :a, const: :a + variant :b, const: :b + end + + def test_basic_const_union + assert_pattern do + U4.coerce(nil) => nil + U4.coerce("") => "" + U4.coerce(:a) => :a + U4.coerce("a") => :a + end + end +end diff --git a/test/lithic/client_test.rb b/test/lithic/client_test.rb new file mode 100644 index 00000000..37081438 --- /dev/null +++ b/test/lithic/client_test.rb @@ -0,0 +1,285 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class LithicTest < Minitest::Test + def setup + Thread.current.thread_variable_set(:mock_sleep, []) + end + + def teardown + Thread.current.thread_variable_set(:mock_sleep, nil) + end + + def test_raises_on_both_base_url_and_environment + e = assert_raises(ArgumentError) do + Lithic::Client.new( + base_url: "https://localhost:8000", + environment: "production" + ) + end + assert_match(/both environment and base_url given/, e.message) + end + + def test_raises_on_unknown_environment + e = assert_raises(ArgumentError) do + Lithic::Client.new(environment: "wrong") + end + assert_match(/environment must be one of/, e.message) + end + + def test_raises_on_missing_non_nullable_opts + e = assert_raises(ArgumentError) do + Lithic::Client.new + end + assert_match(/is required/, e.message) + end + + class MockRequester + # @return [Integer] + attr_reader :response_code + + # @return [Hash{String=>String}] + attr_reader :response_headers + + # @return [Object] + attr_reader :response_data + + # @return [ArrayObject}>] + attr_accessor :attempts + + # @param response_code [Integer] + # @param response_headers [Hash{String=>String}] + # @param response_data [Object] + def initialize(response_code, response_headers, response_data) + @response_code = response_code + @response_headers = response_headers + @response_data = JSON.fast_generate(response_data) + @attempts = [] + end + + # @param req [Hash{Symbol=>Object}] + def execute(req) + # Deep copy the request because it is mutated on each retry. + attempts.push(Marshal.load(Marshal.dump(req))) + headers = {"content-type" => "application/json", **response_headers} + [response_code, headers, response_data.grapheme_clusters] + end + end + + def test_client_default_request_default_retry_attempts + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(500, {}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create(type: :MERCHANT_LOCKED) + end + + assert_equal(3, requester.attempts.length) + end + + def test_client_given_request_default_retry_attempts + lithic = + Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key", max_retries: 3) + requester = MockRequester.new(500, {}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create(type: :MERCHANT_LOCKED) + end + + assert_equal(4, requester.attempts.length) + end + + def test_client_default_request_given_retry_attempts + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(500, {}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create(type: :MERCHANT_LOCKED, request_options: {max_retries: 3}) + end + + assert_equal(4, requester.attempts.length) + end + + def test_client_given_request_given_retry_attempts + lithic = + Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key", max_retries: 3) + requester = MockRequester.new(500, {}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create(type: :MERCHANT_LOCKED, request_options: {max_retries: 4}) + end + + assert_equal(5, requester.attempts.length) + end + + def test_client_retry_after_seconds + lithic = + Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key", max_retries: 1) + requester = MockRequester.new(500, {"retry-after" => "1.3"}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create(type: :MERCHANT_LOCKED) + end + + assert_equal(2, requester.attempts.length) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_client_retry_after_date + lithic = + Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key", max_retries: 1) + requester = MockRequester.new(500, {"retry-after" => (Time.now + 10).httpdate}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + Thread.current.thread_variable_set(:time_now, Time.now) + lithic.cards.create(type: :MERCHANT_LOCKED) + Thread.current.thread_variable_set(:time_now, nil) + end + + assert_equal(2, requester.attempts.length) + assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0) + end + + def test_client_retry_after_ms + lithic = + Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key", max_retries: 1) + requester = MockRequester.new(500, {"retry-after-ms" => "1300"}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create(type: :MERCHANT_LOCKED) + end + + assert_equal(2, requester.attempts.length) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_retry_count_header + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(500, {}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create(type: :MERCHANT_LOCKED) + end + + retry_count_headers = requester.attempts.map { _1[:headers]["x-stainless-retry-count"] } + assert_equal(%w[0 1 2], retry_count_headers) + end + + def test_omit_retry_count_header + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(500, {}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create( + type: :MERCHANT_LOCKED, + request_options: {extra_headers: {"x-stainless-retry-count" => nil}} + ) + end + + retry_count_headers = requester.attempts.map { _1[:headers]["x-stainless-retry-count"] } + assert_equal([nil, nil, nil], retry_count_headers) + end + + def test_overwrite_retry_count_header + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(500, {}, {}) + lithic.requester = requester + + assert_raises(Lithic::InternalServerError) do + lithic.cards.create( + type: :MERCHANT_LOCKED, + request_options: {extra_headers: {"x-stainless-retry-count" => "42"}} + ) + end + + retry_count_headers = requester.attempts.map { _1[:headers]["x-stainless-retry-count"] } + assert_equal(%w[42 42 42], retry_count_headers) + end + + def test_client_redirect_307 + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(307, {"location" => "/redirected"}, {}) + lithic.requester = requester + + assert_raises(Lithic::APIConnectionError) do + lithic.cards.create(type: :MERCHANT_LOCKED, request_options: {extra_headers: {}}) + end + + assert_equal("/redirected", requester.attempts.last[:url].path) + assert_equal(requester.attempts.first[:method], requester.attempts.last[:method]) + assert_equal(requester.attempts.first[:body], requester.attempts.last[:body]) + assert_equal( + requester.attempts.first[:headers]["content-type"], + requester.attempts.last[:headers]["content-type"] + ) + end + + def test_client_redirect_303 + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(303, {"location" => "/redirected"}, {}) + lithic.requester = requester + + assert_raises(Lithic::APIConnectionError) do + lithic.cards.create(type: :MERCHANT_LOCKED, request_options: {extra_headers: {}}) + end + + assert_equal("/redirected", requester.attempts.last[:url].path) + assert_equal(:get, requester.attempts.last[:method]) + assert_nil(requester.attempts.last[:body]) + assert_nil(requester.attempts.last[:headers]["Content-Type"]) + end + + def test_client_redirect_auth_keep_same_origin + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(307, {"location" => "/redirected"}, {}) + lithic.requester = requester + + assert_raises(Lithic::APIConnectionError) do + lithic.cards.create( + type: :MERCHANT_LOCKED, + request_options: {extra_headers: {"Authorization" => "Bearer xyz"}} + ) + end + + assert_equal( + requester.attempts.first[:headers]["authorization"], + requester.attempts.last[:headers]["authorization"] + ) + end + + def test_client_redirect_auth_strip_cross_origin + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(307, {"location" => "https://example.com/redirected"}, {}) + lithic.requester = requester + + assert_raises(Lithic::APIConnectionError) do + lithic.cards.create( + type: :MERCHANT_LOCKED, + request_options: {extra_headers: {"Authorization" => "Bearer xyz"}} + ) + end + + assert_nil(requester.attempts.last[:headers]["Authorization"]) + end + + def test_default_headers + lithic = Lithic::Client.new(base_url: "http://localhost:4010", api_key: "My Lithic API Key") + requester = MockRequester.new(200, {}, {}) + lithic.requester = requester + lithic.cards.create(type: :MERCHANT_LOCKED) + headers = requester.attempts.first[:headers] + + refute_empty(headers["accept"]) + refute_empty(headers["content-type"]) + end +end diff --git a/test/lithic/resource_namespaces.rb b/test/lithic/resource_namespaces.rb new file mode 100644 index 00000000..923b999e --- /dev/null +++ b/test/lithic/resource_namespaces.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Lithic + module Test + module Resources + module AuthRules + module V2 + end + end + + module Cards + end + + module CreditProducts + end + + module Events + end + + module ExternalBankAccounts + end + + module FinancialAccounts + module Statements + end + end + + module Reports + module Settlement + end + end + + module Settlement + end + + module Statements + end + + module ThreeDS + end + + module Transactions + module Events + end + end + + module V2 + end + end + end +end diff --git a/test/lithic/resources/account_holders_test.rb b/test/lithic/resources/account_holders_test.rb new file mode 100644 index 00000000..6d048fe6 --- /dev/null +++ b/test/lithic/resources/account_holders_test.rb @@ -0,0 +1,288 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AccountHoldersTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.account_holders.create( + beneficial_owner_entities: [ + { + address: { + address1: "123 Old Forest Way", + city: "Omaha", + country: "USA", + postal_code: "68022", + state: "NE" + }, + government_id: "114-123-1513", + legal_business_name: "Acme, Inc.", + phone_numbers: ["+15555555555"] + } + ], + beneficial_owner_individuals: [ + { + address: { + address1: "123 Old Forest Way", + city: "Omaha", + country: "USA", + postal_code: "68022", + state: "NE" + }, + dob: "1991-03-08 08:00:00", + email: "tom@middle-earth.com", + first_name: "Tom", + government_id: "111-23-1412", + last_name: "Bombadil" + } + ], + business_entity: { + address: { + address1: "123 Old Forest Way", + city: "Omaha", + country: "USA", + postal_code: "68022", + state: "NE" + }, + government_id: "114-123-1513", + legal_business_name: "Acme, Inc.", + phone_numbers: ["+15555555555"] + }, + control_person: { + address: { + address1: "123 Old Forest Way", + city: "Omaha", + country: "USA", + postal_code: "68022", + state: "NE" + }, + dob: "1991-03-08 08:00:00", + email: "tom@middle-earth.com", + first_name: "Tom", + government_id: "111-23-1412", + last_name: "Bombadil" + }, + nature_of_business: "Software company selling solutions to the restaurant industry", + tos_timestamp: "2018-05-29T21:16:05Z", + workflow: :KYB_BASIC + ) + + assert_pattern do + response => Lithic::Models::AccountHolderCreateResponse + end + + assert_pattern do + response => { + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::Status, + status_reasons: ^(Lithic::ArrayOf[enum: Lithic::Models::AccountHolderCreateResponse::StatusReason]), + created: Time | nil, + external_id: String | nil, + required_documents: ^(Lithic::ArrayOf[Lithic::Models::RequiredDocument]) | nil + } + end + end + + def test_retrieve + response = @lithic.account_holders.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AccountHolder + end + + assert_pattern do + response => { + token: String, + created: Time, + account_token: String | nil, + beneficial_owner_entities: ^(Lithic::ArrayOf[Lithic::Models::AccountHolder::BeneficialOwnerEntity]) | nil, + beneficial_owner_individuals: ^(Lithic::ArrayOf[Lithic::Models::AccountHolder::BeneficialOwnerIndividual]) | nil, + business_account_token: String | nil, + business_entity: Lithic::Models::AccountHolder::BusinessEntity | nil, + control_person: Lithic::Models::AccountHolder::ControlPerson | nil, + email: String | nil, + exemption_type: Lithic::Models::AccountHolder::ExemptionType | nil, + external_id: String | nil, + individual: Lithic::Models::AccountHolder::Individual | nil, + nature_of_business: String | nil, + phone_number: String | nil, + required_documents: ^(Lithic::ArrayOf[Lithic::Models::RequiredDocument]) | nil, + status: Lithic::Models::AccountHolder::Status | nil, + status_reasons: ^(Lithic::ArrayOf[enum: Lithic::Models::AccountHolder::StatusReason]) | nil, + user_type: Lithic::Models::AccountHolder::UserType | nil, + verification_application: Lithic::Models::AccountHolder::VerificationApplication | nil, + website_url: String | nil + } + end + end + + def test_update + response = @lithic.account_holders.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AccountHolderUpdateResponse + end + + assert_pattern do + case response + in Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse + in Lithic::Models::AccountHolderUpdateResponse::PatchResponse + end + end + end + + def test_list + response = @lithic.account_holders.list + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::AccountHolder + end + + assert_pattern do + row => { + token: String, + created: Time, + account_token: String | nil, + beneficial_owner_entities: ^(Lithic::ArrayOf[Lithic::Models::AccountHolder::BeneficialOwnerEntity]) | nil, + beneficial_owner_individuals: ^(Lithic::ArrayOf[Lithic::Models::AccountHolder::BeneficialOwnerIndividual]) | nil, + business_account_token: String | nil, + business_entity: Lithic::Models::AccountHolder::BusinessEntity | nil, + control_person: Lithic::Models::AccountHolder::ControlPerson | nil, + email: String | nil, + exemption_type: Lithic::Models::AccountHolder::ExemptionType | nil, + external_id: String | nil, + individual: Lithic::Models::AccountHolder::Individual | nil, + nature_of_business: String | nil, + phone_number: String | nil, + required_documents: ^(Lithic::ArrayOf[Lithic::Models::RequiredDocument]) | nil, + status: Lithic::Models::AccountHolder::Status | nil, + status_reasons: ^(Lithic::ArrayOf[enum: Lithic::Models::AccountHolder::StatusReason]) | nil, + user_type: Lithic::Models::AccountHolder::UserType | nil, + verification_application: Lithic::Models::AccountHolder::VerificationApplication | nil, + website_url: String | nil + } + end + end + + def test_list_documents + response = @lithic.account_holders.list_documents("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AccountHolderListDocumentsResponse + end + + assert_pattern do + response => { + data: ^(Lithic::ArrayOf[Lithic::Models::Document]) | nil + } + end + end + + def test_retrieve_document_required_params + response = + @lithic.account_holders.retrieve_document( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_holder_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::Document + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::DocumentType, + entity_token: String, + required_document_uploads: ^(Lithic::ArrayOf[Lithic::Models::Document::RequiredDocumentUpload]) + } + end + end + + def test_simulate_enrollment_document_review_required_params + response = + @lithic.account_holders.simulate_enrollment_document_review( + document_upload_token: "document_upload_token", + status: :UPLOADED + ) + + assert_pattern do + response => Lithic::Models::Document + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::DocumentType, + entity_token: String, + required_document_uploads: ^(Lithic::ArrayOf[Lithic::Models::Document::RequiredDocumentUpload]) + } + end + end + + def test_simulate_enrollment_review + response = @lithic.account_holders.simulate_enrollment_review + + assert_pattern do + response => Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse + end + + assert_pattern do + response => { + token: String | nil, + account_token: String | nil, + beneficial_owner_entities: ^(Lithic::ArrayOf[Lithic::Models::KYBBusinessEntity]) | nil, + beneficial_owner_individuals: ^(Lithic::ArrayOf[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual]) | nil, + business_account_token: String | nil, + business_entity: Lithic::Models::KYBBusinessEntity | nil, + control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson | nil, + created: Time | nil, + email: String | nil, + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType | nil, + external_id: String | nil, + individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual | nil, + nature_of_business: String | nil, + phone_number: String | nil, + required_documents: ^(Lithic::ArrayOf[Lithic::Models::RequiredDocument]) | nil, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status | nil, + status_reasons: ^(Lithic::ArrayOf[enum: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason]) | nil, + user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType | nil, + verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication | nil, + website_url: String | nil + } + end + end + + def test_upload_document_required_params + response = + @lithic.account_holders.upload_document( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + document_type: :EIN_LETTER, + entity_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::Document + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::DocumentType, + entity_token: String, + required_document_uploads: ^(Lithic::ArrayOf[Lithic::Models::Document::RequiredDocumentUpload]) + } + end + end +end diff --git a/test/lithic/resources/accounts_test.rb b/test/lithic/resources/accounts_test.rb new file mode 100644 index 00000000..3af4377b --- /dev/null +++ b/test/lithic/resources/accounts_test.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AccountsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Account + end + + assert_pattern do + response => { + token: String, + created: Time | nil, + spend_limit: Lithic::Models::Account::SpendLimit, + state: Lithic::Models::Account::State, + account_holder: Lithic::Models::Account::AccountHolder | nil, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + verification_address: Lithic::Models::Account::VerificationAddress | nil + } + end + end + + def test_update + skip("Prism returns invalid data") + + response = @lithic.accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Account + end + + assert_pattern do + response => { + token: String, + created: Time | nil, + spend_limit: Lithic::Models::Account::SpendLimit, + state: Lithic::Models::Account::State, + account_holder: Lithic::Models::Account::AccountHolder | nil, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + verification_address: Lithic::Models::Account::VerificationAddress | nil + } + end + end + + def test_list + response = @lithic.accounts.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Account + end + + assert_pattern do + row => { + token: String, + created: Time | nil, + spend_limit: Lithic::Models::Account::SpendLimit, + state: Lithic::Models::Account::State, + account_holder: Lithic::Models::Account::AccountHolder | nil, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + verification_address: Lithic::Models::Account::VerificationAddress | nil + } + end + end + + def test_retrieve_spend_limits + response = @lithic.accounts.retrieve_spend_limits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AccountSpendLimits + end + + assert_pattern do + response => { + available_spend_limit: Lithic::Models::AccountSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::Models::AccountSpendLimits::SpendLimit | nil, + spend_velocity: Lithic::Models::AccountSpendLimits::SpendVelocity | nil + } + end + end +end diff --git a/test/lithic/resources/aggregate_balances_test.rb b/test/lithic/resources/aggregate_balances_test.rb new file mode 100644 index 00000000..f498dace --- /dev/null +++ b/test/lithic/resources/aggregate_balances_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AggregateBalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.aggregate_balances.list + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::AggregateBalance + end + + assert_pattern do + row => { + available_amount: Integer, + created: Time, + currency: String, + financial_account_type: Lithic::Models::AggregateBalance::FinancialAccountType, + last_financial_account_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/auth_rules/v2/backtests_test.rb b/test/lithic/resources/auth_rules/v2/backtests_test.rb new file mode 100644 index 00000000..f054ec79 --- /dev/null +++ b/test/lithic/resources/auth_rules/v2/backtests_test.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::AuthRules::V2::BacktestsTest < Lithic::Test::ResourceTest + def test_create + response = @lithic.auth_rules.v2.backtests.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2::BacktestCreateResponse + end + + assert_pattern do + response => { + backtest_token: String | nil + } + end + end + + def test_retrieve_required_params + response = + @lithic.auth_rules.v2.backtests.retrieve( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + auth_rule_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::AuthRules::V2::BacktestResults + end + + assert_pattern do + response => { + backtest_token: String, + results: Lithic::Models::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters + } + end + end +end diff --git a/test/lithic/resources/auth_rules/v2_test.rb b/test/lithic/resources/auth_rules/v2_test.rb new file mode 100644 index 00000000..5a588feb --- /dev/null +++ b/test/lithic/resources/auth_rules/v2_test.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::AuthRules::V2Test < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.auth_rules.v2.create(account_tokens: ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]) + + assert_pattern do + response => Lithic::Models::AuthRules::V2CreateResponse + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::ArrayOf[String]), + card_tokens: ^(Lithic::ArrayOf[String]), + current_version: Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion | nil, + draft_version: Lithic::Models::AuthRules::V2CreateResponse::DraftVersion | nil, + name: String | nil, + program_level: Lithic::BooleanModel, + state: Lithic::Models::AuthRules::V2CreateResponse::State, + type: Lithic::Models::AuthRules::V2CreateResponse::Type, + excluded_card_tokens: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_retrieve + response = @lithic.auth_rules.v2.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2RetrieveResponse + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::ArrayOf[String]), + card_tokens: ^(Lithic::ArrayOf[String]), + current_version: Lithic::Models::AuthRules::V2RetrieveResponse::CurrentVersion | nil, + draft_version: Lithic::Models::AuthRules::V2RetrieveResponse::DraftVersion | nil, + name: String | nil, + program_level: Lithic::BooleanModel, + state: Lithic::Models::AuthRules::V2RetrieveResponse::State, + type: Lithic::Models::AuthRules::V2RetrieveResponse::Type, + excluded_card_tokens: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_update + response = @lithic.auth_rules.v2.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2UpdateResponse + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::ArrayOf[String]), + card_tokens: ^(Lithic::ArrayOf[String]), + current_version: Lithic::Models::AuthRules::V2UpdateResponse::CurrentVersion | nil, + draft_version: Lithic::Models::AuthRules::V2UpdateResponse::DraftVersion | nil, + name: String | nil, + program_level: Lithic::BooleanModel, + state: Lithic::Models::AuthRules::V2UpdateResponse::State, + type: Lithic::Models::AuthRules::V2UpdateResponse::Type, + excluded_card_tokens: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_list + response = @lithic.auth_rules.v2.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::AuthRules::V2ListResponse + end + + assert_pattern do + row => { + token: String, + account_tokens: ^(Lithic::ArrayOf[String]), + card_tokens: ^(Lithic::ArrayOf[String]), + current_version: Lithic::Models::AuthRules::V2ListResponse::CurrentVersion | nil, + draft_version: Lithic::Models::AuthRules::V2ListResponse::DraftVersion | nil, + name: String | nil, + program_level: Lithic::BooleanModel, + state: Lithic::Models::AuthRules::V2ListResponse::State, + type: Lithic::Models::AuthRules::V2ListResponse::Type, + excluded_card_tokens: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_delete + response = @lithic.auth_rules.v2.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_apply_required_params + response = + @lithic.auth_rules.v2.apply( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_tokens: ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"] + ) + + assert_pattern do + response => Lithic::Models::AuthRules::V2ApplyResponse + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::ArrayOf[String]), + card_tokens: ^(Lithic::ArrayOf[String]), + current_version: Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion | nil, + draft_version: Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion | nil, + name: String | nil, + program_level: Lithic::BooleanModel, + state: Lithic::Models::AuthRules::V2ApplyResponse::State, + type: Lithic::Models::AuthRules::V2ApplyResponse::Type, + excluded_card_tokens: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_draft + response = @lithic.auth_rules.v2.draft("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2DraftResponse + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::ArrayOf[String]), + card_tokens: ^(Lithic::ArrayOf[String]), + current_version: Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion | nil, + draft_version: Lithic::Models::AuthRules::V2DraftResponse::DraftVersion | nil, + name: String | nil, + program_level: Lithic::BooleanModel, + state: Lithic::Models::AuthRules::V2DraftResponse::State, + type: Lithic::Models::AuthRules::V2DraftResponse::Type, + excluded_card_tokens: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_promote + response = @lithic.auth_rules.v2.promote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2PromoteResponse + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::ArrayOf[String]), + card_tokens: ^(Lithic::ArrayOf[String]), + current_version: Lithic::Models::AuthRules::V2PromoteResponse::CurrentVersion | nil, + draft_version: Lithic::Models::AuthRules::V2PromoteResponse::DraftVersion | nil, + name: String | nil, + program_level: Lithic::BooleanModel, + state: Lithic::Models::AuthRules::V2PromoteResponse::State, + type: Lithic::Models::AuthRules::V2PromoteResponse::Type, + excluded_card_tokens: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_report + response = @lithic.auth_rules.v2.report("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2ReportResponse + end + + assert_pattern do + response => { + report_token: String | nil + } + end + end +end diff --git a/test/lithic/resources/auth_rules_test.rb b/test/lithic/resources/auth_rules_test.rb new file mode 100644 index 00000000..047830a7 --- /dev/null +++ b/test/lithic/resources/auth_rules_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AuthRulesTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/auth_stream_enrollment_test.rb b/test/lithic/resources/auth_stream_enrollment_test.rb new file mode 100644 index 00000000..00b7b940 --- /dev/null +++ b/test/lithic/resources/auth_stream_enrollment_test.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AuthStreamEnrollmentTest < Lithic::Test::ResourceTest + def test_retrieve_secret + response = @lithic.auth_stream_enrollment.retrieve_secret + + assert_pattern do + response => Lithic::Models::AuthStreamSecret + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + response = @lithic.auth_stream_enrollment.rotate_secret + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/balances_test.rb b/test/lithic/resources/balances_test.rb new file mode 100644 index 00000000..f717f0cd --- /dev/null +++ b/test/lithic/resources/balances_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::BalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.balances.list + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Balance + end + + assert_pattern do + row => { + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::FinancialAccountType, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/book_transfers_test.rb b/test/lithic/resources/book_transfers_test.rb new file mode 100644 index 00000000..5b297084 --- /dev/null +++ b/test/lithic/resources/book_transfers_test.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::BookTransfersTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.book_transfers.create( + amount: 1, + category: :ADJUSTMENT, + from_financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + subtype: "subtype", + to_financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type: :ATM_WITHDRAWAL + ) + + assert_pattern do + response => Lithic::Models::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::BookTransferResponse::Event]), + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::Status, + to_financial_account_token: Lithic::Unknown, + updated: Time + } + end + end + + def test_retrieve + response = @lithic.book_transfers.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::BookTransferResponse::Event]), + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::Status, + to_financial_account_token: Lithic::Unknown, + updated: Time + } + end + end + + def test_list + response = @lithic.book_transfers.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::BookTransferResponse + end + + assert_pattern do + row => { + token: String, + category: Lithic::Models::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::BookTransferResponse::Event]), + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::Status, + to_financial_account_token: Lithic::Unknown, + updated: Time + } + end + end + + def test_reverse + response = @lithic.book_transfers.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::BookTransferResponse::Event]), + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::Status, + to_financial_account_token: Lithic::Unknown, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/card_programs_test.rb b/test/lithic/resources/card_programs_test.rb new file mode 100644 index 00000000..13399f89 --- /dev/null +++ b/test/lithic/resources/card_programs_test.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CardProgramsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.card_programs.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::CardProgram + end + + assert_pattern do + response => { + token: String, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String | nil, + settlement_currencies: ^(Lithic::ArrayOf[String]) | nil + } + end + end + + def test_list + response = @lithic.card_programs.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::CardProgram + end + + assert_pattern do + row => { + token: String, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String | nil, + settlement_currencies: ^(Lithic::ArrayOf[String]) | nil + } + end + end +end diff --git a/test/lithic/resources/cards/aggregate_balances_test.rb b/test/lithic/resources/cards/aggregate_balances_test.rb new file mode 100644 index 00000000..adee35f5 --- /dev/null +++ b/test/lithic/resources/cards/aggregate_balances_test.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Cards::AggregateBalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.cards.aggregate_balances.list + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Cards::AggregateBalanceListResponse + end + + assert_pattern do + row => { + available_amount: Integer, + created: Time, + currency: String, + last_card_token: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/cards/balances_test.rb b/test/lithic/resources/cards/balances_test.rb new file mode 100644 index 00000000..07edc6ff --- /dev/null +++ b/test/lithic/resources/cards/balances_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Cards::BalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.cards.balances.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Cards::BalanceListResponse + end + + assert_pattern do + row => { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::Cards::BalanceListResponse::Type, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/cards/financial_transactions_test.rb b/test/lithic/resources/cards/financial_transactions_test.rb new file mode 100644 index 00000000..96ea6c57 --- /dev/null +++ b/test/lithic/resources/cards/financial_transactions_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Cards::FinancialTransactionsTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.cards.financial_transactions.retrieve( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + card_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::FinancialTransaction + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::ArrayOf[Lithic::Models::FinancialTransaction::Event]), + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::Status, + updated: Time + } + end + end + + def test_list + response = @lithic.cards.financial_transactions.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::FinancialTransaction + end + + assert_pattern do + row => { + token: String, + category: Lithic::Models::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::ArrayOf[Lithic::Models::FinancialTransaction::Event]), + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::Status, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/cards_test.rb b/test/lithic/resources/cards_test.rb new file mode 100644 index 00000000..f3460380 --- /dev/null +++ b/test/lithic/resources/cards_test.rb @@ -0,0 +1,362 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CardsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.cards.create(type: :MERCHANT_LOCKED) + + assert_pattern do + response => Lithic::Models::Card + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end + + def test_retrieve + response = @lithic.cards.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Card + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end + + def test_update + response = @lithic.cards.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Card + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end + + def test_list + response = @lithic.cards.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Card + end + + assert_pattern do + row => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end + + def test_convert_physical_required_params + response = + @lithic.cards.convert_physical( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + shipping_address: { + address1: "5 Broad Street", + city: "NEW YORK", + country: "USA", + first_name: "Janet", + last_name: "Yellen", + postal_code: "10001", + state: "NY" + } + ) + + assert_pattern do + response => Lithic::Models::Card + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end + + def test_embed_required_params + response = @lithic.cards.embed(embed_request: "embed_request", hmac: "hmac") + + assert_pattern do + response => String + end + end + + def test_provision + response = @lithic.cards.provision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::CardProvisionResponse + end + + assert_pattern do + response => { + provisioning_payload: String | nil + } + end + end + + def test_reissue + response = @lithic.cards.reissue("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Card + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end + + def test_renew_required_params + response = + @lithic.cards.renew( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + shipping_address: { + address1: "5 Broad Street", + city: "NEW YORK", + country: "USA", + first_name: "Janet", + last_name: "Yellen", + postal_code: "10001", + state: "NY" + } + ) + + assert_pattern do + response => Lithic::Models::Card + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end + + def test_retrieve_spend_limits + response = @lithic.cards.retrieve_spend_limits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::CardSpendLimits + end + + assert_pattern do + response => { + available_spend_limit: Lithic::Models::CardSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::Models::CardSpendLimits::SpendLimit | nil, + spend_velocity: Lithic::Models::CardSpendLimits::SpendVelocity | nil + } + end + end + + def test_search_by_pan_required_params + response = @lithic.cards.search_by_pan(pan: "4111111289144142") + + assert_pattern do + response => Lithic::Models::Card + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::Models::Card::Funding, + last_four: String, + pin_status: Lithic::Models::Card::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::SpendLimitDuration, + state: Lithic::Models::Card::State, + type: Lithic::Models::Card::Type, + auth_rule_tokens: ^(Lithic::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + cvv: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + pan: String | nil, + pending_commands: ^(Lithic::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil + } + end + end +end diff --git a/test/lithic/resources/credit_products/extended_credit_test.rb b/test/lithic/resources/credit_products/extended_credit_test.rb new file mode 100644 index 00000000..a9ec170f --- /dev/null +++ b/test/lithic/resources/credit_products/extended_credit_test.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::CreditProducts::ExtendedCreditTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.credit_products.extended_credit.retrieve("credit_product_token") + + assert_pattern do + response => Lithic::Models::CreditProducts::CreditProductsExtendedCredit + end + + assert_pattern do + response => { + credit_extended: Integer + } + end + end +end diff --git a/test/lithic/resources/credit_products/prime_rates_test.rb b/test/lithic/resources/credit_products/prime_rates_test.rb new file mode 100644 index 00000000..b067dff0 --- /dev/null +++ b/test/lithic/resources/credit_products/prime_rates_test.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::CreditProducts::PrimeRatesTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.credit_products.prime_rates.create( + "credit_product_token", + effective_date: "2019-12-27", + rate: "rate" + ) + + assert_pattern do + response => nil + end + end + + def test_retrieve + response = @lithic.credit_products.prime_rates.retrieve("credit_product_token") + + assert_pattern do + response => Lithic::Models::CreditProducts::PrimeRateRetrieveResponse + end + + assert_pattern do + response => { + data: ^(Lithic::ArrayOf[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data]), + has_more: Lithic::BooleanModel + } + end + end +end diff --git a/test/lithic/resources/credit_products_test.rb b/test/lithic/resources/credit_products_test.rb new file mode 100644 index 00000000..8364fc4f --- /dev/null +++ b/test/lithic/resources/credit_products_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CreditProductsTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/digital_card_art_test.rb b/test/lithic/resources/digital_card_art_test.rb new file mode 100644 index 00000000..ed37ede1 --- /dev/null +++ b/test/lithic/resources/digital_card_art_test.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::DigitalCardArtTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.digital_card_art.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::DigitalCardArtAPI + end + + assert_pattern do + response => { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: Lithic::BooleanModel, + network: Lithic::Models::DigitalCardArtAPI::Network, + is_card_program_default: Lithic::BooleanModel | nil + } + end + end + + def test_list + response = @lithic.digital_card_art.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::DigitalCardArtAPI + end + + assert_pattern do + row => { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: Lithic::BooleanModel, + network: Lithic::Models::DigitalCardArtAPI::Network, + is_card_program_default: Lithic::BooleanModel | nil + } + end + end +end diff --git a/test/lithic/resources/disputes_test.rb b/test/lithic/resources/disputes_test.rb new file mode 100644 index 00000000..f6332499 --- /dev/null +++ b/test/lithic/resources/disputes_test.rb @@ -0,0 +1,272 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::DisputesTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.disputes.create( + amount: 10_000, + reason: :ATM_CASH_MISDISPENSE, + transaction_token: "12345624-aa69-4cbc-a946-30d90181b621" + ) + + assert_pattern do + response => Lithic::Models::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Models::Dispute::Reason, + representment_date: Time | nil, + resolution_amount: Integer | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Models::Dispute::ResolutionReason | nil, + status: Lithic::Models::Dispute::Status, + transaction_token: String + } + end + end + + def test_retrieve + response = @lithic.disputes.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Models::Dispute::Reason, + representment_date: Time | nil, + resolution_amount: Integer | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Models::Dispute::ResolutionReason | nil, + status: Lithic::Models::Dispute::Status, + transaction_token: String + } + end + end + + def test_update + response = @lithic.disputes.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Models::Dispute::Reason, + representment_date: Time | nil, + resolution_amount: Integer | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Models::Dispute::ResolutionReason | nil, + status: Lithic::Models::Dispute::Status, + transaction_token: String + } + end + end + + def test_list + response = @lithic.disputes.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Dispute + end + + assert_pattern do + row => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Models::Dispute::Reason, + representment_date: Time | nil, + resolution_amount: Integer | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Models::Dispute::ResolutionReason | nil, + status: Lithic::Models::Dispute::Status, + transaction_token: String + } + end + end + + def test_delete + response = @lithic.disputes.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Models::Dispute::Reason, + representment_date: Time | nil, + resolution_amount: Integer | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Models::Dispute::ResolutionReason | nil, + status: Lithic::Models::Dispute::Status, + transaction_token: String + } + end + end + + def test_delete_evidence_required_params + response = + @lithic.disputes.delete_evidence( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + dispute_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::DisputeEvidence + end + + assert_pattern do + response => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end + + def test_initiate_evidence_upload + response = @lithic.disputes.initiate_evidence_upload("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::DisputeEvidence + end + + assert_pattern do + response => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end + + def test_list_evidences + response = @lithic.disputes.list_evidences("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::DisputeEvidence + end + + assert_pattern do + row => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end + + def test_retrieve_evidence_required_params + response = + @lithic.disputes.retrieve_evidence( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + dispute_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::DisputeEvidence + end + + assert_pattern do + response => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end +end diff --git a/test/lithic/resources/events/subscriptions_test.rb b/test/lithic/resources/events/subscriptions_test.rb new file mode 100644 index 00000000..0dbe540e --- /dev/null +++ b/test/lithic/resources/events/subscriptions_test.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Events::SubscriptionsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.events.subscriptions.create(url: "https://example.com") + + assert_pattern do + response => Lithic::Models::EventSubscription + end + + assert_pattern do + response => { + token: String, + description: String, + disabled: Lithic::BooleanModel, + url: String, + event_types: ^(Lithic::ArrayOf[enum: Lithic::Models::EventSubscription::EventType]) | nil + } + end + end + + def test_retrieve + response = @lithic.events.subscriptions.retrieve("event_subscription_token") + + assert_pattern do + response => Lithic::Models::EventSubscription + end + + assert_pattern do + response => { + token: String, + description: String, + disabled: Lithic::BooleanModel, + url: String, + event_types: ^(Lithic::ArrayOf[enum: Lithic::Models::EventSubscription::EventType]) | nil + } + end + end + + def test_update_required_params + response = @lithic.events.subscriptions.update("event_subscription_token", url: "https://example.com") + + assert_pattern do + response => Lithic::Models::EventSubscription + end + + assert_pattern do + response => { + token: String, + description: String, + disabled: Lithic::BooleanModel, + url: String, + event_types: ^(Lithic::ArrayOf[enum: Lithic::Models::EventSubscription::EventType]) | nil + } + end + end + + def test_list + response = @lithic.events.subscriptions.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::EventSubscription + end + + assert_pattern do + row => { + token: String, + description: String, + disabled: Lithic::BooleanModel, + url: String, + event_types: ^(Lithic::ArrayOf[enum: Lithic::Models::EventSubscription::EventType]) | nil + } + end + end + + def test_delete + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.delete("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_list_attempts + response = @lithic.events.subscriptions.list_attempts("event_subscription_token") + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::MessageAttempt + end + + assert_pattern do + row => { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::Status, + url: String + } + end + end + + def test_recover + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.recover("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_replay_missing + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.replay_missing("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_retrieve_secret + response = @lithic.events.subscriptions.retrieve_secret("event_subscription_token") + + assert_pattern do + response => Lithic::Models::Events::SubscriptionRetrieveSecretResponse + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.rotate_secret("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_send_simulated_example + response = @lithic.events.subscriptions.send_simulated_example("event_subscription_token") + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/events_test.rb b/test/lithic/resources/events_test.rb new file mode 100644 index 00000000..6d6fab97 --- /dev/null +++ b/test/lithic/resources/events_test.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::EventsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.events.retrieve("event_token") + + assert_pattern do + response => Lithic::Models::Event + end + + assert_pattern do + response => { + token: String, + created: Time, + event_type: Lithic::Models::Event::EventType, + payload: ^(Lithic::HashOf[Lithic::Unknown]) + } + end + end + + def test_list + response = @lithic.events.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Event + end + + assert_pattern do + row => { + token: String, + created: Time, + event_type: Lithic::Models::Event::EventType, + payload: ^(Lithic::HashOf[Lithic::Unknown]) + } + end + end + + def test_list_attempts + response = @lithic.events.list_attempts("event_token") + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::MessageAttempt + end + + assert_pattern do + row => { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::Status, + url: String + } + end + end +end diff --git a/test/lithic/resources/external_bank_accounts/micro_deposits_test.rb b/test/lithic/resources/external_bank_accounts/micro_deposits_test.rb new file mode 100644 index 00000000..ce39bbc6 --- /dev/null +++ b/test/lithic/resources/external_bank_accounts/micro_deposits_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::ExternalBankAccounts::MicroDepositsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.external_bank_accounts.micro_deposits.create( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + micro_deposits: [0, 0] + ) + + assert_pattern do + response => Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState, + account_token: String | nil, + address: Lithic::Models::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end +end diff --git a/test/lithic/resources/external_bank_accounts_test.rb b/test/lithic/resources/external_bank_accounts_test.rb new file mode 100644 index 00000000..9805399a --- /dev/null +++ b/test/lithic/resources/external_bank_accounts_test.rb @@ -0,0 +1,233 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ExternalBankAccountsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.external_bank_accounts.create( + account_number: "12345678901234567", + country: "USD", + currency: "USD", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + owner: "owner", + owner_type: :INDIVIDUAL, + routing_number: "123456789", + type: :CHECKING, + verification_method: :MANUAL + ) + + assert_pattern do + response => Lithic::Models::ExternalBankAccountCreateResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::State, + type: Lithic::Models::ExternalBankAccountCreateResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::VerificationState, + account_token: String | nil, + address: Lithic::Models::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_retrieve + response = @lithic.external_bank_accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalBankAccountRetrieveResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::State, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState, + account_token: String | nil, + address: Lithic::Models::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_update + response = @lithic.external_bank_accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalBankAccountUpdateResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::State, + type: Lithic::Models::ExternalBankAccountUpdateResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState, + account_token: String | nil, + address: Lithic::Models::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_list + response = @lithic.external_bank_accounts.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::ExternalBankAccountListResponse + end + + assert_pattern do + row => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::State, + type: Lithic::Models::ExternalBankAccountListResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountListResponse::VerificationState, + account_token: String | nil, + address: Lithic::Models::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_retry_micro_deposits + response = @lithic.external_bank_accounts.retry_micro_deposits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState, + account_token: String | nil, + address: Lithic::Models::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_retry_prenote + response = @lithic.external_bank_accounts.retry_prenote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalBankAccountRetryPrenoteResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::State, + type: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountRetryPrenoteResponse::VerificationState, + account_token: String | nil, + address: Lithic::Models::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end +end diff --git a/test/lithic/resources/external_payments_test.rb b/test/lithic/resources/external_payments_test.rb new file mode 100644 index 00000000..836fbd14 --- /dev/null +++ b/test/lithic/resources/external_payments_test.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ExternalPaymentsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.external_payments.create( + amount: 0, + category: :EXTERNAL_WIRE, + effective_date: "2019-12-27", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + payment_type: :DEPOSIT + ) + + assert_pattern do + response => Lithic::Models::ExternalPayment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ExternalPayment::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event]), + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_retrieve + response = @lithic.external_payments.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalPayment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ExternalPayment::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event]), + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.external_payments.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::ExternalPayment + end + + assert_pattern do + row => { + token: String, + category: Lithic::Models::ExternalPayment::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event]), + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_cancel_required_params + response = + @lithic.external_payments.cancel("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::Models::ExternalPayment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ExternalPayment::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event]), + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_release_required_params + response = + @lithic.external_payments.release("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::Models::ExternalPayment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ExternalPayment::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event]), + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_reverse_required_params + response = + @lithic.external_payments.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::Models::ExternalPayment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ExternalPayment::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event]), + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_settle_required_params + response = + @lithic.external_payments.settle("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::Models::ExternalPayment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ExternalPayment::Category, + created: Time, + currency: String, + events: ^(Lithic::ArrayOf[Lithic::Models::ExternalPayment::Event]), + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::PaymentType, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::Result, + settled_amount: Integer, + status: Lithic::Models::ExternalPayment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/balances_test.rb b/test/lithic/resources/financial_accounts/balances_test.rb new file mode 100644 index 00000000..47e90ca0 --- /dev/null +++ b/test/lithic/resources/financial_accounts/balances_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::BalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.financial_accounts.balances.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::FinancialAccounts::BalanceListResponse + end + + assert_pattern do + row => { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccounts::BalanceListResponse::Type, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/credit_configuration_test.rb b/test/lithic/resources/financial_accounts/credit_configuration_test.rb new file mode 100644 index 00000000..f2a3b6da --- /dev/null +++ b/test/lithic/resources/financial_accounts/credit_configuration_test.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::CreditConfigurationTest < Lithic::Test::ResourceTest + def test_retrieve + response = + @lithic.financial_accounts.credit_configuration.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig + end + + assert_pattern do + response => { + account_token: String, + charged_off_reason: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason | nil, + credit_limit: Integer | nil, + credit_product_token: String | nil, + external_bank_account_token: String | nil, + financial_account_state: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState, + is_spend_blocked: Lithic::BooleanModel, + tier: String | nil + } + end + end + + def test_update + response = @lithic.financial_accounts.credit_configuration.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig + end + + assert_pattern do + response => { + account_token: String, + charged_off_reason: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::ChargedOffReason | nil, + credit_limit: Integer | nil, + credit_product_token: String | nil, + external_bank_account_token: String | nil, + financial_account_state: Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::FinancialAccountState, + is_spend_blocked: Lithic::BooleanModel, + tier: String | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/financial_transactions_test.rb b/test/lithic/resources/financial_accounts/financial_transactions_test.rb new file mode 100644 index 00000000..1e261030 --- /dev/null +++ b/test/lithic/resources/financial_accounts/financial_transactions_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::FinancialTransactionsTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.financial_accounts.financial_transactions.retrieve( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::FinancialTransaction + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::ArrayOf[Lithic::Models::FinancialTransaction::Event]), + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::Status, + updated: Time + } + end + end + + def test_list + response = @lithic.financial_accounts.financial_transactions.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::FinancialTransaction + end + + assert_pattern do + row => { + token: String, + category: Lithic::Models::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::ArrayOf[Lithic::Models::FinancialTransaction::Event]), + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::Status, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/loan_tapes_test.rb b/test/lithic/resources/financial_accounts/loan_tapes_test.rb new file mode 100644 index 00000000..085addb1 --- /dev/null +++ b/test/lithic/resources/financial_accounts/loan_tapes_test.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::LoanTapesTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.financial_accounts.loan_tapes.retrieve( + "loan_tape_token", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::FinancialAccounts::LoanTape + end + + assert_pattern do + response => { + token: String, + account_standing: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::Models::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::Models::FinancialAccounts::LoanTape::DayTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails | nil, + minimum_payment_balance: Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals, + previous_statement_balance: Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::Models::FinancialAccounts::LoanTape::YtdTotals, + tier: String | nil + } + end + end + + def test_list + response = @lithic.financial_accounts.loan_tapes.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::FinancialAccounts::LoanTape + end + + assert_pattern do + row => { + token: String, + account_standing: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::Models::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::Models::FinancialAccounts::LoanTape::DayTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails | nil, + minimum_payment_balance: Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::Models::FinancialAccounts::LoanTape::PeriodTotals, + previous_statement_balance: Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::Models::FinancialAccounts::LoanTape::YtdTotals, + tier: String | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/statements/line_items_test.rb b/test/lithic/resources/financial_accounts/statements/line_items_test.rb new file mode 100644 index 00000000..24d661d1 --- /dev/null +++ b/test/lithic/resources/financial_accounts/statements/line_items_test.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::Statements::LineItemsTest < Lithic::Test::ResourceTest + def test_list_required_params + response = + @lithic.financial_accounts.statements.line_items.list( + "statement_token", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data + end + + assert_pattern do + row => { + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: String | nil, + descriptor: String | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/statements_test.rb b/test/lithic/resources/financial_accounts/statements_test.rb new file mode 100644 index 00000000..8358ff69 --- /dev/null +++ b/test/lithic/resources/financial_accounts/statements_test.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::StatementsTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.financial_accounts.statements.retrieve( + "statement_token", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::FinancialAccounts::Statement + end + + assert_pattern do + response => { + token: String, + account_standing: Lithic::Models::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::Models::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date | nil, + period_totals: Lithic::Models::FinancialAccounts::Statement::PeriodTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::StatementType, + updated: Time, + ytd_totals: Lithic::Models::FinancialAccounts::Statement::YtdTotals, + interest_details: Lithic::Models::FinancialAccounts::Statement::InterestDetails | nil, + next_payment_due_date: Date | nil, + next_statement_end_date: Date | nil + } + end + end + + def test_list + response = @lithic.financial_accounts.statements.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::FinancialAccounts::Statement + end + + assert_pattern do + row => { + token: String, + account_standing: Lithic::Models::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::Models::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date | nil, + period_totals: Lithic::Models::FinancialAccounts::Statement::PeriodTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::StatementType, + updated: Time, + ytd_totals: Lithic::Models::FinancialAccounts::Statement::YtdTotals, + interest_details: Lithic::Models::FinancialAccounts::Statement::InterestDetails | nil, + next_payment_due_date: Date | nil, + next_statement_end_date: Date | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts_test.rb b/test/lithic/resources/financial_accounts_test.rb new file mode 100644 index 00000000..f3f573a5 --- /dev/null +++ b/test/lithic/resources/financial_accounts_test.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::FinancialAccountsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.financial_accounts.create(nickname: "nickname", type: :OPERATING) + + assert_pattern do + response => Lithic::Models::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::BooleanModel, + nickname: String | nil, + status: Lithic::Models::FinancialAccount::Status, + type: Lithic::Models::FinancialAccount::Type, + updated: Time, + account_number: String | nil, + routing_number: String | nil, + status_change_reason: Lithic::Models::FinancialAccount::StatusChangeReason | nil + } + end + end + + def test_retrieve + response = @lithic.financial_accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::BooleanModel, + nickname: String | nil, + status: Lithic::Models::FinancialAccount::Status, + type: Lithic::Models::FinancialAccount::Type, + updated: Time, + account_number: String | nil, + routing_number: String | nil, + status_change_reason: Lithic::Models::FinancialAccount::StatusChangeReason | nil + } + end + end + + def test_update + response = @lithic.financial_accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::BooleanModel, + nickname: String | nil, + status: Lithic::Models::FinancialAccount::Status, + type: Lithic::Models::FinancialAccount::Type, + updated: Time, + account_number: String | nil, + routing_number: String | nil, + status_change_reason: Lithic::Models::FinancialAccount::StatusChangeReason | nil + } + end + end + + def test_list + response = @lithic.financial_accounts.list + + assert_pattern do + response => Lithic::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::FinancialAccount + end + + assert_pattern do + row => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::BooleanModel, + nickname: String | nil, + status: Lithic::Models::FinancialAccount::Status, + type: Lithic::Models::FinancialAccount::Type, + updated: Time, + account_number: String | nil, + routing_number: String | nil, + status_change_reason: Lithic::Models::FinancialAccount::StatusChangeReason | nil + } + end + end + + def test_update_status_required_params + response = + @lithic.financial_accounts.update_status( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + status: :OPEN, + status_change_reason: :CHARGED_OFF_FRAUD + ) + + assert_pattern do + response => Lithic::Models::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::Models::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::BooleanModel, + nickname: String | nil, + status: Lithic::Models::FinancialAccount::Status, + type: Lithic::Models::FinancialAccount::Type, + updated: Time, + account_number: String | nil, + routing_number: String | nil, + status_change_reason: Lithic::Models::FinancialAccount::StatusChangeReason | nil + } + end + end +end diff --git a/test/lithic/resources/management_operations_test.rb b/test/lithic/resources/management_operations_test.rb new file mode 100644 index 00000000..14b76497 --- /dev/null +++ b/test/lithic/resources/management_operations_test.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ManagementOperationsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.management_operations.create( + amount: 0, + category: :MANAGEMENT_FEE, + direction: :CREDIT, + effective_date: "2019-12-27", + event_type: :CASH_BACK, + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::ManagementOperationTransaction + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ManagementOperationTransaction::Category, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::Direction, + events: ^(Lithic::ArrayOf[Lithic::Models::ManagementOperationTransaction::Event]), + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_retrieve + response = @lithic.management_operations.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ManagementOperationTransaction + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ManagementOperationTransaction::Category, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::Direction, + events: ^(Lithic::ArrayOf[Lithic::Models::ManagementOperationTransaction::Event]), + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.management_operations.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::ManagementOperationTransaction + end + + assert_pattern do + row => { + token: String, + category: Lithic::Models::ManagementOperationTransaction::Category, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::Direction, + events: ^(Lithic::ArrayOf[Lithic::Models::ManagementOperationTransaction::Event]), + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_reverse_required_params + response = + @lithic.management_operations.reverse( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + effective_date: "2019-12-27" + ) + + assert_pattern do + response => Lithic::Models::ManagementOperationTransaction + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::ManagementOperationTransaction::Category, + created: Time, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::Direction, + events: ^(Lithic::ArrayOf[Lithic::Models::ManagementOperationTransaction::Event]), + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::Result, + settled_amount: Integer, + status: Lithic::Models::ManagementOperationTransaction::Status, + updated: Time, + user_defined_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/payments_test.rb b/test/lithic/resources/payments_test.rb new file mode 100644 index 00000000..62a2787e --- /dev/null +++ b/test/lithic/resources/payments_test.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::PaymentsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.payments.create( + amount: 1, + external_bank_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + method_: :ACH_NEXT_DAY, + method_attributes: {sec_code: :CCD}, + type: :COLLECTION + ) + + assert_pattern do + response => Lithic::Models::PaymentCreateResponse + end + end + + def test_retrieve + response = @lithic.payments.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Payment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Models::Payment::Category, + created: Time, + currency: String, + descriptor: String, + direction: Lithic::Models::Payment::Direction, + events: ^(Lithic::ArrayOf[Lithic::Models::Payment::Event]), + external_bank_account_token: String | nil, + financial_account_token: String, + method_: Lithic::Models::Payment::Method, + method_attributes: Lithic::Models::Payment::MethodAttributes, + pending_amount: Integer, + result: Lithic::Models::Payment::Result, + settled_amount: Integer, + source: Lithic::Models::Payment::Source, + status: Lithic::Models::Payment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.payments.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Payment + end + + assert_pattern do + row => { + token: String, + category: Lithic::Models::Payment::Category, + created: Time, + currency: String, + descriptor: String, + direction: Lithic::Models::Payment::Direction, + events: ^(Lithic::ArrayOf[Lithic::Models::Payment::Event]), + external_bank_account_token: String | nil, + financial_account_token: String, + method_: Lithic::Models::Payment::Method, + method_attributes: Lithic::Models::Payment::MethodAttributes, + pending_amount: Integer, + result: Lithic::Models::Payment::Result, + settled_amount: Integer, + source: Lithic::Models::Payment::Source, + status: Lithic::Models::Payment::Status, + updated: Time, + user_defined_id: String | nil + } + end + end + + def test_retry_ + response = @lithic.payments.retry_("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::PaymentRetryResponse + end + end + + def test_simulate_action_required_params + response = + @lithic.payments.simulate_action( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + event_type: :ACH_ORIGINATION_REVIEWED + ) + + assert_pattern do + response => Lithic::Models::PaymentSimulateActionResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::Result, + transaction_event_token: String + } + end + end + + def test_simulate_receipt_required_params + response = + @lithic.payments.simulate_receipt( + token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + amount: 0, + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + receipt_type: :RECEIPT_CREDIT + ) + + assert_pattern do + response => Lithic::Models::PaymentSimulateReceiptResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::Result, + transaction_event_token: String + } + end + end + + def test_simulate_release_required_params + response = @lithic.payments.simulate_release(payment_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::PaymentSimulateReleaseResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::Result, + transaction_event_token: String + } + end + end + + def test_simulate_return_required_params + response = @lithic.payments.simulate_return(payment_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::PaymentSimulateReturnResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::Result, + transaction_event_token: String + } + end + end +end diff --git a/test/lithic/resources/reports/settlement/network_totals_test.rb b/test/lithic/resources/reports/settlement/network_totals_test.rb new file mode 100644 index 00000000..6594edc9 --- /dev/null +++ b/test/lithic/resources/reports/settlement/network_totals_test.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::Reports::Settlement::NetworkTotalsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.reports.settlement.network_totals.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse + end + + assert_pattern do + response => { + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalRetrieveResponse::Network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer | nil + } + end + end + + def test_list + response = @lithic.reports.settlement.network_totals.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Reports::Settlement::NetworkTotalListResponse + end + + assert_pattern do + row => { + token: String, + amounts: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Amounts, + created: Time, + currency: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListResponse::Network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer | nil + } + end + end +end diff --git a/test/lithic/resources/reports/settlement_test.rb b/test/lithic/resources/reports/settlement_test.rb new file mode 100644 index 00000000..459dfdd7 --- /dev/null +++ b/test/lithic/resources/reports/settlement_test.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Reports::SettlementTest < Lithic::Test::ResourceTest + def test_list_details + response = @lithic.reports.settlement.list_details("2019-12-27") + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::SettlementDetail + end + + assert_pattern do + row => { + token: String, + account_token: String, + card_program_token: String, + card_token: String, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: ^(Lithic::ArrayOf[String]), + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::Network, + other_fees_details: Lithic::Models::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::Type, + updated: Time, + fee_description: String | nil + } + end + end + + def test_summary + response = @lithic.reports.settlement.summary("2019-12-27") + + assert_pattern do + response => Lithic::Models::SettlementReport + end + + assert_pattern do + response => { + created: Time, + currency: String, + details: ^(Lithic::ArrayOf[Lithic::Models::SettlementSummaryDetails]), + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: Lithic::BooleanModel, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/reports_test.rb b/test/lithic/resources/reports_test.rb new file mode 100644 index 00000000..20f1b07b --- /dev/null +++ b/test/lithic/resources/reports_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ReportsTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/responder_endpoints_test.rb b/test/lithic/resources/responder_endpoints_test.rb new file mode 100644 index 00000000..beafc084 --- /dev/null +++ b/test/lithic/resources/responder_endpoints_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ResponderEndpointsTest < Lithic::Test::ResourceTest + def test_create + response = @lithic.responder_endpoints.create + + assert_pattern do + response => Lithic::Models::ResponderEndpointCreateResponse + end + + assert_pattern do + response => { + enrolled: Lithic::BooleanModel | nil + } + end + end + + def test_delete_required_params + skip("Prism errors when accept header set but no request body is defined") + + response = @lithic.responder_endpoints.delete(type: :AUTH_STREAM_ACCESS) + + assert_pattern do + response => nil + end + end + + def test_check_status_required_params + response = @lithic.responder_endpoints.check_status(type: :AUTH_STREAM_ACCESS) + + assert_pattern do + response => Lithic::Models::ResponderEndpointStatus + end + + assert_pattern do + response => { + enrolled: Lithic::BooleanModel | nil, + url: String | nil + } + end + end +end diff --git a/test/lithic/resources/shared_test.rb b/test/lithic/resources/shared_test.rb new file mode 100644 index 00000000..c6c52a04 --- /dev/null +++ b/test/lithic/resources/shared_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::SharedTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/three_ds/authentication_test.rb b/test/lithic/resources/three_ds/authentication_test.rb new file mode 100644 index 00000000..88de1b6b --- /dev/null +++ b/test/lithic/resources/three_ds/authentication_test.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::ThreeDS::AuthenticationTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.three_ds.authentication.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ThreeDS::AuthenticationRetrieveResponse + end + + assert_pattern do + response => { + token: String, + account_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AccountType | nil, + authentication_result: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationResult, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::CardExpiryCheck, + card_token: String, + cardholder: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Cardholder, + channel: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Channel, + created: Time, + merchant: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Merchant, + message_category: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::MessageCategory, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeDSRequestorChallengeIndicator, + additional_data: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AdditionalData | nil, + app: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::App | nil, + authentication_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::AuthenticationRequestType | nil, + browser: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Browser | nil, + challenge_metadata: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeMetadata | nil, + challenge_orchestrated_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ChallengeOrchestratedBy | nil, + decision_made_by: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::DecisionMadeBy | nil, + three_ri_request_type: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::ThreeRiRequestType | nil, + transaction: Lithic::Models::ThreeDS::AuthenticationRetrieveResponse::Transaction | nil + } + end + end + + def test_simulate_required_params + response = + @lithic.three_ds.authentication.simulate( + merchant: {id: "OODKZAPJVN4YS7O", country: "USA", mcc: "5812", name: "COFFEE SHOP"}, + pan: "4111111289144142", + transaction: {amount: 100, currency: "USD"} + ) + + assert_pattern do + response => Lithic::Models::ThreeDS::AuthenticationSimulateResponse + end + + assert_pattern do + response => { + token: String | nil + } + end + end + + def test_simulate_otp_entry_required_params + response = + @lithic.three_ds.authentication.simulate_otp_entry( + token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac", + otp: "123456" + ) + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/three_ds/decisioning_test.rb b/test/lithic/resources/three_ds/decisioning_test.rb new file mode 100644 index 00000000..4189fda6 --- /dev/null +++ b/test/lithic/resources/three_ds/decisioning_test.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::ThreeDS::DecisioningTest < Lithic::Test::ResourceTest + def test_challenge_response_required_params + response = + @lithic.three_ds.decisioning.challenge_response( + token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + challenge_response: :APPROVE + ) + + assert_pattern do + response => nil + end + end + + def test_retrieve_secret + response = @lithic.three_ds.decisioning.retrieve_secret + + assert_pattern do + response => Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + response = @lithic.three_ds.decisioning.rotate_secret + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/three_ds_test.rb b/test/lithic/resources/three_ds_test.rb new file mode 100644 index 00000000..37c8f2cd --- /dev/null +++ b/test/lithic/resources/three_ds_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ThreeDSTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/tokenization_decisioning_test.rb b/test/lithic/resources/tokenization_decisioning_test.rb new file mode 100644 index 00000000..8058592f --- /dev/null +++ b/test/lithic/resources/tokenization_decisioning_test.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TokenizationDecisioningTest < Lithic::Test::ResourceTest + def test_retrieve_secret + response = @lithic.tokenization_decisioning.retrieve_secret + + assert_pattern do + response => Lithic::Models::TokenizationSecret + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + response = @lithic.tokenization_decisioning.rotate_secret + + assert_pattern do + response => Lithic::Models::TokenizationDecisioningRotateSecretResponse + end + + assert_pattern do + response => { + secret: String | nil + } + end + end +end diff --git a/test/lithic/resources/tokenizations_test.rb b/test/lithic/resources/tokenizations_test.rb new file mode 100644 index 00000000..35b4d53b --- /dev/null +++ b/test/lithic/resources/tokenizations_test.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TokenizationsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.tokenizations.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::TokenizationRetrieveResponse + end + + assert_pattern do + response => { + data: Lithic::Models::Tokenization | nil + } + end + end + + def test_list + response = @lithic.tokenizations.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Tokenization + end + + assert_pattern do + row => { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String | nil, + status: Lithic::Models::Tokenization::Status, + token_requestor_name: Lithic::Models::Tokenization::TokenRequestorName, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::TokenizationChannel, + updated_at: Time, + digital_card_art_token: String | nil, + events: ^(Lithic::ArrayOf[Lithic::Models::Tokenization::Event]) | nil, + payment_account_reference_id: String | nil + } + end + end + + def test_activate + response = @lithic.tokenizations.activate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_deactivate + response = @lithic.tokenizations.deactivate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_pause + response = @lithic.tokenizations.pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_resend_activation_code + response = @lithic.tokenizations.resend_activation_code("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_simulate_required_params + response = + @lithic.tokenizations.simulate( + cvv: "776", + expiration_date: "08/29", + pan: "4111111289144142", + tokenization_source: :APPLE_PAY + ) + + assert_pattern do + response => Lithic::Models::TokenizationSimulateResponse + end + + assert_pattern do + response => { + data: ^(Lithic::ArrayOf[Lithic::Models::Tokenization]) | nil + } + end + end + + def test_unpause + response = @lithic.tokenizations.unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_update_digital_card_art + response = @lithic.tokenizations.update_digital_card_art("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::TokenizationUpdateDigitalCardArtResponse + end + + assert_pattern do + response => { + data: Lithic::Models::Tokenization | nil + } + end + end +end diff --git a/test/lithic/resources/transactions/enhanced_commercial_data_test.rb b/test/lithic/resources/transactions/enhanced_commercial_data_test.rb new file mode 100644 index 00000000..088a7e90 --- /dev/null +++ b/test/lithic/resources/transactions/enhanced_commercial_data_test.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Transactions::EnhancedCommercialDataTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.transactions.enhanced_commercial_data.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse + end + + assert_pattern do + response => { + data: ^(Lithic::ArrayOf[Lithic::Models::Transactions::Events::EnhancedData]) + } + end + end +end diff --git a/test/lithic/resources/transactions/events/enhanced_commercial_data_test.rb b/test/lithic/resources/transactions/events/enhanced_commercial_data_test.rb new file mode 100644 index 00000000..52bd91af --- /dev/null +++ b/test/lithic/resources/transactions/events/enhanced_commercial_data_test.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::Transactions::Events::EnhancedCommercialDataTest < Lithic::Test::ResourceTest + def test_retrieve + response = + @lithic.transactions.events.enhanced_commercial_data.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Transactions::Events::EnhancedData + end + + assert_pattern do + response => { + token: String, + common: Lithic::Models::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: ^(Lithic::ArrayOf[Lithic::Models::Transactions::Events::EnhancedData::Fleet]), + transaction_token: String + } + end + end +end diff --git a/test/lithic/resources/transactions/events_test.rb b/test/lithic/resources/transactions/events_test.rb new file mode 100644 index 00000000..f2bb2b26 --- /dev/null +++ b/test/lithic/resources/transactions/events_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Transactions::EventsTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/transactions_test.rb b/test/lithic/resources/transactions_test.rb new file mode 100644 index 00000000..456d74ae --- /dev/null +++ b/test/lithic/resources/transactions_test.rb @@ -0,0 +1,213 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TransactionsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.transactions.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::Transaction + end + + assert_pattern do + response => { + token: String, + account_token: String, + acquirer_fee: Integer | nil, + acquirer_reference_number: String | nil, + amount: Integer, + amounts: Lithic::Models::Transaction::Amounts, + authorization_amount: Integer | nil, + authorization_code: String | nil, + avs: Lithic::Models::Transaction::Avs | nil, + card_token: String, + cardholder_authentication: Lithic::Models::Transaction::CardholderAuthentication | nil, + created: Time, + merchant: Lithic::Models::Transaction::Merchant, + merchant_amount: Integer | nil, + merchant_authorization_amount: Integer | nil, + merchant_currency: String, + network: Lithic::Models::Transaction::Network | nil, + network_risk_score: Integer | nil, + pos: Lithic::Models::Transaction::Pos, + result: Lithic::Models::Transaction::Result, + settled_amount: Integer, + status: Lithic::Models::Transaction::Status, + token_info: Lithic::Models::Transaction::TokenInfo | nil, + updated: Time, + events: ^(Lithic::ArrayOf[Lithic::Models::Transaction::Event]) | nil + } + end + end + + def test_list + response = @lithic.transactions.list + + assert_pattern do + response => Lithic::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::Transaction + end + + assert_pattern do + row => { + token: String, + account_token: String, + acquirer_fee: Integer | nil, + acquirer_reference_number: String | nil, + amount: Integer, + amounts: Lithic::Models::Transaction::Amounts, + authorization_amount: Integer | nil, + authorization_code: String | nil, + avs: Lithic::Models::Transaction::Avs | nil, + card_token: String, + cardholder_authentication: Lithic::Models::Transaction::CardholderAuthentication | nil, + created: Time, + merchant: Lithic::Models::Transaction::Merchant, + merchant_amount: Integer | nil, + merchant_authorization_amount: Integer | nil, + merchant_currency: String, + network: Lithic::Models::Transaction::Network | nil, + network_risk_score: Integer | nil, + pos: Lithic::Models::Transaction::Pos, + result: Lithic::Models::Transaction::Result, + settled_amount: Integer, + status: Lithic::Models::Transaction::Status, + token_info: Lithic::Models::Transaction::TokenInfo | nil, + updated: Time, + events: ^(Lithic::ArrayOf[Lithic::Models::Transaction::Event]) | nil + } + end + end + + def test_expire_authorization + response = @lithic.transactions.expire_authorization("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_simulate_authorization_required_params + response = + @lithic.transactions.simulate_authorization( + amount: 3831, + descriptor: "COFFEE SHOP", + pan: "4111111289144142" + ) + + assert_pattern do + response => Lithic::Models::TransactionSimulateAuthorizationResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_authorization_advice_required_params + response = + @lithic.transactions.simulate_authorization_advice( + token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac", + amount: 3831 + ) + + assert_pattern do + response => Lithic::Models::TransactionSimulateAuthorizationAdviceResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_clearing_required_params + response = @lithic.transactions.simulate_clearing(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac") + + assert_pattern do + response => Lithic::Models::TransactionSimulateClearingResponse + end + + assert_pattern do + response => { + debugging_request_id: String | nil + } + end + end + + def test_simulate_credit_authorization_required_params + response = + @lithic.transactions.simulate_credit_authorization( + amount: 3831, + descriptor: "COFFEE SHOP", + pan: "4111111289144142" + ) + + assert_pattern do + response => Lithic::Models::TransactionSimulateCreditAuthorizationResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_return_required_params + response = + @lithic.transactions.simulate_return(amount: 3831, descriptor: "COFFEE SHOP", pan: "4111111289144142") + + assert_pattern do + response => Lithic::Models::TransactionSimulateReturnResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_return_reversal_required_params + response = @lithic.transactions.simulate_return_reversal(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac") + + assert_pattern do + response => Lithic::Models::TransactionSimulateReturnReversalResponse + end + + assert_pattern do + response => { + debugging_request_id: String | nil + } + end + end + + def test_simulate_void_required_params + response = @lithic.transactions.simulate_void(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac") + + assert_pattern do + response => Lithic::Models::TransactionSimulateVoidResponse + end + + assert_pattern do + response => { + debugging_request_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/transfers_test.rb b/test/lithic/resources/transfers_test.rb new file mode 100644 index 00000000..1bd60f68 --- /dev/null +++ b/test/lithic/resources/transfers_test.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TransfersTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.transfers.create( + amount: 0, + from: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + to: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Models::Transfer + end + + assert_pattern do + response => { + token: String | nil, + category: Lithic::Models::Transfer::Category | nil, + created: Time | nil, + currency: String | nil, + descriptor: String | nil, + events: ^(Lithic::ArrayOf[Lithic::Models::Transfer::Event]) | nil, + from_balance: ^(Lithic::ArrayOf[Lithic::Models::Balance]) | nil, + pending_amount: Integer | nil, + result: Lithic::Models::Transfer::Result | nil, + settled_amount: Integer | nil, + status: Lithic::Models::Transfer::Status | nil, + to_balance: ^(Lithic::ArrayOf[Lithic::Models::Balance]) | nil, + updated: Time | nil + } + end + end +end diff --git a/test/lithic/test_helper.rb b/test/lithic/test_helper.rb new file mode 100644 index 00000000..4fe5324a --- /dev/null +++ b/test/lithic/test_helper.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Requiring this file from each test file ensures we always do the following, even +# when running a single-file test: +# - Load the whole gem (as one would in production) +# - Define shared testing namespace so that we don't need to indent test files as much +# - Setting up testing dependencies + +require "digest" +require "singleton" + +require "async" +require "minitest/autorun" +require "minitest/focus" +require "minitest/hooks/test" +require "minitest/proveit" +require "minitest/rg" + +require_relative "../../lib/lithic" +require_relative "resource_namespaces" + +module Kernel + alias_method :_sleep, :sleep + + def sleep(secs) + case Thread.current.thread_variable_get(:mock_sleep) + in Array => counter + counter << secs + secs + else + _sleep(secs) + end + end +end + +class Time + class << self + alias_method :_now, :now + end + + def self.now = Thread.current.thread_variable_get(:time_now) || _now +end + +class Lithic::Test::SingletonClient < Lithic::Client + include Singleton + + def initialize + super(base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), api_key: "My Lithic API Key") + end +end + +class Minitest::Test + include Minitest::Hooks + + make_my_diffs_pretty! + parallelize_me! + prove_it! +end + +class Lithic::Test::ResourceTest < Minitest::Test + def async? + return @async unless @async.nil? + @async = Digest::SHA256.hexdigest(self.class.name).to_i(16).odd? + end + + def before_all + super + @lithic = Lithic::Test::SingletonClient.instance + end + + def around_all = async? ? Sync { super } : super + + def around = async? ? Async { super }.wait : super +end diff --git a/test/lithic/util_test.rb b/test/lithic/util_test.rb new file mode 100644 index 00000000..4d758ba1 --- /dev/null +++ b/test/lithic/util_test.rb @@ -0,0 +1,529 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class Lithic::Test::UtilDataHandlingTest < Minitest::Test + def test_left_map + assert_pattern do + Lithic::Util.deep_merge({a: 1}, nil) => nil + end + end + + def test_right_map + assert_pattern do + Lithic::Util.deep_merge(nil, {a: 1}) => {a: 1} + end + end + + def test_disjoint_maps + assert_pattern do + Lithic::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} + end + end + + def test_overlapping_maps + assert_pattern do + Lithic::Util.deep_merge({b: 2, c: 3}, {a: 1, c: 4}) => {a: 1, b: 2, c: 4} + end + end + + def test_nested + assert_pattern do + Lithic::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} + end + end + + def test_nested_left_map + assert_pattern do + Lithic::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} + end + end + + def test_omission + merged = Lithic::Util.deep_merge( + {b: {b2: 1, b3: {c: 4, d: 5}}}, + {b: {b2: 1, b3: {c: Lithic::Util::OMIT, d: 5}}} + ) + + assert_pattern do + merged => {b: {b2: 1, b3: {d: 5}}} + end + end + + def test_concat + merged = Lithic::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: true + ) + + assert_pattern do + merged => {a: {b: [1, 2, 3, 4]}} + end + end + + def test_concat_false + merged = Lithic::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: false + ) + + assert_pattern do + merged => {a: {b: [3, 4]}} + end + end + + def test_dig + assert_pattern do + Lithic::Util.dig(1, nil) => 1 + Lithic::Util.dig({a: 1}, :b) => nil + Lithic::Util.dig({a: 1}, :a) => 1 + Lithic::Util.dig({a: {b: 1}}, [:a, :b]) => 1 + + Lithic::Util.dig([], 1) => nil + Lithic::Util.dig([nil, [nil, 1]], [1, 1]) => 1 + Lithic::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 + Lithic::Util.dig([], 1.0) => nil + + Lithic::Util.dig(Object, 1) => nil + Lithic::Util.dig([], 1.0, 2) => 2 + Lithic::Util.dig([], 1.0) { 2 } => 2 + end + end +end + +class Lithic::Test::UtilUriHandlingTest < Minitest::Test + def test_parsing + %w[ + http://example.com + https://example.com/ + https://example.com:443/example?e1=e1&e2=e2&e= + ].each do |url| + parsed = Lithic::Util.parse_uri(url) + unparsed = Lithic::Util.unparse_uri(parsed).to_s + + assert_equal(url, unparsed) + assert_equal(parsed, Lithic::Util.parse_uri(unparsed)) + end + end + + def test_joining + cases = [ + [ + "h://a.b/c?d=e", + "h://nope/ignored", + Lithic::Util.parse_uri("h://a.b/c?d=e") + ], + [ + "h://a.b/c?d=e", + "h://nope", + { + host: "a.b", + path: "/c", + query: {"d" => ["e"]} + } + ] + ] + + cases.each do |expect, lhs, rhs| + assert_equal( + URI.parse(expect), + Lithic::Util.join_parsed_uri( + Lithic::Util.parse_uri(lhs), + rhs + ) + ) + end + end + + def test_joining_queries + base_url = "h://a.b/c?d=e" + cases = { + "c2" => "h://a.b/c/c2", + "/c2?f=g" => "h://a.b/c2?f=g", + "/c?f=g" => "h://a.b/c?d=e&f=g" + } + + cases.each do |path, expected| + assert_equal( + URI.parse(expected), + Lithic::Util.join_parsed_uri( + Lithic::Util.parse_uri(base_url), + {path: path} + ) + ) + end + end +end + +class Lithic::Test::UtilFormDataEncodingTest < Minitest::Test + class FakeCGI < CGI + def initialize(headers, io) + @ctype = headers["content-type"] + # rubocop:disable Lint/EmptyBlock + @io = Lithic::Util::ReadIOAdapter.new(io) {} + # rubocop:enable Lint/EmptyBlock + @c_len = io.to_a.join.bytesize.to_s + super() + end + + def stdinput = @io + + def env_table + { + "REQUEST_METHOD" => "POST", + "CONTENT_TYPE" => @ctype, + "CONTENT_LENGTH" => @c_len + } + end + end + + def test_file_encode + headers = {"content-type" => "multipart/form-data"} + cases = { + StringIO.new("abc") => "abc" + } + cases.each do |body, val| + encoded = Lithic::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + assert_pattern do + cgi[""] => ^val + end + end + end + + def test_hash_encode + headers = {"content-type" => "multipart/form-data"} + cases = { + {a: 2, b: 3} => {"a" => "2", "b" => "3"}, + {a: 2, b: nil} => {"a" => "2", "b" => "null"}, + {a: 2, b: [1, 2, 3]} => {"a" => "2", "b" => "1"}, + {file: StringIO.new("a")} => {"file" => "a"} + } + cases.each do |body, testcase| + encoded = Lithic::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + testcase.each do |key, val| + assert_equal(val, cgi[key]) + end + end + end +end + +class Lithic::Test::UtilIOAdapterTest < Minitest::Test + def test_copy_read + cases = { + StringIO.new("abc") => "abc", + Enumerator.new { _1 << "abc" } => "abc" + } + cases.each do |input, expected| + io = StringIO.new + # rubocop:disable Lint/EmptyBlock + adapter = Lithic::Util::ReadIOAdapter.new(input) {} + # rubocop:enable Lint/EmptyBlock + IO.copy_stream(adapter, io) + assert_equal(expected, io.string) + end + end + + def test_copy_write + cases = { + StringIO.new => "", + StringIO.new("abc") => "abc" + } + cases.each do |input, expected| + enum = Lithic::Util.string_io do |y| + IO.copy_stream(input, y) + end + assert_equal(expected, enum.to_a.join) + end + end +end + +class Lithic::Test::UtilFusedEnumTest < Minitest::Test + def test_closing + arr = [1, 2, 3] + once = 0 + fused = Lithic::Util.fused_enum(arr.to_enum) do + once = once.succ + end + + enumerated_1 = fused.to_a + assert_equal(arr, enumerated_1) + assert_equal(1, once) + + enumerated_2 = fused.to_a + assert_equal([], enumerated_2) + assert_equal(1, once) + end + + def test_rewind_chain + once = 0 + fused = Lithic::Util.fused_enum([1, 2, 3].to_enum) do + once = once.succ + end + .lazy + .map(&:succ) + .filter(&:odd?) + first = fused.next + + assert_equal(3, first) + assert_equal(0, once) + assert_raises(StopIteration) { fused.rewind.next } + assert_equal(1, once) + end + + def test_external_iteration + it = [1, 2, 3].to_enum + first = it.next + fused = Lithic::Util.fused_enum(it, external: true) + + assert_equal(1, first) + assert_equal([2, 3], fused.to_a) + end + + def test_close_fused + once = 0 + fused = Lithic::Util.fused_enum([1, 2, 3].to_enum) do + once = once.succ + end + + Lithic::Util.close_fused!(fused) + + assert_equal(1, once) + assert_equal([], fused.to_a) + assert_equal(1, once) + end + + def test_closed_fused_extern_iteration + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + fused = Lithic::Util.fused_enum(enum) + first = fused.next + + assert_equal(1, first) + Lithic::Util.close_fused!(fused) + assert_equal(1, taken) + end + + def test_closed_fused_taken_count + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:odd?) + fused = Lithic::Util.fused_enum(enum) + + assert_equal(0, taken) + Lithic::Util.close_fused!(fused) + assert_equal(0, taken) + end + + def test_closed_fused_extern_iter_taken_count + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:itself) + first = enum.next + assert_equal(2, first) + assert_equal(1, taken) + + fused = Lithic::Util.fused_enum(enum) + Lithic::Util.close_fused!(fused) + assert_equal(1, taken) + end + + def test_close_fused_sse_chain + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:odd?) + .map(&:to_s) + + fused_1 = Lithic::Util.fused_enum(enum) + fused_2 = Lithic::Util.decode_lines(fused_1) + fused_3 = Lithic::Util.decode_sse(fused_2) + + assert_equal(0, taken) + Lithic::Util.close_fused!(fused_3) + assert_equal(0, taken) + end +end + +class Lithic::Test::UtilSseTest < Minitest::Test + def test_decode_lines + cases = { + %w[] => %w[], + %W[\n\n] => %W[\n \n], + %W[\n \n] => %W[\n \n], + %w[a] => %w[a], + %W[a\nb] => %W[a\n b], + %W[a\nb\n] => %W[a\n b\n], + %W[\na b\n] => %W[\n ab\n], + %W[\na b\n\n] => %W[\n ab\n \n], + %W[\na b] => %W[\n ab], + %W[\u1F62E\u200D\u1F4A8] => %W[\u1F62E\u200D\u1F4A8], + %W[\u1F62E \u200D \u1F4A8] => %W[\u1F62E\u200D\u1F4A8] + } + eols = %W[\n \r \r\n] + cases.each do |enum, expected| + eols.each do |eol| + lines = Lithic::Util.decode_lines(enum.map { _1.gsub("\n", eol) }) + assert_equal(expected.map { _1.gsub("\n", eol) }, lines.to_a, "eol=#{JSON.generate(eol)}") + end + end + end + + def test_mixed_decode_lines + cases = { + %w[] => %w[], + %W[\r\r] => %W[\r \r], + %W[\r \r] => %W[\r \r], + %W[\r\r\r] => %W[\r \r \r], + %W[\r\r \r] => %W[\r \r \r], + %W[\r \n] => %W[\r\n], + %W[\r\r\n] => %W[\r \r\n], + %W[\n\r] => %W[\n \r] + } + cases.each do |enum, expected| + lines = Lithic::Util.decode_lines(enum) + assert_equal(expected, lines.to_a) + end + end + + def test_decode_sse + cases = { + "empty input" => { + [] => [] + }, + "single data event" => { + [ + "data: hello world\n", + "\n" + ] => [ + {data: "hello world\n"} + ] + }, + "multiple data lines" => { + [ + "data: line 1\n", + "data: line 2\n", + "\n" + ] => [ + {data: "line 1\nline 2\n"} + ] + }, + "complete event" => { + [ + "id: 123\n", + "event: update\n", + "data: hello world\n", + "retry: 5000\n", + "\n" + ] => [ + { + event: "update", + id: "123", + data: "hello world\n", + retry: 5000 + } + ] + }, + "multiple events" => { + [ + "event: update\n", + "data: first\n", + "\n", + "event: message\n", + "data: second\n", + "\n" + ] => [ + {event: "update", data: "first\n"}, + {event: "message", data: "second\n"} + ] + }, + "comments" => { + [ + ": this is a comment\n", + "data: actual data\n", + "\n" + ] => [ + {data: "actual data\n"} + ] + }, + "invalid retry" => { + [ + "retry: not a number\n", + "data: hello\n", + "\n" + ] => [ + {data: "hello\n"} + ] + }, + "invalid id with null" => { + [ + "id: bad\0id\n", + "data: hello\n", + "\n" + ] => [ + {data: "hello\n"} + ] + }, + "leading space in value" => { + [ + "data: hello world\n", + "data: leading space\n", + "\n" + ] => [ + {data: "hello world\n leading space\n"} + ] + }, + "no final newline" => { + [ + "data: hello\n", + "id: 1" + ] => [ + {data: "hello\n", id: "1"} + ] + }, + "multiple empty lines" => { + [ + "data: first\n", + "\n", + "\n", + "data: second\n", + "\n" + ] => [ + {data: "first\n"}, + {data: "second\n"} + ] + }, + "multibyte unicode" => { + [ + "data: \u1F62E\u200D\u1F4A8\n" + ] => [ + {data: "\u1F62E\u200D\u1F4A8\n"} + ] + } + } + + cases.each do |name, test_cases| + test_cases.each do |input, expected| + actual = Lithic::Util.decode_sse(input).map(&:compact) + assert_equal(expected, actual, name) + end + end + end +end