module MangoApi::Transactions
Provides API method delegates concerning the Transaction
entity
Public Class Methods
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
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
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
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
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
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
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
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
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
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