module MangoApi::BankingAliases

Provides API method delegates concerning the BankingAlias entity

Public Class Methods

create_iban(banking_alias, wallet_id) click to toggle source

Creates an IBAN banking alias

BankingAlias properties:

  • Required:

    • credited_user_id

    • wallet_id

    • type

    • country

    • owner_name

    • active

@param +banking_alias+ [BankingAlias] model object of banking alias to be created
@param +wallet_id+ [String] the wallet_id
@return [BakingAliasIBAN]
# File lib/mangopay/api/service/banking_aliases.rb, line 23
def create_iban(banking_alias, wallet_id)
  uri = provide_uri(:banking_alias_create_iban, wallet_id)
  response = HttpClient.post(uri, banking_alias)
  parse response
end
get(id) click to toggle source

Retrieves a banking alias entity.

@param id [String] ID of the banking alias to be retrieved @return [BankingAlias] the requested entity object

# File lib/mangopay/api/service/banking_aliases.rb, line 44
def get(id)
  uri = provide_uri(:banking_alias_get, id)
  response = HttpClient.get(uri)
  parse response
end
get_all(id) click to toggle source

Retrieves all banking alias entities corresponding to a waller.

@param id [String] ID of the banking alias to be retrieved @return [List<BankingAlias>] the requested entity object

# File lib/mangopay/api/service/banking_aliases.rb, line 54
def get_all(id)
  uri = provide_uri(:banking_alias_all, id)
  response = HttpClient.get(uri)
  parse_results response
end
update(id, banking_alias) click to toggle source

Retrieves a banking alias entity.

@param id [String] ID of the banking alias to be retrieved @param banking_alias [BankingAlias] Whether is active or not @return [BankingAlias] the requested entity object

# File lib/mangopay/api/service/banking_aliases.rb, line 34
def update(id, banking_alias)
  uri = provide_uri(:banking_alias_save, id)
  response = HttpClient.put(uri, banking_alias)
  parse response
end

Private Class Methods

parse(response) click to toggle source

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

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

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

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

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

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