Class: GoCardlessPro::Services::MandateImportEntriesService
- Inherits:
-
BaseService
- Object
- BaseService
- GoCardlessPro::Services::MandateImportEntriesService
- Defined in:
- lib/gocardless_pro/services/mandate_import_entries_service.rb
Overview
Service for making requests to the MandateImportEntry endpoints
Instance Method Summary collapse
-
#all(options = {}) ⇒ Object
Get a lazily enumerated list of all the items returned.
-
#create(options = {}) ⇒ Object
For an existing [mandate import](#core-endpoints-mandate-imports), this endpoint can be used to add individual mandates to be imported into GoCardless.
-
#list(options = {}) ⇒ Object
For an existing mandate import, this endpoint lists all of the entries attached.
Methods inherited from BaseService
#initialize, #make_request, #sub_url
Constructor Details
This class inherits a constructor from GoCardlessPro::Services::BaseService
Instance Method Details
#all(options = {}) ⇒ Object
Get a lazily enumerated list of all the items returned. This is similar to the ‘list` method but will paginate for you automatically.
Otherwise they will be the body of the request.
67 68 69 70 71 72 |
# File 'lib/gocardless_pro/services/mandate_import_entries_service.rb', line 67 def all( = {}) Paginator.new( service: self, options: ).enumerator end |
#create(options = {}) ⇒ Object
For an existing [mandate import](#core-endpoints-mandate-imports), this endpoint can be used to add individual mandates to be imported into GoCardless.
You can add no more than 30,000 rows to a single mandate import. If you attempt to go over this limit, the API will return a ‘record_limit_exceeded` error. Example URL: /mandate_import_entries
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gocardless_pro/services/mandate_import_entries_service.rb', line 22 def create( = {}) path = '/mandate_import_entries' params = .delete(:params) || {} [:params] = {} [:params][envelope_key] = params [:retry_failures] = true response = make_request(:post, path, ) return if response.body.nil? Resources::MandateImportEntry.new(unenvelope_body(response.body), response) end |
#list(options = {}) ⇒ Object
For an existing mandate import, this endpoint lists all of the entries attached.
After a mandate import has been submitted, you can use this endpoint to associate records in your system (using the ‘record_identifier` that you provided when creating the mandate import).
Example URL: /mandate_import_entries
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/gocardless_pro/services/mandate_import_entries_service.rb', line 49 def list( = {}) path = '/mandate_import_entries' [:retry_failures] = true response = make_request(:get, path, ) ListResponse.new( response: response, unenveloped_body: unenvelope_body(response.body), resource_class: Resources::MandateImportEntry ) end |