Class: Lithic::Resources::BookTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BookTransfers

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

Parameters:



143
144
145
# File 'lib/lithic/resources/book_transfers.rb', line 143

def initialize(client:)
  @client = client
end

Instance Method Details

#create(amount:, category:, from_financial_account_token:, subtype:, to_financial_account_token:, type:, token: nil, external_id: nil, memo: nil, on_closed_account: nil, request_options: {}) ⇒ Lithic::Models::BookTransferResponse

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

Book transfer funds between two financial accounts or between a financial account and card

Parameters:

  • amount (Integer)

    Amount to be transferred in the currency’s smallest unit (e.g., cents for USD).

  • category (Symbol, Lithic::Models::BookTransferCreateParams::Category)
  • from_financial_account_token (String)

    Globally unique identifier for the financial account or card that will send the

  • subtype (String)

    The program specific subtype code for the specified category/type.

  • to_financial_account_token (String)

    Globally unique identifier for the financial account or card that will receive t

  • type (Symbol, Lithic::Models::BookTransferCreateParams::Type)

    Type of the book transfer

  • token (String)

    Customer-provided token that will serve as an idempotency token. This token will

  • external_id (String)

    External ID defined by the customer

  • memo (String)

    Optional descriptor for the transfer.

  • on_closed_account (Symbol, Lithic::Models::BookTransferCreateParams::OnClosedAccount)

    What to do if the financial account is closed when posting an operation

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

Returns:

See Also:



39
40
41
42
43
44
45
46
47
48
# File 'lib/lithic/resources/book_transfers.rb', line 39

def create(params)
  parsed, options = Lithic::BookTransferCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/book_transfers",
    body: parsed,
    model: Lithic::BookTransferResponse,
    options: options
  )
end

#list(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: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::BookTransferResponse>

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

List book transfers

Parameters:

  • account_token (String)
  • begin_ (Time)

    Date string in RFC 3339 format. Only entries created after the specified time wi

  • business_account_token (String)
  • category (Symbol, Lithic::Models::BookTransferListParams::Category)

    Book Transfer category to be returned.

  • end_ (Time)

    Date string in RFC 3339 format. Only entries created before the specified time w

  • ending_before (String)

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

  • financial_account_token (String)

    Globally unique identifier for the financial account or card that will send the

  • page_size (Integer)

    Page size (for pagination).

  • result (Symbol, Lithic::Models::BookTransferListParams::Result)

    Book transfer result to be returned.

  • starting_after (String)

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

  • status (Symbol, Lithic::Models::BookTransferListParams::Status)

    Book transfer status to be returned.

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

Returns:

See Also:



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/lithic/resources/book_transfers.rb', line 104

def list(params = {})
  parsed, options = Lithic::BookTransferListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/book_transfers",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::BookTransferResponse,
    options: options
  )
end

#retrieve(book_transfer_token, request_options: {}) ⇒ Lithic::Models::BookTransferResponse

Get book transfer by token

Parameters:

  • book_transfer_token (String)

    Id of the book transfer to retrieve

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

Returns:

See Also:



61
62
63
64
65
66
67
68
# File 'lib/lithic/resources/book_transfers.rb', line 61

def retrieve(book_transfer_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/book_transfers/%1$s", book_transfer_token],
    model: Lithic::BookTransferResponse,
    options: params[:request_options]
  )
end

#reverse(book_transfer_token, memo: nil, request_options: {}) ⇒ Lithic::Models::BookTransferResponse

Reverse a book transfer

Parameters:

  • book_transfer_token (String)

    Id of the book transfer to retrieve

  • memo (String)

    Optional descriptor for the reversal.

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

Returns:

See Also:



129
130
131
132
133
134
135
136
137
138
# File 'lib/lithic/resources/book_transfers.rb', line 129

def reverse(book_transfer_token, params = {})
  parsed, options = Lithic::BookTransferReverseParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/book_transfers/%1$s/reverse", book_transfer_token],
    body: parsed,
    model: Lithic::BookTransferResponse,
    options: options
  )
end