-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get Customer Profile with merchantCustomerID #405
Comments
I am trying the same query using the PHP SDK, but this time it returns {
"messages": {
"resultCode": "Error",
"message": [
{
"code": "E00040",
"text": "The record cannot be found."
}
]
}
} Here is an example of the request I am making. Not sure what is wrong: <?php
use net\authorize\api\contract\v1 as AnetAPI;
use net\authorize\api\contract\v1\GetCustomerProfileIdsResponse;
use net\authorize\api\controller as AnetController;
use net\authorize\util\LogFactory;
// ...
$tmpFullLogFilePath = $this->generateTemporaryLogFilePath();
$logger = LogFactory::getLog(get_class($this));
$logger->setLogFile($tmpFullLogFilePath);
$merchantAuthentication = $this->getAuthenticator();
$request = new AnetAPI\GetCustomerProfileRequest();
$request->setMerchantAuthentication($merchantAuthentication);
$request->setMerchantCustomerId($merchantId); // <----- Use the merchantCustomerID instead of the customerProfileId
$controller = new AnetController\GetCustomerProfileController($request);
/** @var AnetAPI\GetCustomerProfileResponse $response */
$response = $controller->executeWithApiResponse($this->getEndpoint());
$result = $this->evaluateAuthorizeNetResponse($response);
if ($result->isError()) {
dump(file_get_contents($tmpFullLogFilePath));
return $result;
} The log captures the following contents:
One of the last lines of the log shows the JSON request body. If I use that exact request body through Postman, it works: Thanks. |
Initially I thought the issue was due to the Authorize.net API having an issue when invoked through the PHP SDK. But it seems the actual issue is that,. right after creating an Authorize.net Customer record including a custom, Merchant ID, it is not possible to immediately get that customer record from Authorize.net through the API when searching by Merchant ID. It seems their service require some time (a few seconds at least) to allow this search mechanism. |
I believe this has been a known issue for years. I recall raising it when trying to use the CreateSubscriptionFromCustomerProfile example in the SDK. If you literally insert a 2-3 second wait() in the code it will then be available. It's obviously a backend limitation they have been unable or unwilling to resolve to date. |
I'm trying the API using this endpoint https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile and in the Request Field information I see that I can send merchantCustomerId, but every time I tried it always return the error
Failed to get customer profile information with id None
The text was updated successfully, but these errors were encountered: