Class: GoCardlessPro::Resources::CustomerBankAccount
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::CustomerBankAccount
- Defined in:
- lib/gocardless_pro/resources/customer_bank_account.rb
Overview
Customer Bank Accounts hold the bank details of a customer (https://developer.gocardless.com/api-reference/#core-endpoints-customers). They always belong to a customer (https://developer.gocardless.com/api-reference/#core-endpoints-customers), and may be linked to several Direct Debit mandates (https://developer.gocardless.com/api-reference/#core-endpoints-mandates).
Note that customer bank accounts must be unique, and so you will encounter
a bank_account_exists error if you try to create a duplicate bank
account. You may wish to handle this by updating the existing record
instead, the ID of which will be provided as
links[customer_bank_account] in the error response.
Note: To ensure the customer's bank accounts are valid, verify them first using bank_details_lookups (https://developer.gocardless.com/api-reference/#bank-details-lookups-perform-a-bank-details-lookup), before proceeding with creating the accounts
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#account_holder_name ⇒ Object
readonly
Returns the value of attribute account_holder_name.
-
#account_number_ending ⇒ Object
readonly
Returns the value of attribute account_number_ending.
-
#account_type ⇒ Object
readonly
Returns the value of attribute account_type.
-
#bank_account_token ⇒ Object
readonly
Returns the value of attribute bank_account_token.
-
#bank_name ⇒ Object
readonly
Returns the value of attribute bank_name.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#payer_name_verification_result ⇒ Object
readonly
Returns the value of attribute payer_name_verification_result.
-
#trusted_recipient ⇒ Object
readonly
Returns the value of attribute trusted_recipient.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ CustomerBankAccount
constructor
Initialize a customer_bank_account resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the customer_bank_account resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ CustomerBankAccount
Initialize a customer_bank_account resource instance
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 48 def initialize(object, response = nil) @object = object @account_holder_name = object['account_holder_name'] @account_number_ending = object['account_number_ending'] @account_type = object['account_type'] @bank_account_token = object['bank_account_token'] @bank_name = object['bank_name'] @country_code = object['country_code'] @created_at = object['created_at'] @currency = object['currency'] @enabled = object['enabled'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @payer_name_verification_result = object['payer_name_verification_result'] @trusted_recipient = object['trusted_recipient'] @response = response end |
Instance Attribute Details
#account_holder_name ⇒ Object (readonly)
Returns the value of attribute account_holder_name.
32 33 34 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 32 def account_holder_name @account_holder_name end |
#account_number_ending ⇒ Object (readonly)
Returns the value of attribute account_number_ending.
33 34 35 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 33 def account_number_ending @account_number_ending end |
#account_type ⇒ Object (readonly)
Returns the value of attribute account_type.
34 35 36 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 34 def account_type @account_type end |
#bank_account_token ⇒ Object (readonly)
Returns the value of attribute bank_account_token.
35 36 37 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 35 def bank_account_token @bank_account_token end |
#bank_name ⇒ Object (readonly)
Returns the value of attribute bank_name.
36 37 38 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 36 def bank_name @bank_name end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
37 38 39 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 37 def country_code @country_code end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
38 39 40 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 38 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
39 40 41 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 39 def currency @currency end |
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled.
40 41 42 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 40 def enabled @enabled end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
41 42 43 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 41 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
42 43 44 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 42 def @metadata end |
#payer_name_verification_result ⇒ Object (readonly)
Returns the value of attribute payer_name_verification_result.
43 44 45 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 43 def payer_name_verification_result @payer_name_verification_result end |
#trusted_recipient ⇒ Object (readonly)
Returns the value of attribute trusted_recipient.
44 45 46 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 44 def trusted_recipient @trusted_recipient end |
Instance Method Details
#api_response ⇒ Object
68 69 70 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 68 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
73 74 75 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 73 def links @customer_bank_account_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the customer_bank_account resource as a hash of all its readable attributes
78 79 80 |
# File 'lib/gocardless_pro/resources/customer_bank_account.rb', line 78 def to_h @object end |