Class: GoCardlessPro::Resources::MandateImport

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

Overview

Mandate Imports allow you to migrate existing mandates from other providers into the GoCardless platform.

The process is as follows:

1. [Create a mandate

import](#mandate-imports-create-a-new-mandate-import)

2. [Add entries](#mandate-import-entries-add-a-mandate-import-entry) to

the import

3. [Submit](#mandate-imports-submit-a-mandate-import) the import
4. Wait until a member of the GoCardless team approves the import, at

which point the mandates will be created

5. [Link up the

mandates](#mandate-import-entries-list-all-mandate-import-entries) in your system

When you add entries to your mandate import, they are not turned into actual mandates until the mandate import is submitted by you via the API, and then processed by a member of the GoCardless team. When that happens, a mandate will be created for each entry in the import.

We will issue a ‘mandate_created` webhook for each entry, which will be the same as the webhooks triggered when [ creating a mandate ](#mandates-create-a-mandate) using the mandates API. Once these webhooks start arriving, any reconciliation can now be accomplished by [checking the current status](#mandate-imports-get-a-mandate-import) of the mandate import and [linking up the mandates to your system](#mandate-import-entries-list-all-mandate-import-entries).

<p class=“notice”>Note that all Mandate Imports have an upper limit of 30,000 entries, so we recommend you split your import into several smaller imports if you’re planning to exceed this threshold.</p>

<p class=“restricted-notice”><strong>Restricted</strong>: This API is currently only available for approved integrators - please <a href=“[email protected]”>get in touch</a> if you would like to use this API.</p>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ MandateImport

Initialize a mandate_import resource instance

Parameters:

  • object (Hash)

    an object returned from the API



65
66
67
68
69
70
71
72
73
# File 'lib/gocardless_pro/resources/mandate_import.rb', line 65

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

  @created_at = object['created_at']
  @id = object['id']
  @scheme = object['scheme']
  @status = object['status']
  @response = response
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



59
60
61
# File 'lib/gocardless_pro/resources/mandate_import.rb', line 59

def id
  @id
end

#schemeObject (readonly)

Returns the value of attribute scheme.



60
61
62
# File 'lib/gocardless_pro/resources/mandate_import.rb', line 60

def scheme
  @scheme
end

#statusObject (readonly)

Returns the value of attribute status.



61
62
63
# File 'lib/gocardless_pro/resources/mandate_import.rb', line 61

def status
  @status
end

Instance Method Details

#api_responseObject



75
76
77
# File 'lib/gocardless_pro/resources/mandate_import.rb', line 75

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



80
81
82
# File 'lib/gocardless_pro/resources/mandate_import.rb', line 80

def to_h
  @object
end