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
Public Class Methods
Source
# File lib/gocardless_pro/resources/customer.rb, line 23 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
Initialize a customer resource instance @param object [Hash] an object returned from the API
Public Instance Methods
Source
# File lib/gocardless_pro/resources/customer.rb, line 47 def api_response ApiResponse.new(@response) end
Source
# File lib/gocardless_pro/resources/customer.rb, line 52 def to_h @object end
Provides the customer resource as a hash of all its readable attributes