Class: GoCardlessPro::Resources::PaymentAccountTransaction

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

Overview

Payment account transactions represent movements of funds on a given payment account. The payment account is provisioned by GoCardless and is 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) ⇒ PaymentAccountTransaction

Initialize a payment_account_transaction resource instance

Parameters:

  • object (Hash)

    an object returned from the API



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 30

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

  @amount = object['amount']
  @balance_after_transaction = object['balance_after_transaction']
  @counterparty_name = object['counterparty_name']
  @currency = object['currency']
  @description = object['description']
  @direction = object['direction']
  @id = object['id']
  @links = object['links']
  @reference = object['reference']
  @value_date = object['value_date']
  @response = response
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



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

def amount
  @amount
end

#balance_after_transactionObject (readonly)

Returns the value of attribute balance_after_transaction.



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

def balance_after_transaction
  @balance_after_transaction
end

#counterparty_nameObject (readonly)

Returns the value of attribute counterparty_name.



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

def counterparty_name
  @counterparty_name
end

#currencyObject (readonly)

Returns the value of attribute currency.



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

def currency
  @currency
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#directionObject (readonly)

Returns the value of attribute direction.



23
24
25
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 23

def direction
  @direction
end

#idObject (readonly)

Returns the value of attribute id.



24
25
26
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 24

def id
  @id
end

#referenceObject (readonly)

Returns the value of attribute reference.



25
26
27
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 25

def reference
  @reference
end

#value_dateObject (readonly)

Returns the value of attribute value_date.



26
27
28
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 26

def value_date
  @value_date
end

Instance Method Details

#api_responseObject



46
47
48
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 46

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



51
52
53
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 51

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

#to_hObject

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



56
57
58
# File 'lib/gocardless_pro/resources/payment_account_transaction.rb', line 56

def to_h
  @object
end