Terminal-2 icon

Get transaction data from tx_store_report - C

Implement the callback

Implement the tx_store_query_CB callback based on the signature in the tx_store_report_extern.h file and  pass this as a parameter of the tx_store_query call. For more information on how to do this, see Implement callbacks.

Code example

void tx_store_query_CB(tx_store_query_response *p, void *echo_struct)

Allocate the request structure

Use tx_store_query_allocate to allocate, initialize and return a tx_store_query_request structure. Populate the request by performing string duplication.

If you want the data for later use, retain it, or it will be released automatically

Call the tx_store_query function

Use the tx_store_query function to retrieve the tx_store_report, which contains results from past transactions.

Parameters

Name

Type

Required

Description

tx_store_query_request

struct

-white_check_mark-

Struct that contains specific elements to retrieve a tx_store_report. For parameters and more information, see the tx_store_query_request page

tx_store_query_CB

void

-white_check_mark-

Pointer to a callback function you implemented which includes the tx_store_query_response.

echo_struct

struct

-white_check_mark-

A POS-defined struct that is echoed back in the callback. Use this to share a POS data struct between the call to the library and the callback from the library. You can add any pointer to echo_struct, and this will be returned on its specific callback.

Handle the callback

The tx_store_query callback returns a response which includes the  tx_store_report.

Parameters

NameDescription

tx_store_query_response

The immediate response to the tx_store_query call, which includes the result of the call. This includes the  tx_store_report object.

echo_struct

A pointer to a user-defined struct that is echoed back in the callback. Use this to share a POS data struct between the call to the library and the callback from the library.

A pspReference and authCode will not be visible if the transaction was performed offline.