cancel
Showing results for 
Search instead for 
Did you mean: 

C# Sample code for GetTransactionList doesn't compile

The following code fragment from the sample code doesn't compile.

*****************

            var request = new getTransactionListRequest();
            request.batchId = batchId;
            request.paging = new Paging
            {
                limit = 10,
                offset = 1
            };
            request.sorting = new TransactionListSorting
            {
                orderBy = TransactionListOrderFieldEnum.id,
                orderDescending = true
            };

*************************

When I attempt to compile code on my computer I find that there is no paging attribute of the request object. Neither is there a sorting attribute. Am I doing something wrong?

mdc
Member
2 ACCEPTED SOLUTIONS

Accepted Solutions

Are you able to right click on and go to the definition of request.batchId ? Or just double click on the referenced AuthorizeNet.dll, under AuthorizeNet.Api.Contracts.V1.getTransactionListRequest, see what members are listed there. What version of the dll?

 

By the way, in this context your string batchid doesn't match the case of the batchId being passed to request.batchId; 

Powered by NexWebSites.com -
Certified Authorize.net developers

View solution in original post

NexusSoftware
Trusted Contributor

Problem solved by downloading the latest toolkit and using the enclosed AuthorizeNet.dll. Thanks.

View solution in original post

5 REPLIES 5

Are you referencing the AuthorizeNet.dll and

using AuthorizeNet.Api.Contracts.V1;

In AuthorizeNet.dll, namespace AuthorizeNet.Api.Contracts.V1, batchId and Sorting are declared: 

 public class getTransactionListRequest : ANetApiRequest
    {
       public string batchId;
      
        public TransactionListSorting sorting;
      
        public Paging paging;

        public getTransactionListRequest();
    }

 

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Yes. Here is the entire method...

 

using AuthorizeNet.Api.Contracts.V1;

using AuthorizeNet.Api.Controllers;

using AuthorizeNet.Api.Controllers.Bases;

using SRF.CRM.Integration.Payment.Model;

using System;

using System.Collections.Generic;

using System.Linq;

namespace SRF.CRM.Integration.Payment

{

public class Authorize_Net : IPaymentGateway

{

string ApiLoginID { get; set; }

string ApiTransactionKey { get; set; }

bool IsSandboxMode { get; set; }

public Authorize_Net(string pApiLoginID, string pApiTransactionKey, bool pIsSandboxMode)

{

ApiLoginID = pApiLoginID;

ApiTransactionKey = pApiTransactionKey;

IsSandboxMode = pIsSandboxMode;

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

}

public void GetTransactionList(string batchid)

{

ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = (IsSandboxMode) ? AuthorizeNet.Environment.SANDBOX : AuthorizeNet.Environment.PRODUCTION;

// define the merchant information (authentication / transaction id)

ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()

{

name = ApiLoginID,

ItemElementName = ItemChoiceType.transactionKey,

Item = ApiTransactionKey,

};

var request = new getTransactionListRequest();

request.batchId = batchId;

request.paging = new Paging

{

limit = 10,

offset = 1

};

request.sorting = new TransactionListSorting

{

orderBy = TransactionListOrderFieldEnum.id,

orderDescending = true

};

}

 

***********************************

I also verified that the request object is coming from AuthorizeNet.dll.

Are you able to right click on and go to the definition of request.batchId ? Or just double click on the referenced AuthorizeNet.dll, under AuthorizeNet.Api.Contracts.V1.getTransactionListRequest, see what members are listed there. What version of the dll?

 

By the way, in this context your string batchid doesn't match the case of the batchId being passed to request.batchId; 

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Thanks. I must have an outdated version of AuthorizeNet.dll.

Problem solved by downloading the latest toolkit and using the enclosed AuthorizeNet.dll. Thanks.