class GoCardlessPro::Resources::Customer

Customer objects hold the contact details for a customer. A customer can have several [customer bank accounts](core-endpoints-customer-bank-accounts), which in turn can have several Direct Debit [mandates](core-endpoints-mandates).

Attributes

address_line1[R]
address_line2[R]
address_line3[R]
city[R]
company_name[R]
country_code[R]
created_at[R]
danish_identity_number[R]
email[R]
family_name[R]
given_name[R]
id[R]
language[R]
metadata[R]
phone_number[R]
postal_code[R]
region[R]
swedish_identity_number[R]

Public Class Methods

new(object, response = nil) click to toggle source

Initialize a customer resource instance @param object [Hash] an object returned from the API

# File lib/gocardless_pro/resources/customer.rb, line 41
def initialize(object, response = nil)
  @object = object

  @address_line1 = object['address_line1']
  @address_line2 = object['address_line2']
  @address_line3 = object['address_line3']
  @city = object['city']
  @company_name = object['company_name']
  @country_code = object['country_code']
  @created_at = object['created_at']
  @danish_identity_number = object['danish_identity_number']
  @email = object['email']
  @family_name = object['family_name']
  @given_name = object['given_name']
  @id = object['id']
  @language = object['language']
  @metadata = object['metadata']
  @phone_number = object['phone_number']
  @postal_code = object['postal_code']
  @region = object['region']
  @swedish_identity_number = object['swedish_identity_number']
  @response = response
end

Public Instance Methods

api_response() click to toggle source
# File lib/gocardless_pro/resources/customer.rb, line 65
def api_response
  ApiResponse.new(@response)
end
to_h() click to toggle source

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

# File lib/gocardless_pro/resources/customer.rb, line 70
def to_h
  @object
end