Class: Lithic::Resources::Cards::FinancialTransactions

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/cards/financial_transactions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ FinancialTransactions

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

Parameters:



77
78
79
# File 'lib/lithic/resources/cards/financial_transactions.rb', line 77

def initialize(client:)
  @client = client
end

Instance Method Details

#list(card_token, begin_: nil, category: nil, end_: nil, ending_before: nil, result: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Lithic::Internal::SinglePage<Lithic::Models::FinancialTransaction>

Some parameter documentations has been truncated, see Models::Cards::FinancialTransactionListParams for more details.

List the financial transactions for a given card.

Parameters:

Returns:

See Also:



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/lithic/resources/cards/financial_transactions.rb', line 62

def list(card_token, params = {})
  parsed, options = Lithic::Cards::FinancialTransactionListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/cards/%1$s/financial_transactions", card_token],
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::SinglePage,
    model: Lithic::FinancialTransaction,
    options: options
  )
end

#retrieve(financial_transaction_token, card_token:, request_options: {}) ⇒ Lithic::Models::FinancialTransaction

Get the card financial transaction for the provided token.

Parameters:

  • financial_transaction_token (String)

    Globally unique identifier for financial transaction token.

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

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/lithic/resources/cards/financial_transactions.rb', line 20

def retrieve(financial_transaction_token, params)
  parsed, options = Lithic::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/%1$s/financial_transactions/%2$s", card_token, financial_transaction_token],
    model: Lithic::FinancialTransaction,
    options: options
  )
end