Class: GoCardlessPro::Resources::PaymentAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/payment_account.rb

Overview

Access the details of bank accounts provided for you by GoCardless that are used to fund Outbound Payments (https://developer.gocardless.com/api-reference/#core-endpoints-outbound-payments).

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ PaymentAccount

Initialize a payment_account resource instance

Parameters:

  • object (Hash)

    an object returned from the API



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/gocardless_pro/resources/payment_account.rb', line 26

def initialize(object, response = nil)
  @object = object

  @account_balance = object['account_balance']
  @account_holder_name = object['account_holder_name']
  @account_number_ending = object['account_number_ending']
  @bank_name = object['bank_name']
  @currency = object['currency']
  @id = object['id']
  @links = object['links']
  @response = response
end

Instance Attribute Details

#account_balanceObject (readonly)

Returns the value of attribute account_balance.



17
18
19
# File 'lib/gocardless_pro/resources/payment_account.rb', line 17

def 
  @account_balance
end

#account_holder_nameObject (readonly)

Returns the value of attribute account_holder_name.



18
19
20
# File 'lib/gocardless_pro/resources/payment_account.rb', line 18

def 
  @account_holder_name
end

#account_number_endingObject (readonly)

Returns the value of attribute account_number_ending.



19
20
21
# File 'lib/gocardless_pro/resources/payment_account.rb', line 19

def 
  @account_number_ending
end

#bank_nameObject (readonly)

Returns the value of attribute bank_name.



20
21
22
# File 'lib/gocardless_pro/resources/payment_account.rb', line 20

def bank_name
  @bank_name
end

#currencyObject (readonly)

Returns the value of attribute currency.



21
22
23
# File 'lib/gocardless_pro/resources/payment_account.rb', line 21

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



22
23
24
# File 'lib/gocardless_pro/resources/payment_account.rb', line 22

def id
  @id
end

Instance Method Details

#api_responseObject



39
40
41
# File 'lib/gocardless_pro/resources/payment_account.rb', line 39

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



44
45
46
# File 'lib/gocardless_pro/resources/payment_account.rb', line 44

def links
  @payment_account_links ||= Links.new(@links)
end

#to_hObject

Provides the payment_account resource as a hash of all its readable attributes



49
50
51
# File 'lib/gocardless_pro/resources/payment_account.rb', line 49

def to_h
  @object
end