module MangoApi::Clients

Provides API method delegates concerning the Client entity

Public Class Methods

create_bank_account(bank_account) click to toggle source
# File lib/mangopay/api/service/clients.rb, line 56
def create_bank_account(bank_account)
  uri = provide_uri(:client_create_bank_account)
  response = HttpClient.post(uri, bank_account)
  MangoModel::IbanBankAccount.new.dejsonify response
end
create_payout(payout) click to toggle source
# File lib/mangopay/api/service/clients.rb, line 62
def create_payout(payout)
  uri = provide_uri(:client_create_payout)
  response = HttpClient.post(uri, payout)
  MangoModel::PayOut.new.dejsonify response
end
get() click to toggle source

Retrieves the current environment's client entity.

@return [Client] current Client entity object

# File lib/mangopay/api/service/clients.rb, line 50
def get
  uri = provide_uri(:get_client)
  response = HttpClient.get(uri)
  parse response
end
update(client) click to toggle source

Updates the current environment's client entity.

Client optional properties:

  • primary_button_colour

  • primary_theme_colour

  • admin_emails

  • tech_emails

  • billing_emails

  • fraud_emails

  • headquarters_address

  • tax_number

  • platform_type

  • platform_description

  • platform_url

@param client [Client] client object with corresponding ID and updated dat @return [Client] updated Client entity object

# File lib/mangopay/api/service/clients.rb, line 30
def update(client)
  uri = provide_uri(:update_client)
  response = HttpClient.put(uri, client)
  parse response
end

Private Class Methods

parse(response) click to toggle source

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

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

# File lib/mangopay/api/service/clients.rb, line 75
def parse(response)
  MangoModel::Client.new.dejsonify response
end