Class: Hyperwallet::Client

Inherits:
Object
  • Object
show all
Includes:
BankAccount, Payment, User, WebhookNotification
Defined in:
lib/hyperwallet/client.rb,
lib/hyperwallet/resources/user.rb,
lib/hyperwallet/resources/payment.rb,
lib/hyperwallet/resources/bank_account.rb,
lib/hyperwallet/resources/webhook_notification.rb

Defined Under Namespace

Modules: BankAccount, Payment, User, WebhookNotification

Constant Summary

Constants included from WebhookNotification

WebhookNotification::PATH

Constants included from User

User::PATH

Constants included from Payment

Payment::PATH

Constants included from BankAccount

BankAccount::PATH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WebhookNotification

#list_webhook_notifications

Methods included from User

#create_user, #find_user, #list_users

Methods included from Payment

#create_payment, #find_payment, #list_payments

Methods included from BankAccount

#create_bank_account, #find_bank_account, #list_bank_accounts

Constructor Details

#initialize(url:, username:, password:, logger: true, adapter: Faraday.default_adapter, proxy: nil) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
21
22
23
# File 'lib/hyperwallet/client.rb', line 16

def initialize(url:, username:, password:, logger: true, adapter: Faraday.default_adapter, proxy: nil)
  @url      = "#{url}/rest/v4/"
  @username = username
  @password = password
  @logger   = logger
  @adapter  = adapter
  @proxy    = proxy
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



14
15
16
# File 'lib/hyperwallet/client.rb', line 14

def adapter
  @adapter
end

#loggerObject (readonly)

Returns the value of attribute logger.



14
15
16
# File 'lib/hyperwallet/client.rb', line 14

def logger
  @logger
end

#passwordObject (readonly)

Returns the value of attribute password.



14
15
16
# File 'lib/hyperwallet/client.rb', line 14

def password
  @password
end

#proxyObject (readonly)

Returns the value of attribute proxy.



14
15
16
# File 'lib/hyperwallet/client.rb', line 14

def proxy
  @proxy
end

#urlObject (readonly)

Returns the value of attribute url.



14
15
16
# File 'lib/hyperwallet/client.rb', line 14

def url
  @url
end

#usernameObject (readonly)

Returns the value of attribute username.



14
15
16
# File 'lib/hyperwallet/client.rb', line 14

def username
  @username
end

Instance Method Details

#delete(path, options = {}) ⇒ Object



25
26
27
# File 'lib/hyperwallet/client.rb', line 25

def delete(path, options = {})
  connection.delete(path, options).body
end

#get(path, options = {}) ⇒ Object



29
30
31
# File 'lib/hyperwallet/client.rb', line 29

def get(path, options = {})
  connection.get(path, options).body
end

#patch(path, options = {}) ⇒ Object



33
34
35
# File 'lib/hyperwallet/client.rb', line 33

def patch(path, options = {})
  connection.patch(path, options).body
end

#post(path, options = {}) ⇒ Object



37
38
39
# File 'lib/hyperwallet/client.rb', line 37

def post(path, options = {})
  connection.post(path, options).body
end

#put(path, options = {}) ⇒ Object



41
42
43
# File 'lib/hyperwallet/client.rb', line 41

def put(path, options = {})
  connection.put(path, options).body
end