Module: MangoApi::ClientWallets

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

Overview

Provides API method delegates concerning the ClientWallet entity

Class Method Summary collapse

Methods included from UriProvider

provide_uri

Class Method Details

.all {|filter_request = FilterRequest.new| ... } ⇒ Array

Retrieves client wallet entities. 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

corresponding to provided filters

Yields:

Returns:

  • (Array)

    array of hashed client wallet entities



35
36
37
38
39
40
41
# File 'lib/mangopay/api/service/client_wallets.rb', line 35

def all
  uri = provide_uri(:get_client_wallets)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end

.get(funds_type, currency) ⇒ ClientWallet

Retrieves a client wallet entity. Client wallet entity of provided funds’ type and currency will be created if it does not yet exist.

Parameters:

  • +funds_type+ (FundsType)

    funds’ type of the wallet to retrieve

  • +currency+ (CurrencyIso)

    currency of the wallet to retrieve

Returns:

  • (ClientWallet)

    the corresponding ClientWallet entity object



17
18
19
20
21
# File 'lib/mangopay/api/service/client_wallets.rb', line 17

def get(funds_type, currency)
  uri = provide_uri(:get_client_wallet, funds_type, currency)
  response = HttpClient.get(uri)
  parse response
end

.of_funds_type(funds_type) {|filter_request = FilterRequest.new| ... } ⇒ Array

Retrieves client wallet entities of a certain funds type. 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

wallets to retrieve corresponding to provided filters

Parameters:

  • +funds_type+ (FundsType)

    funds’ type of the client

Yields:

Returns:

  • (Array)

    array of hashed client wallet entities



58
59
60
61
62
63
64
# File 'lib/mangopay/api/service/client_wallets.rb', line 58

def of_funds_type(funds_type)
  uri = provide_uri(:get_client_wallets_funds_type, funds_type)
  filter_request = nil
  yield filter_request = FilterRequest.new if block_given?
  results = HttpClient.get(uri, filter_request)
  parse_results results
end