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?
Solved! Go to Solution.
07-20-2017 08:40 AM
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;
07-20-2017 11:35 AM - edited 07-20-2017 11:36 AM
Problem solved by downloading the latest toolkit and using the enclosed AuthorizeNet.dll. Thanks.
07-21-2017 01:56 PM
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(); }
07-20-2017 10:33 AM - edited 07-20-2017 10:47 AM
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.
07-20-2017 10:57 AM
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;
07-20-2017 11:35 AM - edited 07-20-2017 11:36 AM
Thanks. I must have an outdated version of AuthorizeNet.dll.
07-20-2017 02:14 PM
Problem solved by downloading the latest toolkit and using the enclosed AuthorizeNet.dll. Thanks.
07-21-2017 01:56 PM