Class: Lithic::Resources::FinancialAccounts::InstallmentPlans

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/financial_accounts/installment_plans.rb,
sig/lithic/resources/financial_accounts/installment_plans.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ InstallmentPlans

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 InstallmentPlans.

Parameters:



76
77
78
# File 'lib/lithic/resources/financial_accounts/installment_plans.rb', line 76

def initialize(client:)
  @client = client
end

Instance Method Details

#list(financial_account_token, ending_before: nil, page_size: nil, starting_after: nil, state: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::FinancialAccounts::InstallmentPlan>

Some parameter documentations has been truncated, see Models::FinancialAccounts::InstallmentPlanListParams for more details.

List the installment plans for a given financial account.

Parameters:

  • financial_account_token (String) —

    Globally unique identifier for financial account.

  • ending_before (String) —

    A cursor representing an item's token before which a page of results should end.

  • page_size (Integer) —

    Page size (for pagination).

  • starting_after (String) —

    A cursor representing an item's token after which a page of results should begin

  • state (Symbol, Lithic::Models::FinancialAccounts::InstallmentPlanListParams::State, nil) —

    Only installment plans in this state will be included.

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

Returns:

See Also:



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/lithic/resources/financial_accounts/installment_plans.rb', line 60

def list(, params = {})
  parsed, options = Lithic::FinancialAccounts::InstallmentPlanListParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/financial_accounts/%1$s/installment_plans", ],
    query: query,
    page: Lithic::Internal::CursorPage,
    model: Lithic::FinancialAccounts::InstallmentPlan,
    options: options
  )
end

#retrieve(installment_plan_token, financial_account_token:, request_options: {}) ⇒ Lithic::Models::FinancialAccounts::InstallmentPlan

Get a specific installment plan for a given financial account.

Parameters:

  • installment_plan_token (String) —

    Globally unique identifier for installment plan.

  • financial_account_token (String) —

    Globally unique identifier for financial account.

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

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/lithic/resources/financial_accounts/installment_plans.rb', line 20

def retrieve(installment_plan_token, params)
  parsed, options = Lithic::FinancialAccounts::InstallmentPlanRetrieveParams.dump_request(params)
   =
    parsed.delete(:financial_account_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: [
      "v1/financial_accounts/%1$s/installment_plans/%2$s",
      ,
      installment_plan_token
    ],
    model: Lithic::FinancialAccounts::InstallmentPlan,
    options: options
  )
end