ReportManager

public class ReportManager

Requests various types of reports and other status information. Allows closure of the current reporting period, querying of the reporting capabilities of the terminal, and settlement/reconciliation with the host/acquirer(s). Please note that the events for these methods are sent to general listeners, as these commands are sent outside of the context of a session.

Fields

ACQUIRER_RECONCILIATION_CAPABILITY

public static final String ACQUIRER_RECONCILIATION_CAPABILITY

If capable, this can ask the terminal to initiate a settlement between the host and acquirer, or the terminal and acquirer.

CLOSE_PERIOD_AND_RECONCILE_CAPABILITY

public static final String CLOSE_PERIOD_AND_RECONCILE_CAPABILITY

If capable, this can close current period and reconcile when calling closePeriodAndReconcile().

CLOSE_PERIOD_CAPABILITY

public static final String CLOSE_PERIOD_CAPABILITY

If capable, the terminal tracks reporting periods and allows closing of the current period.

GET_ACTIVE_TOTALS_CAPABILITY

public static final String GET_ACTIVE_TOTALS_CAPABILITY

If capable, the terminal can provide back the report when calling getActiveTotals().

GET_GROUP_TOTALS_CAPABILITY

public static final String GET_GROUP_TOTALS_CAPABILITY

If capable, the terminal can provide back the report when calling getTotalsForGroup().

GET_PREVIOUS_RECONCILIATION_CAPABILITY

public static final String GET_PREVIOUS_RECONCILIATION_CAPABILITY

If capable, this will allow you to get previous reconciliation when calling getPreviousReconciliation(String).

PREVIOUS_RECONCILIATION_CAPABILITY

public static final String PREVIOUS_RECONCILIATION_CAPABILITY

If capable, this can recover the results of a previous reconciliation.

RECONCILIATION_LIST_CAPABILITY

public static final String RECONCILIATION_LIST_CAPABILITY

If capable, the terminal can provide a list of reconciliations when calling getReconciliationsList().

RECONCILIATION_REPORT_CAPABILITY

public static final String RECONCILIATION_REPORT_CAPABILITY

If capable, the terminal can provide a reconciliations report which is requested by the POS when calling loginWithCredentials().

TERMINAL_RECONCILIATION_CAPABILITY

public static final String TERMINAL_RECONCILIATION_CAPABILITY

If capable, this can request a report from the terminal to allow synchronizing report information.

TOTALS_GROUP_ID_CAPABILITY

public static final String TOTALS_GROUP_ID_CAPABILITY

If capable, the terminal can provide back the totals for a specific groupID when calling getTotalsForGroup().

TRANSACTION_QUERY_CAPABILITY

public static final String TRANSACTION_QUERY_CAPABILITY

If capable, this can query transactions when calling queryTransactions(TransactionQuery).

Methods

closePeriod

public Status closePeriod()

When the terminal tracks reporting periods, this closes the current period and fires a ReconciliationEvent containing a report for the closed period to general listeners.

Return:

The success/failure for sending the command.

closePeriodAndReconcile

public Status closePeriodAndReconcile(ArrayList<Integer> acquirers)

When the terminal tracks reporting periods, this closes the current period on the terminal, triggers reconciliation with the acquirer(s), and fires a ReconciliationEvent containing a report for the closed period.

Parameters:
  • acquirers – An optional array of the specific acquirer IDs with which to reconcile, or null if the terminal should attempt to reconcile with all.

Return:

The success/failure for sending the command. Registered listeners will receive the actual result.

getActiveTotals

public Status getActiveTotals()

Provides the transactions totals realised since the beginning of the current reconciliation period until the reception of this request. This is also called a pre-settlement report. Fires a ReconciliationEvent with type ReconciliationEvent.ACTIVE_TOTALS_TYPE to the listener. The current reconciliation period is never closed by this message, please use closePeriod(), closePeriodAndReconcile(), or closePeriodAndReconcile(int[]) to close the period.

getPreviousReconciliation

public Status getPreviousReconciliation(String reconciliationId)

Resends the ReconciliationEvent for a previous reconciliation. This event will include an unsuccessful status if the reconciliation ID was not valid or could not be retrieved.

Parameters:
  • reconciliationId – The ID of the previous reconciliation that should be recovered.

Return:

The success/failure for sending the command. Registered listeners will receive the actual result.

getReconciliationsList

public Status getReconciliationsList()

Retrieves a list of reconciliations that have either already been performed or are currently pending. Fires a ReconciliationsListEvent to the listener containing the results. This is particularly useful when the terminal or the host automatically performs reconciliation with the acquirer. This is also useful in combination with getPreviousReconciliation(String), to first query all of the reconciliations and then to get the report for a specific reconciliation.

Return:

The success/failure for sending the command. The registered listener will receive the actual result.

getTotalsForGroup

public Status getTotalsForGroup(String groupId)

Provides the transactions totals for a specific Totals Group ID, as specified on the payment object. When getTotalsForGroup is called with a null group ID, the most recent group ID is used by default, and if there is no recent group ID, then an error is returned. Fires a ReconciliationEvent with type ReconciliationEvent.GROUP_TOTALS_TYPE to the listener.

isCapable

public boolean isCapable(String capability)

Checks if the current terminal interface allows handling of a specific command, as itemized below. Returns true if the interface can handle the command, or false if not. The following are the commands whose capabilities may be checked via this command: GET_ACTIVE_TOTALS_CAPABILITY, GET_GROUP_TOTALS_CAPABILITY, CLOSE_PERIOD_CAPABILITY, TERMINAL_RECONCILIATION_CAPABILITY, ACQUIRER_RECONCILIATION_CAPABILITY, PREVIOUS_RECONCILIATION_CAPABILITY, TRANSACTION_QUERY_CAPABILITY, TRANSACTION_QUERY_BY_PAYMENT_CAPABILITY, TRANSACTION_QUERY_FILTER_FIELDS_CAPABILITY, TRANSACTION_QUERY_PAYMENT_ID_BOUNDS_CAPABILITY, TOTALS_GROUP_ID_CAPABILITY, CLOSE_PERIOD_AND_RECONCILE_CAPABILITY, GET_PREVIOUS_RECONCILIATION_CAPABILITY, RECONCILIATION_LIST_CAPABILITY, RECONCILIATION_REPORT_CAPABILITY.

queryTransactions

public Status queryTransactions(TransactionQuery query)

Performs the query, firing a TransactionQueryEvent once the query is complete. This can be performed outside of the context of a session. Returns the success/failure for sending the command. Registered listeners will receive the actual result.

reconcileWithAcquirers

public Status reconcileWithAcquirers(ArrayList<Integer> acquirers)

Reconciles the terminal or host with the acquirer(s). Fires a ReconciliationEvent to the listener, containing the success or failure of the synchronization, but this does not necessarily include specific period information, only if the reconciliation was successfully communicated to the host / acquirer(s).

Parameters:
  • acquirers – An optional array of the specific acquirer IDs with which to reconcile, or null if the terminal should attempt to reconcile with all.

Return:

The success/failure for sending the command. Registered listeners will receive the actual result.