Module: MangoApi::Clients
- Extended by:
- UriProvider
- Defined in:
- lib/mangopay/api/service/clients.rb
Overview
Provides API method delegates concerning the Client
entity
Class Method Summary collapse
- .create_bank_account(bank_account) ⇒ Object
- .create_payout(payout) ⇒ Object
-
.get ⇒ Client
Retrieves the current environment’s client entity.
-
.update(client) ⇒ Client
Updates the current environment’s client entity.
-
.upload_logo(path) ⇒ Object
Uploads the image file specified as the current environment’s client’s logo.
Methods included from UriProvider
Class Method Details
.create_bank_account(bank_account) ⇒ Object
56 57 58 59 60 |
# 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) ⇒ Object
62 63 64 65 66 |
# 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 ⇒ Client
Retrieves the current environment’s client entity.
50 51 52 53 54 |
# 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) ⇒ Client
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
and updated dat
30 31 32 33 34 |
# 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 |
.upload_logo(path) ⇒ Object
Uploads the image file specified as the current environment’s client’s logo.
40 41 42 43 44 45 |
# 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 |