module MangoApi::Clients
Provides API method delegates concerning the Client
entity
Public Class Methods
# 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
# 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
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
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
Uploads the image file specified as the current environment's client's logo.
@param path
[String] path of the logo image
# File lib/mangopay/api/service/clients.rb, line 40 def upload_logo(path) uri = provide_uri(:upload_client_logo) body = UploadFileRequest.new body.file = FileEncoder.encode_base64 path HttpClient.put(uri, body) end
Private Class Methods
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