Module: Vindi::Rest::ImportBatch

Included in:
Vindi::Rest
Defined in:
lib/vindi/rest/import_batch.rb

Overview

Methods for the Import Batch API

Instance Method Summary collapse

Instance Method Details

#create_import_batch(options = {}) ⇒ Hash

Create a import_batch for a merchant vindi

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :options (Hash)

    import_batch attributes

Returns:

  • (Hash)

    The import_batch created

See Also:



33
34
35
# File 'lib/vindi/rest/import_batch.rb', line 33

def create_import_batch(options = {})
  post('import_batches', options)[:import_batch]
end

#import_batch(import_batch_id, options = {}) ⇒ Hash

Get a single import_batch from a merchant

Examples:

Get import_batch #2 from vindi

client.import_batch(2)

Parameters:

  • import_batch_id (Integer)

    ID of the import_batch

Returns:

  • (Hash)

    The import_batch you requested, if it exists

See Also:



24
25
26
# File 'lib/vindi/rest/import_batch.rb', line 24

def import_batch(import_batch_id, options = {})
  get("import_batches/#{import_batch_id}", options)[:import_batch]
end

#list_import_batches(options = {}) ⇒ Array<Hash>

List import_batches for the authenticate user

Examples:

Get all import_batches from merchant vindi

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :page (Integer) — default: 1

    Page number.

  • :merchant (Integer)

    Merchant account

Returns:

  • (Array<Hash>)

    A list of imported batches for a merchant.



13
14
15
# File 'lib/vindi/rest/import_batch.rb', line 13

def list_import_batches(options = {})
  get('import_batches', options)[:import_batches]
end