module MangoApi::Transactions

Provides API method delegates concerning the Transaction entity

Public Class Methods

of_bank_account(id) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to a certain bank account. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

  • status

  • result_code

@param id [String] ID of the bank account whose transactions to retrieve @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 196
def of_bank_account(id)
  uri = provide_uri(:get_bank_accounts_transactions, id)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_card(id) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of card entities belonging to a certain card. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

  • status

  • result_code

@param id [String] ID of the card whose transactions to retrieve @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 174
def of_card(id)
  uri = provide_uri(:get_cards_transactions, id)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_client() { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to the current environment's client. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

  • before_date

  • after_date

  • status

  • nature

  • type

@return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 102
def of_client
  uri = provide_uri(:get_clients_transactions)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_client_wallet(funds_type, currency) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to the current environment's client wallet specified by funds_type and currency. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

  • before_date

  • after_date

  • status

  • nature

  • type

@param funds_type [FundsType] the funds' type of the wallet to retrieve Transactions for @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 130
def of_client_wallet(funds_type, currency)
  uri = provide_uri(:get_client_wallets_transactions,
                    funds_type,
                    currency)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_dispute(id) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to a certain dispute. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

  • before_date

  • after_date

  • status

  • nature

  • type

@param id [String] ID of the dispute whose transactions to retrieve @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 77
def of_dispute(id)
  uri = provide_uri(:get_disputes_transactions, id)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_mandate(id) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to a certain mandate. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

@param id [String] ID of the mandate whose transactions to retrieve @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 216
def of_mandate(id)
  uri = provide_uri(:get_mandates_transactions, id)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_pre_authorization(id) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to a certain pre-authorization. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

@param id [String] ID of the dispute whose transactions to retrieve @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 152
def of_pre_authorization(id)
  uri = provide_uri(:get_pre_authorizations_transactions, id)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_user(id) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to a certain user. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

  • before_date

  • after_date

  • status

  • nature

  • type

@param id [String] ID of the user whose transactions to retrieve @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 27
def of_user(id)
  uri = provide_uri(:get_users_transactions, id)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end
of_wallet(id) { |filter_request = filter_request| ... } click to toggle source

Retrieves pages of transaction entities belonging to a certain wallet. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.

Allowed FilterRequest params:

  • page

  • per_page

  • sort_field and sort_direction

  • before_date

  • after_date

  • status

  • nature

  • type

@param id [String] ID of the user whose transactions to retrieve @return [Array] the requested Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 52
def of_wallet(id)
  uri = provide_uri(:get_wallets_transactions, id)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end

Private Class Methods

parse(response) click to toggle source

Parses a JSON-originating hash into the corresponding Transaction entity object.

@param response [Hash] JSON-originating data hash @return [Transaction] corresponding Transaction entity object

# File lib/mangopay/api/service/transactions.rb, line 242
def parse(response)
  MangoModel::Transaction.new.dejsonify response
end
parse_results(results) click to toggle source

Parses an array of JSON-originating hashes into the corresponding Transaction entity objects.

@param results [Array] JSON-originating data hashes @return [Array] parsed Transaction entity objects

# File lib/mangopay/api/service/transactions.rb, line 231
def parse_results(results)
  results.collect do |entity|
    parse entity
  end
end