Module: MangoApi::BankingAliases

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

Overview

Provides API method delegates concerning the BankingAlias entity

Class Method Summary collapse

Methods included from UriProvider

provide_uri

Class Method Details

.create_iban(banking_alias, wallet_id) ⇒ Object

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]


23
24
25
26
27
# 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) ⇒ BankingAlias

Retrieves a banking alias entity.

Parameters:

  • +id+ (String)

    ID of the banking alias to be retrieved

Returns:

  • (BankingAlias)

    the requested entity object



44
45
46
47
48
# 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) ⇒ List<BankingAlias>

Retrieves all banking alias entities corresponding to a waller.

Parameters:

  • +id+ (String)

    ID of the banking alias to be retrieved

Returns:

  • (List<BankingAlias>)

    the requested entity object



54
55
56
57
58
# 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) ⇒ BankingAlias

Retrieves a banking alias entity.

Parameters:

  • +id+ (String)

    ID of the banking alias to be retrieved

  • +banking_alias+ (BankingAlias)

    Whether is active or not

Returns:

  • (BankingAlias)

    the requested entity object



34
35
36
37
38
# 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