private void processResponse(PayPalAPIInterfaceServiceService service, GetTransactionDetailsResponseType response)
        {
            HttpContext CurrContext = HttpContext.Current;
            CurrContext.Items.Add("Response_apiName", "GetTransactionDetails");
            CurrContext.Items.Add("Response_redirectURL", null);
            CurrContext.Items.Add("Response_requestPayload", service.getLastRequest());
            CurrContext.Items.Add("Response_responsePayload", service.getLastResponse());

            Dictionary<string, string> keyResponseParameters = new Dictionary<string, string>();
            keyResponseParameters.Add("Correlation Id", response.CorrelationID);
            keyResponseParameters.Add("API Result", response.Ack.ToString());

            if (response.Ack.Equals(AckCodeType.FAILURE) ||
                (response.Errors != null && response.Errors.Count > 0))
            {
                CurrContext.Items.Add("Response_error", response.Errors);
            }
            else
            {
                CurrContext.Items.Add("Response_error", null);
                PaymentTransactionType transactionDetails = response.PaymentTransactionDetails;
                keyResponseParameters.Add("Payment receiver", transactionDetails.ReceiverInfo.Receiver);
                keyResponseParameters.Add("Payer", transactionDetails.PayerInfo.Payer);
                keyResponseParameters.Add("Payment date", transactionDetails.PaymentInfo.PaymentDate);
                keyResponseParameters.Add("Payment status", transactionDetails.PaymentInfo.PaymentStatus.ToString());
                keyResponseParameters.Add("Gross amount",
                    transactionDetails.PaymentInfo.GrossAmount.value + transactionDetails.PaymentInfo.GrossAmount.currencyID.ToString());

                if (transactionDetails.PaymentInfo.SettleAmount != null)
                {
                    keyResponseParameters.Add("Settlement amount",
                        transactionDetails.PaymentInfo.SettleAmount.value + transactionDetails.PaymentInfo.SettleAmount.currencyID.ToString());
                }
            }
            CurrContext.Items.Add("Response_keyResponseObject", keyResponseParameters);
            Server.Transfer("../APIResponse.aspx");
        }
    // # GetTransactionDetails API Operation
    // The GetTransactionDetails API operation obtains information about a specific transaction. 
    public GetTransactionDetailsResponseType GetTransactionDetailsAPIOperation()
    {
        // Create the GetTransactionDetailsResponseType object
        GetTransactionDetailsResponseType responseGetTransactionDetailsResponseType = new GetTransactionDetailsResponseType();

        try
        {
            // Create the GetTransactionDetailsReq object
            GetTransactionDetailsReq getTransactionDetails = new GetTransactionDetailsReq();
            GetTransactionDetailsRequestType getTransactionDetailsRequest = new GetTransactionDetailsRequestType();

            // Unique identifier of a transaction.
            // `Note:
            // The details for some kinds of transactions cannot be retrieved with
            // GetTransactionDetails. You cannot obtain details of bank transfer
            // withdrawals, for example.`
            getTransactionDetailsRequest.TransactionID = "5AT5731435011481X";
            getTransactionDetails.GetTransactionDetailsRequest = getTransactionDetailsRequest;

            // Create the service wrapper object to make the API call
            PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();

            // # API call
            // Invoke the GetTransactionDetails method in service wrapper object
            responseGetTransactionDetailsResponseType = service.GetTransactionDetails(getTransactionDetails);

            if (responseGetTransactionDetailsResponseType != null)
            {
                // Response envelope acknowledgement
                string acknowledgement = "GetTransactionDetails API Operation - ";
                acknowledgement += responseGetTransactionDetailsResponseType.Ack.ToString();
                logger.Info(acknowledgement + "\n");
                Console.WriteLine(acknowledgement + "\n");

                // # Success values
                if (responseGetTransactionDetailsResponseType.Ack.ToString().Trim().ToUpper().Equals("SUCCESS"))
                {
                    // Unique PayPal Customer Account identification number
                    logger.Info("Payer ID : " + responseGetTransactionDetailsResponseType.PaymentTransactionDetails.PayerInfo.PayerID + "\n");
                    Console.WriteLine("Payer ID : " + responseGetTransactionDetailsResponseType.PaymentTransactionDetails.PayerInfo.PayerID + "\n");

                }
                // # Error Values             
                else
                {
                    List<ErrorType> errorMessages = responseGetTransactionDetailsResponseType.Errors;
                    foreach (ErrorType error in errorMessages)
                    {
                        logger.Debug("API Error Message : " + error.LongMessage);
                        Console.WriteLine("API Error Message : " + error.LongMessage + "\n");
                    }
                }
            }
        }
        // # Exception log    
        catch (System.Exception ex)
        {
            // Log the exception message       
            logger.Debug("Error Message : " + ex.Message);
            Console.WriteLine("Error Message : " + ex.Message);
        }
        return responseGetTransactionDetailsResponseType;
    }