We have authorize.net set up to accept payments, and that's working great. Now I want to add in a simply "get subscription details" request, but whatever I do I'm getting this error:
E00003 The element 'ARBGetSubscriptionListRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'clientId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
Here's the exact code:
// Create a merchantAuthenticationType object $merchantAuthentication = new AnetAPI\MerchantAuthenticationType(); $merchantAuthentication->setName($processorKey1']); $merchantAuthentication->setTransactionKey($processorKey2']); // Set the transaction's refId $refId = 'ref' . time(); $sorting = new AnetAPI\ARBGetSubscriptionListSortingType(); $sorting->setOrderBy('id'); $sorting->setOrderDescending(false); $paging = new AnetAPI\PagingType(); $paging->setLimit('1000'); $paging->setOffset('1'); $request = new AnetAPI\ARBGetSubscriptionListRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setRefId($refId); $request->setSearchType('subscriptionActive'); $request->setSorting($sorting); $request->setPaging($paging); $controller = new AnetController\ARBGetSubscriptionListController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION);
I've read other comments here and tried adding:
$request->setClientId(null);
but that's not making any difference, it's still returning the same error. We can process transactions just fine, it's only when we try and retrieve any list of subscriptions, or subscription status etc, that we're getting this error.
Any ideas?
Thanks for your help!
Solved! Go to Solution.
12-23-2019 04:18 PM
I found the problem, it was actually caused by providing incorrect login details. The $processorKey1 and $processorKey2 values were wrong. I don't know why it then gave this strange missing clientId message, but correcting those fixed it and it's now working fine.
In case anyone else is facing a similar issue, I actually found the problem by sending a JSON request via Curl instead of using the PHP SDK — the json request gave the correct error message and that helped me find the problem :)
12-26-2019 12:22 PM
I found the problem, it was actually caused by providing incorrect login details. The $processorKey1 and $processorKey2 values were wrong. I don't know why it then gave this strange missing clientId message, but correcting those fixed it and it's now working fine.
In case anyone else is facing a similar issue, I actually found the problem by sending a JSON request via Curl instead of using the PHP SDK — the json request gave the correct error message and that helped me find the problem :)
12-26-2019 12:22 PM