Class: ModernTreasury::Resources::ExpectedPayments

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/expected_payments.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ExpectedPayments

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

Parameters:



223
224
225
# File 'lib/modern_treasury/resources/expected_payments.rb', line 223

def initialize(client:)
  @client = client
end

Instance Method Details

#create(amount_lower_bound: nil, amount_upper_bound: nil, counterparty_id: nil, currency: nil, date_lower_bound: nil, date_upper_bound: nil, description: nil, direction: nil, external_id: nil, internal_account_id: nil, ledger_transaction: nil, ledger_transaction_id: nil, line_items: nil, metadata: nil, reconciliation_filters: nil, reconciliation_groups: nil, reconciliation_rule_variables: nil, remittance_information: nil, statement_descriptor: nil, type: nil, request_options: {}) ⇒ ModernTreasury::Models::ExpectedPayment

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

create expected payment

Parameters:

  • amount_lower_bound (Integer, nil)

    The lowest amount this expected payment may be equal to. Value in specified curr

  • amount_upper_bound (Integer, nil)

    The highest amount this expected payment may be equal to. Value in specified cur

  • counterparty_id (String, nil)

    The ID of the counterparty you expect for this payment.

  • currency (Symbol, ModernTreasury::Models::Currency, nil)

    Must conform to ISO 4217. Defaults to the currency of the internal account.

  • date_lower_bound (Date, nil)

    The earliest date the payment may come in. Format: yyyy-mm-dd

  • date_upper_bound (Date, nil)

    The latest date the payment may come in. Format: yyyy-mm-dd

  • description (String, nil)

    An optional description for internal use.

  • direction (Symbol, ModernTreasury::Models::ExpectedPaymentCreateParams::Direction, nil)

    One of credit or debit. When you are receiving money, use credit. When you are b

  • external_id (String, nil)

    An optional user-defined 180 character unique identifier.

  • internal_account_id (String, nil)

    The ID of the Internal Account for the expected payment.

  • ledger_transaction (ModernTreasury::Models::LedgerTransactionCreateRequest)

    Specifies a ledger transaction object that will be created with the expected pay

  • ledger_transaction_id (String)

    Either ledger_transaction or ledger_transaction_id can be provided. Only a pendi

  • line_items (Array<ModernTreasury::Models::ExpectedPaymentCreateParams::LineItem>)
  • metadata (Hash{Symbol=>String})

    Additional data represented as key-value pairs. Both the key and value must be s

  • reconciliation_filters (Object, nil)

    The reconciliation filters you have for this payment.

  • reconciliation_groups (Object, nil)

    The reconciliation groups you have for this payment.

  • reconciliation_rule_variables (Array<ModernTreasury::Models::ReconciliationRule>, nil)

    An array of reconciliation rule variables for this payment.

  • remittance_information (String, nil)

    For ‘ach`, this field will be passed through on an addenda record. For `wire` pa

  • statement_descriptor (String, nil)

    The statement description you expect to see on the transaction. For ACH payments

  • type (Symbol, ModernTreasury::Models::ExpectedPaymentType, nil)

    One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen, se

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

Returns:

See Also:



58
59
60
61
62
63
64
65
66
67
# File 'lib/modern_treasury/resources/expected_payments.rb', line 58

def create(params = {})
  parsed, options = ModernTreasury::ExpectedPaymentCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/expected_payments",
    body: parsed,
    model: ModernTreasury::ExpectedPayment,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ ModernTreasury::Models::ExpectedPayment

delete expected payment

Parameters:

Returns:

See Also:



211
212
213
214
215
216
217
218
# File 'lib/modern_treasury/resources/expected_payments.rb', line 211

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["api/expected_payments/%1$s", id],
    model: ModernTreasury::ExpectedPayment,
    options: params[:request_options]
  )
end

#list(after_cursor: nil, counterparty_id: nil, created_at_lower_bound: nil, created_at_upper_bound: nil, direction: nil, external_id: nil, internal_account_id: nil, metadata: nil, per_page: nil, status: nil, type: nil, updated_at_lower_bound: nil, updated_at_upper_bound: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::ExpectedPayment>

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

list expected_payments

Parameters:

  • after_cursor (String, nil)
  • counterparty_id (String)

    Specify counterparty_id to see expected_payments for a specific account.

  • created_at_lower_bound (Time)

    Used to return expected payments created after some datetime

  • created_at_upper_bound (Time)

    Used to return expected payments created before some datetime

  • direction (Symbol, ModernTreasury::Models::TransactionDirection)

    One of credit, debit

  • external_id (String)
  • internal_account_id (String)

    Specify internal_account_id to see expected_payments for a specific account.

  • metadata (Hash{Symbol=>String})

    For example, if you want to query for records with metadata key ‘Type` and value

  • per_page (Integer)
  • status (Symbol, ModernTreasury::Models::ExpectedPaymentListParams::Status)

    One of unreconciled, reconciled, or archived.

  • type (Symbol, ModernTreasury::Models::ExpectedPaymentListParams::Type)

    One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,sen, sep

  • updated_at_lower_bound (Time)

    Used to return expected payments updated after some datetime

  • updated_at_upper_bound (Time)

    Used to return expected payments updated before some datetime

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

