cancel
Showing results for 
Search instead for 
Did you mean: 

E00059:The authentication type is not allowed for this method call. Getting Subscription Status

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?

joe_coolish
Member
1 ACCEPTED SOLUTION

Accepted Solutions

D'oh!  I was using the prod key in the sandbox!  Make sure to use the right key!

View solution in original post

3 REPLIES 3

@joe_coolish

 

Are you using the API Login with the transaction key?  You cannot use a user's Login ID.

 

Richard

RichardH
Administrator Administrator
Administrator

I basically copied the example code from the GitHub repo here:

 

https://github.com/AuthorizeNet/sample-code-csharp/blob/master/RecurringBilling/GetSubscriptionStatu...

 

What should I be using?

D'oh!  I was using the prod key in the sandbox!  Make sure to use the right key!