Class: PayTrace::BatchOperations

Inherits:
Object
  • Object
show all
Defined in:
lib/paytrace/batch_operations.rb

Overview

This class serves as a container for batch processing methods

Constant Summary collapse

EXPORT_SINGLE_METHOD =
"ExportBatch"
EXPORT_MULTIPLE_METHOD =
"ExportBatches"
EXPORT_DETAILS_METHOD =
"ExportBatchDetails"

Class Method Summary collapse

Class Method Details

.exportDetails(params = {}) ⇒ Object

See help.paytrace.com/api-export-batch-details

Exports transaction details of a given batch. Required parameters hash:

  • :batch_number – number of the batch of transactions you wish to export



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/paytrace/batch_operations.rb', line 50

def self.exportDetails(params = {})
  request = PayTrace::API::Request.new
  request.set_param(:method, EXPORT_DETAILS_METHOD)
  request.set_param(:batch_number, params[:batch_number])

  gateway = PayTrace::API::Gateway.new
  response = gateway.send_request(request)      
  unless response.has_errors?
    response.values
  end
end

.exportMultiple(params = {}) ⇒ Object

See help.paytrace.com/api-export-batches

Exports summary information about multiple batches over a given date range. Required parameters:

  • :start_date – indicates when to start searching for transactions to export. Must be a valid date formatted as MM/DD/YYYY

  • :end_date – indicates when to end searching for transactions to export. Must be a valid date formatted as MM/DD/YYYY



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/paytrace/batch_operations.rb', line 33

def self.exportMultiple(params = {})
  request = PayTrace::API::Request.new
  request.set_param(:method, EXPORT_MULTIPLE_METHOD)
  request.set_params([:start_date, :end_date], params)

  gateway = PayTrace::API::Gateway.new
  response = gateway.send_request(request)      
  unless response.has_errors?
    response.values
  end
end

.exportSingle(params = {}) ⇒ Object

See help.paytrace.com/api-export-single-batch

Verifying batch details is sometimes necessary for your application to be able to determine deposit and transaction sums. The ExportBatch method is useful for extracting a summary of a specific batch or currently pending settlement break-down by card and transaction type.

Optional parameters hash:

  • :batch_number – number of the batch of transactions you wish to export



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/paytrace/batch_operations.rb', line 15

def self.exportSingle(params = {})
  request = PayTrace::API::Request.new
  request.set_param(:method, EXPORT_SINGLE_METHOD)
  request.set_param(:batch_number, params[:batch_number])

  gateway = PayTrace::API::Gateway.new
  response = gateway.send_request(request)      
  unless response.has_errors?
    response.values
  end
end