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.

Class Method Summary collapse

Class 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",



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

def get_clients
  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.)



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

def update_client_information(name, email, webhook_url)
  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)



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

def update_payment_address(address, blockchain)
  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.)



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

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