Class: CryptomateApi::Management::Client

Inherits:
Base
  • Object
show all
Defined in:
lib/cryptomate_api/management/client.rb

Overview

Manage the company information from here, like changing the webhook url where we will notify that some event happened or just changing the name of the company.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CryptomateApi::Base

Instance Method Details

#get_clientsObject

Get clients information cryptomate.me/docs/management#get-clients-information Response:

"name": "string",
"last_name": "string",
"email": "string",
"social_reason": "string",
"webhook_url": "string",



18
19
20
# File 'lib/cryptomate_api/management/client.rb', line 18

def get_clients
  self.class.get('/management/clients')
end

#update_client_information(name, email, webhook_url) ⇒ Object

Update Client-Information cryptomate.me/docs/management#update-client-information Response:

"name": "string",
"email": "string",
"webhook_url": "string"

Parameters:

  • name (String)

    (Name of the client to update.)

  • email (String)

    (Email of the client to update.)

  • webhook_url (String)

    (New webhook url to use to inform any changes.)



46
47
48
# File 'lib/cryptomate_api/management/client.rb', line 46

def update_client_information(name, email, webhook_url)
  self.class.put('/management/clients', body: { name:, email:, webhook_url: }.to_json)
end

#update_payment_address(address, blockchain) ⇒ Object

Update Payment Address cryptomate.me/docs/management#update-payments-address Response:

"address": "string",

Parameters:

  • address (String)

    (Address where you want to receive the payments)

  • blockchain (String)

    (Blockchain where you want to receive the payments)



58
59
60
# File 'lib/cryptomate_api/management/client.rb', line 58

def update_payment_address(address, blockchain)
  self.class.patch('/management/clients/payment-treasury', body: { address:, blockchain: }.to_json)
end

#update_webhook_url(webhook_url) ⇒ Object

Update Webhook-Url cryptomate.me/docs/management#update-webhook-url Response:

"name": "string",
"email": "string",
"webhook_url": "string"

Parameters:

  • webhook_url (String)

    (New webhook url to use to inform any changes.)



31
32
33
# File 'lib/cryptomate_api/management/client.rb', line 31

def update_webhook_url(webhook_url)
  self.class.patch('/management/clients/webhook-url', body: { webhook_url: }.to_json)
end