Module: MangoApi::Transactions

Extended by:
UriProvider
Defined in:
lib/mangopay/api/service/transactions.rb

Overview

Provides API method delegates concerning the Transaction entity

Class Method Summary collapse

Methods included from UriProvider

provide_uri

Class Method Details

.of_bank_account(id) {|filter_request = FilterRequest.new| ... } ⇒ Array

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

Parameters:

  • +id+ (String)

    ID of the bank account whose transactions to retrieve

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



196
197
198
199
200
201
202
# File 'lib/mangopay/api/service/transactions.rb', line 196

def (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 = FilterRequest.new| ... } ⇒ Array

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

Parameters:

  • +id+ (String)

    ID of the card whose transactions to retrieve

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



174
175
176
177
178
179
180
# 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 = FilterRequest.new| ... } ⇒ Array

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

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



102
103
104
105
106
107
108
# 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 = FilterRequest.new| ... } ⇒ Array

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

retrieve Transactions for

Parameters:

  • +funds_type+ (FundsType)

    the funds’ type of the wallet to

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



130
131
132
133
134
135
136
137
138
# 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 = FilterRequest.new| ... } ⇒ Array

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

Parameters:

  • +id+ (String)

    ID of the dispute whose transactions to retrieve

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



77
78
79
80
81
82
83
# 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 = FilterRequest.new| ... } ⇒ Array

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

Parameters:

  • +id+ (String)

    ID of the mandate whose transactions to retrieve

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



216
217
218
219
220
221
222
# 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 = FilterRequest.new| ... } ⇒ Array

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

Parameters:

  • +id+ (String)

    ID of the dispute whose transactions to retrieve

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



152
153
154
155
156
157
158
# 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 = FilterRequest.new| ... } ⇒ Array

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

Parameters:

  • +id+ (String)

    ID of the user whose transactions to retrieve

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



27
28
29
30
31
32
33
# 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 = FilterRequest.new| ... } ⇒ Array

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

Parameters:

  • +id+ (String)

    ID of the user whose transactions to retrieve

Yields:

Returns:

  • (Array)

    the requested Transaction entity objects



52
53
54
55
56
57
58
# 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