Class: MethodRuby::Resources::Accounts::VerificationSessions

Inherits:
Object
  • Object
show all
Defined in:
lib/method_ruby/resources/accounts/verification_sessions.rb,
lib/method_ruby/resources/accounts/verification_sessions/amounts.rb

Overview

Verification sessions for accounts

Defined Under Namespace

Classes: Amounts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VerificationSessions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of VerificationSessions.

Parameters:



178
179
180
181
# File 'lib/method_ruby/resources/accounts/verification_sessions.rb', line 178

def initialize(client:)
  @client = client
  @amounts = MethodRuby::Resources::Accounts::VerificationSessions::Amounts.new(client: client)
end

Instance Attribute Details

#amountsMethodRuby::Resources::Accounts::VerificationSessions::Amounts (readonly)

Verification sessions for accounts



10
11
12
# File 'lib/method_ruby/resources/accounts/verification_sessions.rb', line 10

def amounts
  @amounts
end

Instance Method Details

#create(account_id, type:, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::VerificationSessionCreateResponse

Some parameter documentations has been truncated, see Models::Accounts::VerificationSessionCreateParams for more details.

Creates a new verification session for the specified account.

Parameters:

Returns:

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/method_ruby/resources/accounts/verification_sessions.rb', line 33

def create(, params)
  parsed, options = MethodRuby::Accounts::VerificationSessionCreateParams.dump_request(params)
  header_params = {method_version: "method-version", idempotency_key: "idempotency-key"}
  @client.request(
    method: :post,
    path: ["accounts/%1$s/verification_sessions", ],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: MethodRuby::Models::Accounts::VerificationSessionCreateResponse,
    security: {secret_key: true},
    options: options
  )
end

#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::VerificationSessionListResponse

Some parameter documentations has been truncated, see Models::Accounts::VerificationSessionListParams for more details.

Returns a list of verification sessions for the specified account.

Parameters:

  • account_id (String)

    Path param: Unique identifier for the account.

  • method_version (Symbol, MethodRuby::Models::Accounts::VerificationSessionListParams::MethodVersion)

    Header param: API version to use for this request. This spec targets ‘2025-12-01

  • page (Integer)

    Query param: Page number for pagination (1-indexed).

  • page_cursor (String)

    Query param: Cursor for cursor-based pagination. Use the value from ‘Pagination-

  • page_limit (Integer)

    Query param: Number of items per page.

  • request_options (MethodRuby::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/method_ruby/resources/accounts/verification_sessions.rb', line 160

def list(, params)
  query_params = [:page, :page_cursor, :page_limit]
  parsed, options = MethodRuby::Accounts::VerificationSessionListParams.dump_request(params)
  query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: ["accounts/%1$s/verification_sessions", ],
    query: query,
    headers: parsed.except(*query_params).transform_keys(method_version: "method-version"),
    model: MethodRuby::Models::Accounts::VerificationSessionListResponse,
    security: {secret_key: true},
    options: options
  )
end

#retrieve(avf_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::VerificationSessionRetrieveResponse

Some parameter documentations has been truncated, see Models::Accounts::VerificationSessionRetrieveParams for more details.

Retrieves an account verification session by its unique identifier.

Parameters:

Returns:

See Also:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/method_ruby/resources/accounts/verification_sessions.rb', line 66

def retrieve(avf_id, params)
  parsed, options = MethodRuby::Accounts::VerificationSessionRetrieveParams.dump_request(params)
   =
    parsed.delete(:account_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["accounts/%1$s/verification_sessions/%2$s", , avf_id],
    headers: parsed.transform_keys(method_version: "method-version"),
    model: MethodRuby::Models::Accounts::VerificationSessionRetrieveResponse,
    security: {secret_key: true},
    options: options
  )
end

#update(avf_id, account_id:, method_version:, instant: nil, micro_deposits: nil, mx: nil, network: nil, plaid: nil, pre_auth: nil, standard: nil, teller: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::VerificationSessionUpdateResponse

Some parameter documentations has been truncated, see Models::Accounts::VerificationSessionUpdateParams for more details.

Updates an account verification session, typically to submit micro deposit amounts for verification.

Parameters:

Returns:

See Also:



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/method_ruby/resources/accounts/verification_sessions.rb', line 120

def update(avf_id, params)
  parsed, options = MethodRuby::Accounts::VerificationSessionUpdateParams.dump_request(params)
   =
    parsed.delete(:account_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  header_params = {method_version: "method-version", idempotency_key: "idempotency-key"}
  @client.request(
    method: :put,
    path: ["accounts/%1$s/verification_sessions/%2$s", , avf_id],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: MethodRuby::Models::Accounts::VerificationSessionUpdateResponse,
    security: {secret_key: true},
    options: options
  )
end