Skip to content

    Query call

    This page introduces the Query call, an essential API function that allows you to retrieve transaction information, including payment method and transaction status, ensuring effective payment processing.

    Overview

    With the Query call, you can retrieve transaction data, including the payment method specifics and transaction status. The actions you can perform for processing payments depend on the selected payment method by the customer. For instance, certain calls like Process(AUTH), Process(CAPTURE), and Process(SALE) cannot be executed for direct bank payments as Netaxept triggers AutoSale for these transactions.

    To ensure you are working with the correct payment method, integration of the Query call into your payment flow is essential.

    The Query call offers valuable support in the following scenarios:

    • Discovering the payment method: If you are uncertain about the payment method your customer used after the Register and Terminal phases, use the Query call to identify the payment method. This information will help you determine the necessary next steps in the transaction process.

    • Handling errors: If you get an error during the checkout process, use the Query call to get all the information you need to handle the error correctly.

    • Verifying payment success: If you are unsure whether a customer's payment was successful, you can use the Query call to confirm the transaction status. We recommend performing this check before fulfilling the customer's order.

    • Saving card details: Once you've saved the customer's card information for future payments, then proceed with the Query call on the initial transaction to retrieve the panHash (token) parameter. Store this panHash (token) on the customer's profile for future purchases.

    In addition to utilizing the Query call, we strongly advise implementing the Callback function, particularly when dealing with direct bank payments and wallets. The Callback function offers you several benefits. It ensures that Netaxept automatically notifies you whenever there's a change in the transaction status. This automated process enhances efficiency and provides real-time updates. When you receive a Callback, it should always be followed by the Query call for comprehensive transaction handling. You may read more about Callback here.

    Specify Query call parameters for optimal performance

    To enhance the performance of your Query call, it is crucial to define its content before execution. This proactive step helps reduce response times and enhances overall performance.

    The Query call can provide you with all sorts of information about a payment. To get the specific information you need, include the corresponding parameters in your query. If you don't specify any parameters, the Query call will return all available information, which can result in longer response times. To get the best performance, we strongly recommend using the Query call with only the specific parameters you need.

    For optimal performance and efficiency, we highly recommend specifying only the parameters you need in the Query call.

    The setup:

    • For the Query call, specify the parameters you want to retrieve by adding &”PARAMETER”=true for each desired parameter. You can include as many parameters as needed.

    • Refer to the API reference to identify the parameters that can be included in the Query call.

    Below is an example of how to perform a Query call with specific parameters.

    Query call with specific response parameters

    Query call example (line breaks for better readability)

    Query call example

    merchantId=[MERCHANTID]&
      token=[TOKEN]&
      transactionId=2e5029b36e394ba39757fbbea6dd1908&
      CardInformation=true

    Query call response example

    Query call response example

    <PaymentInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <MerchantId>[MERCHANTID]</MerchantId>
    <QueryFinished>2023-10-16T15:06:08.2803098+02:00</QueryFinished>
    <TransactionId>2e5029b36e394ba39757fbbea6dd1908</TransactionId>

    Exceptions and response codes

    When communication problems arise between your system and Netaxept, or disruptions occur during the payment process, Netaxept will decline the transaction and send back an exception as a response. These exceptions are organized within an outer Exception tag, which contains an Error tag. The Error tag, identified by its type (xsi:type), specifies the nature of the exception. Typically, an exception includes an error code that pinpoints the specific issue, along with a corresponding error message that explains the code. Below are the potential exceptions that the Query call may trigger.

    • AuthenticationException - Indicates that your credentials are missing or incorrect.

    • QueryException - Occurs when the Query service cannot fulfil your request.

    For more information, please visit the exceptions and response codes sections of the API reference page.

    Was this helpful?

    What was your feeling about it?