Running Reports

This section explains how to use the AGMS Code Library's Report Class to pull reports and transaction details from various Reporting methods on the Gateway API.

Report Class Quick Example

<?php
/**
 * An example of a generating a basic Transaction Report using the AGMS PHP Library
 **/

// Include the library
require('AGMS/init.php');

// Set up the API connection
$rep = new \AGMS\Report();

// Configure the search parameters
$params = array(
            'start_date' => array('value' => '2014-09-24'),
            'end_date' => array('value' => '2015-11-09'),
        );

// Pull a list of transactions from the gateway
$report = $rep->listTransactions($params);

// Dump output for testing
var_dump($report);

?>
/**
 * An example of a generating a basic Transaction Report using the AGMS Ruby Library
 **/

// Include the library
require 'agms'

// Initialise the library configuration
Agms::Configuration.init('init.yml')

// Set up the API connection
rep = Agms::Report.new

// Configure the search parameters
params = {
    :start_date => { :value => '2015-01-01'},
    :end_date => { :value => '2015-03-28'}
}

// Pull a list of transactions from the gateway
report = rep.listTransactions(params)

// Dump output for testing
puts(report)
/**
 * An example of a generating a basic Transaction Report using the AGMS Python Library
 **/

// Include the library
import 'agms'

// Initialise the library configuration
agms.Configuration.init('init.init')

// Set up the API connection
rep = agms.Report()

// Configure the search parameters
params = {
    'start_date': {'value': '2015-03-25'},
    'end_date': {'value': '2015-03-31'},
}

// Pull a list of transactions from the gateway
report = rep.list_transactions(params)

// Dump output for testing
print(report)
                        
#ucase("Coldfusion example here")#

Report Class: Constructor

// AGMS Report Class Constructor
public array \AGMS\Report::__construct ( [ string $username [, $password [, $accountnumber [, $apikey ] ] ] ] )
// AGMS Report Class Constructor
Report::initialise ( [ string username [, password [, accountnumber [, apikey ] ] ] ] )
// AGMS Report Class Constructor
Report.__init__( self, [ string username [, password [, accountnumber [, apikey, [client] ] ] ] ] )

The Report Class can be instantiated with no parameters, or you can explicitly set the gateway credentials you would like to be used for that transaction. If no credentials are provided, the default credentials configured in init.php will be used.

Report Class: listTransactions Method

// AGMS Report Class listTransactions() method
public array \AGMS\Report::listTransactions ( array $parameters )
// AGMS Report Class listTransactions() method
Report::process ( Hash parameters )                        
// AGMS Report Class list_transactions() method
Report.process ( dict parameters )                        

The AGMS Report object's "listTransactions" method executes an API request to search for transactions using the provided parameters and list their details.

A full listing of the Request parameters is available in the Requests tab, and a full listing of Response parameters is available in the Responses tab.

The parameter array is a two dimensional array, with each field containing an array of its configuration values. For the purposes of the Report Class, each field will only have a "value" and no other options.

Request Fields

The following fields can be passed into the AGMS Report Class to query information.

listTransactions Search Parameters

Parameter Value Description
start_date YYYY-MM-DD Beginning of date range to search.
end_date YYYY-MM-DD End of date range to search.
amount Decimal Specific amount processed.
transaction_type sale
auth
capture
void
refund
update
adjustment
safe only
Type of transaction processed.
payment_type creditcard
check
safe_id Integer
processor_id Integer
transaction_id Integer
cc_last_4 Integer
first_name String
last_name String
company_name String
address String
city String
state String
zip String
country String
phone String
email String

Response Fields

listTransactions Response Fields

The following fields are returned in an array by the AGMS Report Class after calling the listTransactions method in every response.

Key Value Description
transaction_id Integer A unique ID generated by the gateway for this transaction. This should be stored in your system along with your local transaction record for future reconciliation with gateway records.
transaction_type String The type of transaction processed.
payment_type String The type of payment processed.
amount String The amount of the transaction processed.
response_code Integer 1 = APPROVAL
2 = DECLINE
10 = VALIDATION ERROR
20 = DATA ERROR OR SYSTEM ERROR
30 = EXCEPTION
response_message String Text description of the response_code.
response_transaction_id String Same as Transaction ID.
authorization_code Integer Transaction authorization code provided by the processor.
transaction_date String Date that the transaction was settled.
date_created String Date that the transaction was created.
date_last_modified String Date that the transaction was last edited.
created_by String Gateway user who created the transaction.
modified_by Integer Last gateway user to edit the transaction.
user_agent Integer User agent string from the program, app, website, or system used to submit the transaction.
card_present Boolean If True, the transaction was processed as a swiped card present transaction. If false, the transaction was keyed (or ecommerce).
card_type AMEX
Visa
MasterCard
Discover
Unknown

listTransactions Response: Optional Transaction Data Fields

The following fields are also returned when the transaction contains them. If a field was not populated for that transaction, it will not be included in the response.

Parameter Value Description
order_description String
order_id String
tip_amount Decimal
tax_amount Decimal
shipping_amount Decimal
po_number String
ip_address String As provided with the transaction submission.
cc_number 15-16 Digit Number Truncated to only show the first and last 4 digits.
cc_exp_date MMYY
safe_action add_safe
update_safe
delete_safe
safe_id Integer
first_name String
last_name String
company_name String
address String
address_2 String
city String
state String
zip String
country String
phone String
fax String
email String
website String
shipping_first_name String
shipping_last_name String
shipping_company_name String
shipping_address String
shipping_address_2 String
shipping_city String
shipping_state String
shipping_zip String
shipping_country String
shipping_email String
shipping_phone String
shipping_fax String
shipping_tracking_number String
shipping_carrier String
custom_field_1 String
custom_field_2 String
custom_field_3 String
custom_field_4 String
custom_field_5 String
custom_field_6 String
custom_field_7 String
custom_field_8 String
custom_field_9 String
custom_field_10 String

Frequently Asked Questions