Class: Dodopayments::Resources::Customers::Wallets::LedgerEntries

Inherits:
Object
  • Object
show all
Defined in:
lib/dodopayments/resources/customers/wallets/ledger_entries.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ LedgerEntries

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

Parameters:



69
70
71
# File 'lib/dodopayments/resources/customers/wallets/ledger_entries.rb', line 69

def initialize(client:)
  @client = client
end

Instance Method Details

#create(customer_id, amount:, currency:, entry_type:, idempotency_key: nil, reason: nil, request_options: {}) ⇒ Dodopayments::Models::Customers::CustomerWallet

Parameters:

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/dodopayments/resources/customers/wallets/ledger_entries.rb', line 27

def create(customer_id, params)
  parsed, options = Dodopayments::Customers::Wallets::LedgerEntryCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["customers/%1$s/wallets/ledger-entries", customer_id],
    body: parsed,
    model: Dodopayments::Customers::CustomerWallet,
    options: options
  )
end

#list(customer_id, currency: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Customers::Wallets::CustomerWalletTransaction>

Parameters:

Returns:

See Also:



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/dodopayments/resources/customers/wallets/ledger_entries.rb', line 53

def list(customer_id, params = {})
  parsed, options = Dodopayments::Customers::Wallets::LedgerEntryListParams.dump_request(params)
  query = Dodopayments::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["customers/%1$s/wallets/ledger-entries", customer_id],
    query: query,
    page: Dodopayments::Internal::DefaultPageNumberPagination,
    model: Dodopayments::Customers::Wallets::CustomerWalletTransaction,
    options: options
  )
end