I'm trying to get the status of a subscription using the .NET SDK and I'm getting the following error message on my controller:
E00059:The authentication type is not allowed for this method call.
This is the code I'm using:
var authorizeLoginId = ConfigurationManager.AppSettings["authorizeLoginId"];
var authorizeTransactionKey = ConfigurationManager.AppSettings["authorizeTransactionKey"];
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()
{
name = authorizeLoginId,
ItemElementName = ItemChoiceType.transactionKey,
Item = authorizeTransactionKey,
};
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
var request = new ARBGetSubscriptionStatusRequest { subscriptionId = subscriptionId };
var controller = new ARBGetSubscriptionStatusController(request); // instantiate the contoller that will call the service
controller.Execute();
if (controller.GetResultCode() == messageTypeEnum.Error)
{
telemetry.TrackTrace("Error getting subscription status: " + subscriptionId, Microsoft.ApplicationInsights.DataContracts.SeverityLevel.Error, controller.GetResults().Select((x, i) => new { Item = x, Index = i }).ToDictionary(x => x.Item, x => "Message" + x.Index));
return null;
}Any thoughts?
Solved! Go to Solution.
08-19-2016 09:54 PM
D'oh! I was using the prod key in the sandbox! Make sure to use the right key!
08-20-2016 11:52 AM
Are you using the API Login with the transaction key? You cannot use a user's Login ID.
Richard
08-20-2016 07:11 AM
I basically copied the example code from the GitHub repo here:
What should I be using?
08-20-2016 08:10 AM
D'oh! I was using the prod key in the sandbox! Make sure to use the right key!
08-20-2016 11:52 AM