Returns:

See Also:



188
189
190
191
192
193
194
195
196
197
198
# File 'lib/modern_treasury/resources/expected_payments.rb', line 188

def list(params = {})
  parsed, options = ModernTreasury::ExpectedPaymentListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/expected_payments",
    query: parsed,
    page: ModernTreasury::Internal::Page,
    model: ModernTreasury::ExpectedPayment,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::ExpectedPayment

get expected payment

Parameters:

Returns:

See Also:



80
81
82
83
84
85
86
87
# File 'lib/modern_treasury/resources/expected_payments.rb', line 80

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/expected_payments/%1$s", id],
    model: ModernTreasury::ExpectedPayment,
    options: params[:request_options]
  )
end

#update(id, amount_lower_bound: nil, amount_upper_bound: nil, counterparty_id: nil, currency: nil, date_lower_bound: nil, date_upper_bound: nil, description: nil, direction: nil, external_id: nil, internal_account_id: nil, metadata: nil, reconciliation_filters: nil, reconciliation_groups: nil, reconciliation_rule_variables: nil, remittance_information: nil, statement_descriptor: nil, status: nil, type: nil, request_options: {}) ⇒ ModernTreasury::Models::ExpectedPayment

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

update expected payment

Parameters:

  • id (String)

    id

  • amount_lower_bound (Integer, nil)

    The lowest amount this expected payment may be equal to. Value in specified curr

  • amount_upper_bound (Integer, nil)

    The highest amount this expected payment may be equal to. Value in specified cur

  • counterparty_id (String, nil)

    The ID of the counterparty you expect for this payment.

  • currency (Symbol, ModernTreasury::Models::Currency, nil)

    Must conform to ISO 4217. Defaults to the currency of the internal account.

  • date_lower_bound (Date, nil)

    The earliest date the payment may come in. Format: yyyy-mm-dd

  • date_upper_bound (Date, nil)

    The latest date the payment may come in. Format: yyyy-mm-dd

  • description (String, nil)

    An optional description for internal use.

  • direction (Symbol, ModernTreasury::Models::ExpectedPaymentUpdateParams::Direction, nil)

    One of credit or debit. When you are receiving money, use credit. When you are b

  • external_id (String, nil)

    An optional user-defined 180 character unique identifier.

  • internal_account_id (String, nil)

    The ID of the Internal Account for the expected payment.

  • metadata (Hash{Symbol=>String})

    Additional data represented as key-value pairs. Both the key and value must be s

  • reconciliation_filters (Object, nil)

    The reconciliation filters you have for this payment.

  • reconciliation_groups (Object, nil)

    The reconciliation groups you have for this payment.

  • reconciliation_rule_variables (Array<ModernTreasury::Models::ReconciliationRule>, nil)

    An array of reconciliation rule variables for this payment.

  • remittance_information (String, nil)

    For ‘ach`, this field will be passed through on an addenda record. For `wire` pa

  • statement_descriptor (String, nil)

    The statement description you expect to see on the transaction. For ACH payments

  • status (Symbol, ModernTreasury::Models::ExpectedPaymentUpdateParams::Status, nil)

    The Expected Payment’s status can be updated from partially_reconciled to reconc

  • type (Symbol, ModernTreasury::Models::ExpectedPaymentType, nil)

    One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen, se

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

Returns:

See Also:



139
140
141
142
143
144
145
146
147
148
# File 'lib/modern_treasury/resources/expected_payments.rb', line 139

def update(id, params = {})
  parsed, options = ModernTreasury::ExpectedPaymentUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["api/expected_payments/%1$s", id],
    body: parsed,
    model: ModernTreasury::ExpectedPayment,
    options: options
  )
end