Class: GoCardlessPro::Resources::MandateImportEntry

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

Overview

Mandate Import Entries are added to a Mandate Import (https://developer.gocardless.com/api-reference/#core-endpoints-mandate-imports). Each entry corresponds to one mandate to be imported into GoCardless.

To import a mandate you will need:

  1. Identifying information about the customer (name/company and address)
  2. Bank account details, consisting of an account holder name and either an IBAN or local bank details (https://developer.gocardless.com/api-reference/#appendix-local-bank-details)
  3. Amendment details (SEPA only)

We suggest you provide a record_identifier (which is unique within the context of a single mandate import) to help you to identify mandates that have been created once the import has been processed by GoCardless. You can list the mandate import entries (https://developer.gocardless.com/api-reference/#mandate-import-entries-list-all-mandate-import-entries), match them up in your system using the record_identifier, and look at the links fields to find the mandate, customer and customer bank account that have been imported.

Restricted: This API is currently only available for approved integrators

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ MandateImportEntry

Initialize a mandate_import_entry resource instance

Parameters:

  • object (Hash)

    an object returned from the API



47
48
49
50
51
52
53
54
55
# File 'lib/gocardless_pro/resources/mandate_import_entry.rb', line 47

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

  @created_at = object['created_at']
  @links = object['links']
  @processing_errors = object['processing_errors']
  @record_identifier = object['record_identifier']
  @response = response
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



41
42
43
# File 'lib/gocardless_pro/resources/mandate_import_entry.rb', line 41

def created_at
  @created_at
end

#processing_errorsObject (readonly)

Returns the value of attribute processing_errors.



42
43
44
# File 'lib/gocardless_pro/resources/mandate_import_entry.rb', line 42

def processing_errors
  @processing_errors
end

#record_identifierObject (readonly)

Returns the value of attribute record_identifier.



43
44
45
# File 'lib/gocardless_pro/resources/mandate_import_entry.rb', line 43

def record_identifier
  @record_identifier
end

Instance Method Details

#api_responseObject



57
58
59
# File 'lib/gocardless_pro/resources/mandate_import_entry.rb', line 57

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



62
63
64
# File 'lib/gocardless_pro/resources/mandate_import_entry.rb', line 62

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

#to_hObject

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



67
68
69
# File 'lib/gocardless_pro/resources/mandate_import_entry.rb', line 67

def to_h
  @object
end