PayTabs SDK makes the integration with the PayTabs payment gateway very easy by providing a ready-made payment screen that handles the card entry, and billing & shipping information and completes the missing details.


If you have a transaction that you want to fetch its details and know more about its status, type, etc... you can use the method queryTransaction to get the details of the requested transaction. In this article, we walk you through how to do that.


  1. First, create PaymentSDKQueryConfiguration and fill it out with your credentials and transaction reference. To know more about what is the exact values that should be passed here, please check our 2.1.1 Native IOS SDK | Configuration Options & Parameters solution article. 
      let config = PaymentSDKQueryConfiguration(serverKey: "*ServerKey*",
                                                  clientKey: "*ClientKey*",
                                                  merchantCountryCode: "*CountryCode*",
                                                  profileID: "*ProfileId*",
                    transactionReference: "*TransactionReference*")


  2. Only then you will be ready to start/initiate the query transaction by passing the PaymentSDKQueryConfiguration object along with the current CallbackPaymentInterface inherited activity/fragment instance -in which you will handle the payment response- to the queryTransaction function to get the transaction full details. To know more about this please check our Step 5 - Native Android SDK | Handle the payment response solution article.

    QuerySdkActivity.queryTransaction(
        this,
        queryConfig,
        this
    )


For the best practice , we highly recomment you to rely on the IPNs and callbacka to get the status of your transactions(server-to-server integartion).


Through out the article we will use the transaction types clarified in our What is "tran_type"? solution article.









⌂ To get familiar with the whole process and the other steps, kindly navigate to our "The Native Android SDK Integration Manual" solution article. 

 And to navigate to the previous step in the integration process " Step 6 - Handle the post-payment responses (notifications)" kindly click here.