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.
           
    var configuration = new cordova.plugins.CordovaPaymentPlugin.PaymentSdkConfigurationDetails(
        "ServerKey",
        "ClientKey",
        "Country Iso 2",
        "Profile Id",
        "Transaction Reference"
    );


  2. Then call cordova.plugins.CordovaPaymentPlugin.queryTransaction function and pass the needed argument via the PaymentSDKQueryConfiguration  to get the transaction full details. To know more about this please check our 2.1.2 Native IOS SDK | Delegates, and Step 5 - Native IOS SDK | Handle the payment response solution articles.
          

    PaymentManager.queryTransaction(queryConfiguration: config) { transactionDetails, error in
                if let tranDet = transactionDetails {
                    //handle transcation details
                } else if let err = error {
                    //handle error
                }
            }


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


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 Cordova 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.