Method: AuthorizeNet::Reporting::Transaction#get_settled_batch_list

Defined in:
lib/authorize_net/reporting/transaction.rb

#get_settled_batch_list(from_date = nil, to_date = nil, include_stats = false) ⇒ Object

Sets up and submits a getSettledBatchListRequest transaction. If this transaction has already been run, this method will return nil. Otherwise it will return an AuthorizeNet::Reporting::Response object. The response object will have an array of Batch objects available via its batch_list method if the request was successful.

from_date

Takes either a DateTime or a String representing a date and time. Only settled batches >= this value will be returned. Defaults to nil (which returns >= 24hrs ago). A to_date must be specified if a from_date is.

to_date

Takes either a DateTime or a String representing a date and time. Only settled batches <= this value will be returned. Defaults to nil. The maximum date range is 31 days, and a from_date must be supplied if a to_date is.

include_stats

Takes a Boolean. Determines if BatchStatistics should be returned with the Batch objects. Defaults to false.

Typical usage:

response = transaction.get_settled_batch_list(DateTime.now() - (1 * 3600 * 48), DateTime.now(), true)
batches = response.batch_list if response.success?


46
47
48
49
50
# File 'lib/authorize_net/reporting/transaction.rb', line 46

def get_settled_batch_list(from_date = nil, to_date = nil, include_stats = false)
  @type = Type::REPORT_GET_BATCH_LIST
  set_fields({:first_settlement_date => from_date, :last_settlement_date => to_date, :include_statistics => include_stats})
  make_request
end