Class: Monobank::Corporate::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/monobank/corporate/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(private_key:, key_id:) ⇒ Client

Returns a new instance of Client.



14
15
16
17
# File 'lib/monobank/corporate/client.rb', line 14

def initialize(private_key:, key_id:)
  @private_key = private_key
  @key_id = key_id
end

Instance Method Details

#auth_check(request_id:) ⇒ Object



39
40
41
# File 'lib/monobank/corporate/client.rb', line 39

def auth_check(request_id:)
  Personal::AuthCheck.new(auth: auth(request_id:)).call
end

#auth_request(callback: nil) ⇒ Object



35
36
37
# File 'lib/monobank/corporate/client.rb', line 35

def auth_request(callback: nil)
  Personal::AuthRequest.new(callback:, auth:).call
end

#client_info(request_id:) ⇒ Object



43
44
45
# File 'lib/monobank/corporate/client.rb', line 43

def client_info(request_id:)
  Personal::ClientInfo.new(auth: auth(request_id:)).call
end

#registration(public_key:, name:, description:, contact_person:, phone:, email:, logo:) ⇒ Object



19
20
21
# File 'lib/monobank/corporate/client.rb', line 19

def registration(public_key:, name:, description:, contact_person:, phone:, email:, logo:)
  Personal::Registration.new(public_key:, name:, description:, contact_person:, phone:, email:, logo:, auth:).call
end

#registration_status(public_key:) ⇒ Object



23
24
25
# File 'lib/monobank/corporate/client.rb', line 23

def registration_status(public_key:)
  Personal::RegistrationStatus.new(public_key:, auth:).call
end

#set_webhook(url:) ⇒ Object



27
28
29
# File 'lib/monobank/corporate/client.rb', line 27

def set_webhook(url:)
  Personal::CorporateWebhook.new(url: url, auth:).call
end

#settingsObject



31
32
33
# File 'lib/monobank/corporate/client.rb', line 31

def settings
  Personal::Settings.new(auth:).call
end

#statement(request_id:, account_id:, from:, to: nil) ⇒ Object



47
48
49
# File 'lib/monobank/corporate/client.rb', line 47

def statement(request_id:, account_id:, from:, to: nil)
  Personal::Statement.new(account_id:, from:, to:, auth: auth(request_id:)).call
end