sdk-dotnet icon indicating copy to clipboard operation
sdk-dotnet copied to clipboard

Authorize.NET Pull Sales by Number

Open jmawebtech opened this issue 5 years ago • 0 comments

Hi,

My goal is to pull a transactionDetailsSummaryType using the transactionDetailsType Id. I want to pull orders by number, instead of date. Is this possible? What is the relationship between these two objects? Here is my code:

` public transactionSummaryType GetTransactionByRefId(string refId) { var request = new getTransactionListRequest(); request.merchantAuthentication = GetMerchantAuthentication(); request.refId = refId;

        // instantiate the controller that will call the service
        var controller = new getTransactionListController(request);
        controller.Execute();

        // get the response from the service (errors contained if any)
        var response = controller.GetApiResponse();

        if (response == null || response.transactions == null)
            return null;
        else
            return response.transactions.FirstOrDefault();
    }

`

` public transactionDetailsType GetTransactionDetails(string transactionId) { var request = new getTransactionDetailsRequest(); request.transId = transactionId; request.merchantAuthentication = GetMerchantAuthentication();

        // instantiate the controller that will call the service
        var controller = new getTransactionDetailsController(request);
        controller.Execute();

        // get the response from the service (errors contained if any)
        var response = controller.GetApiResponse();

        if (response != null && response.messages.resultCode == messageTypeEnum.Ok)
        {
            return response.transaction;
        }
        else if (response != null)
        {
            Console.WriteLine("Error: " + response.messages.message[0].code + "  " +
                              response.messages.message[0].text);
        }

        return null;
    }

`

jmawebtech avatar Oct 29 '19 20:10 jmawebtech