Class: GoCardless::Merchant

Inherits:
Resource show all
Defined in:
lib/gocardless/merchant.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#id, #uri

Instance Method Summary collapse

Methods inherited from Resource

creatable, creatable?, date_accessor, date_writer, find, find_with_client, #initialize, #inspect, new_with_client, #persisted?, reference_accessor, reference_reader, reference_writer, #save, #to_hash, #to_json, updatable, updatable?

Constructor Details

This class inherits a constructor from GoCardless::Resource

Instance Attribute Details

#balance ⇒ Object

Returns the value of attribute balance.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def balance
  @balance
end

#description ⇒ Object

Returns the value of attribute description.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def description
  @description
end

#email ⇒ Object

Returns the value of attribute email.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def email
  @email
end

#first_name ⇒ Object

Returns the value of attribute first_name.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def first_name
  @first_name
end

#last_name ⇒ Object

Returns the value of attribute last_name.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def last_name
  @last_name
end

#name ⇒ Object

Returns the value of attribute name.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def name
  @name
end

#next_payout_amount ⇒ Object

Returns the value of attribute next_payout_amount.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def next_payout_amount
  @next_payout_amount
end

#pending_balance ⇒ Object

Returns the value of attribute pending_balance.



5
6
7
# File 'lib/gocardless/merchant.rb', line 5

def pending_balance
  @pending_balance
end

Instance Method Details

#bills(params = {}) ⇒ Object



36
37
38
39
40
41
# File 'lib/gocardless/merchant.rb', line 36

def bills(params = {})
  path = "/merchants/#{self.id}/bills"
  @client.api_get(path, params).map do |attrs|
    GoCardless::Bill.new_with_client(@client, attrs)
  end
end

#payments(params = {}) ⇒ Object



43
44
45
46
47
48
# File 'lib/gocardless/merchant.rb', line 43

def payments(params = {})
  path = "/merchants/#{self.id}/payments"
  @client.api_get(path, params).map do |attrs|
    GoCardless::Payment.new_with_client(@client, attrs)
  end
end

#pre_authorizations(params = {}) ⇒ Object



22
23
24
25
26
27
# File 'lib/gocardless/merchant.rb', line 22

def pre_authorizations(params = {})
  path = "/merchants/#{self.id}/pre_authorizations"
  @client.api_get(path, params).map do |attrs|
    GoCardless::PreAuthorization.new_with_client(@client, attrs)
  end
end

#subscriptions(params = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/gocardless/merchant.rb', line 15

def subscriptions(params = {})
  path = "/merchants/#{self.id}/subscriptions"
  @client.api_get(path, params).map do |attrs|
    GoCardless::Subscription.new_with_client(@client, attrs)
  end
end

#users(params = {}) ⇒ Object



29
30
31
32
33
34
# File 'lib/gocardless/merchant.rb', line 29

def users(params = {})
  path = "/merchants/#{self.id}/users"
  @client.api_get(path, params).map do |attrs|
    GoCardless::User.new_with_client(@client, attrs)
  end
end