Class: GoCardlessPro::Resources::Creditor

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

Overview

Each [payment](#core-endpoints-payments) taken through the API is linked to a “creditor”, to whom the payment is then paid out. In most cases your organisation will have a single “creditor”, but the API also supports collecting payments on behalf of others.

Currently, for Anti Money Laundering reasons, any creditors you add must be directly related to your organisation.

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ Creditor

Initialize a creditor resource instance

Parameters:

  • object (Hash)

    an object returned from the API



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gocardless_pro/resources/creditor.rb', line 26

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

  @address_line1 = object['address_line1']
  @address_line2 = object['address_line2']
  @address_line3 = object['address_line3']
  @bank_reference_prefix = object['bank_reference_prefix']
  @can_create_refunds = object['can_create_refunds']
  @city = object['city']
  @country_code = object['country_code']
  @created_at = object['created_at']
  @creditor_type = object['creditor_type']
  @custom_payment_pages_enabled = object['custom_payment_pages_enabled']
  @fx_payout_currency = object['fx_payout_currency']
  @id = object['id']
  @links = object['links']
  @logo_url = object['logo_url']
  @mandate_imports_enabled = object['mandate_imports_enabled']
  @merchant_responsible_for_notifications = object['merchant_responsible_for_notifications']
  @name = object['name']
  @postal_code = object['postal_code']
  @region = object['region']
  @scheme_identifiers = object['scheme_identifiers']
  @verification_status = object['verification_status']
  @response = response
end

Instance Attribute Details

#address_line1Object (readonly)

Returns the value of attribute address_line1.



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

def address_line1
  @address_line1
end

#address_line2Object (readonly)

Returns the value of attribute address_line2.



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

def address_line2
  @address_line2
end

#address_line3Object (readonly)

Returns the value of attribute address_line3.



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

def address_line3
  @address_line3
end

#bank_reference_prefixObject (readonly)

Returns the value of attribute bank_reference_prefix.



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

def bank_reference_prefix
  @bank_reference_prefix
end

#can_create_refundsObject (readonly)

Returns the value of attribute can_create_refunds.



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

def can_create_refunds
  @can_create_refunds
end

#cityObject (readonly)

Returns the value of attribute city.



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

def city
  @city
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#creditor_typeObject (readonly)

Returns the value of attribute creditor_type.



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

def creditor_type
  @creditor_type
end

#custom_payment_pages_enabledObject (readonly)

Returns the value of attribute custom_payment_pages_enabled.



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

def custom_payment_pages_enabled
  @custom_payment_pages_enabled
end

#fx_payout_currencyObject (readonly)

Returns the value of attribute fx_payout_currency.



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

def fx_payout_currency
  @fx_payout_currency
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#logo_urlObject (readonly)

Returns the value of attribute logo_url.



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

def logo_url
  @logo_url
end

#mandate_imports_enabledObject (readonly)

Returns the value of attribute mandate_imports_enabled.



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

def mandate_imports_enabled
  @mandate_imports_enabled
end

#merchant_responsible_for_notificationsObject (readonly)

Returns the value of attribute merchant_responsible_for_notifications.



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

def merchant_responsible_for_notifications
  @merchant_responsible_for_notifications
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



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

def postal_code
  @postal_code
end

#regionObject (readonly)

Returns the value of attribute region.



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

def region
  @region
end

#scheme_identifiersObject (readonly)

Returns the value of attribute scheme_identifiers.



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

def scheme_identifiers
  @scheme_identifiers
end

#verification_statusObject (readonly)

Returns the value of attribute verification_status.



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

def verification_status
  @verification_status
end

Instance Method Details

#api_responseObject



53
54
55
# File 'lib/gocardless_pro/resources/creditor.rb', line 53

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



58
59
60
# File 'lib/gocardless_pro/resources/creditor.rb', line 58

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

#to_hObject

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



63
64
65
# File 'lib/gocardless_pro/resources/creditor.rb', line 63

def to_h
  @object
end