This is the endpoint listener script:
URL: http://wwvr5.wwwebweavers.com/jomres/remote_plugins/jomres_gateway_authorize/notify.php
the endpoint script just does this:
$path=dirname(realpath(__FILE__));
$f=fopen($path.'/log.txt','a+');
fputs($f,print_r($_REQUEST,1));
fclose($f);
echo "OK";
die();
it gets the post data from auth.net and writes it to a file named log.txt which is empty after successful transactions on A.net:
http://wwvr5.wwwebweavers.com/jomres/remote_plugins/jomres_gateway_authorize/log.txt
We program in php. Our website is on:http://wwvr5.wwwebweavers.com/index.php?lang=en
07-11-2019 07:57 AM - edited 07-11-2019 08:09 AM
07-11-2019 08:57 AM
ts will also be written to the log file.
for me, neither sandbox or live account workingin live mode,will trigger the webhook.
What do I have to do to get it to trigger!!
07-11-2019 09:18 AM
07-11-2019 11:59 AM
But this is the problem.
The webhook is not firing.
any hit to my webhook, will update the log file it creates.
The timestamp on the file doesn't even change.
But I'll check it again.
07-11-2019 05:10 PM
test results.
Environment: Sandbox live mode.
Webhook Listener Contents:
<?php
$headers = getallheaders();
$payload = file_get_contents("php://input");
$path=dirname(realpath(__FILE__));
$f=fopen($path.'/notify.log','a+');
fputs($f,print_r($payload,1));
fputs($f,print_r("<br />",1));
fclose($f);
?>
The webhook was NOT triggered.
Even if the info posted to me was empty, the log file would be created.
It was not.
This is the exact same problem that I have in the live account.
07-11-2019 05:25 PM
finally got the webhook to post and captured.
last problem I hope,,....
how do I pass my sites orderID to the GetHostedPaymentPageRequest so that the webhook wil post it back to me?
if you can't post any custom field from the site back via the webhook, then there is no way to identify what order the webhook is for as the URL for the webhook is set in the merchant account.
07-12-2019 06:16 AM
Looks like my advice worked for you. The answer to your question is to pass that as the invoice number in the API call and then retrieve it when you get the webhook. You also want to implement the hash verification piece once you get everything working.
07-12-2019 10:08 AM
invoice number is too short,so I have to store it in a dbase table and so on....
what a pain.
however, I've done that now. and I'm trying to do a details lookup and I'm getting this error now.
Here is the code:
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
$merchantAuthentication->setName($settingArray['loginid']);
$merchantAuthentication->setTransactionKey($settingArray['transactionid']);
// Set the transaction's refId
// The refId is a Merchant-assigned reference ID for the request.
// If included in the request, this value is included in the response.
// This feature might be especially useful for multi-threaded applications.
$refId = 'ref' . time();
$request = new AnetAPI\GetTransactionDetailsRequest();
$request->setMerchantAuthentication($merchantAuthentication);
$request->setTransId($transactionId);
$controller = new AnetController\GetTransactionDetailsController($request);
$response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);
And this is the error:
net\authorize\api\contract\v1\GetTransactionDetailsResponse Object
(
[transaction:net\authorize\api\contract\v1\GetTransactionDetailsResponse:private] =>
[clientId:net\authorize\api\contract\v1\GetTransactionDetailsResponse:private] =>
[transrefId:net\authorize\api\contract\v1\GetTransactionDetailsResponse:private] =>
[refId:net\authorize\api\contract\v1\ANetApiResponseType:private] =>
[messages:net\authorize\api\contract\v1\ANetApiResponseType:private] => net\authorize\api\contract\v1\MessagesType Object
(
[resultCode:net\authorize\api\contract\v1\MessagesType:private] => Error
[message:net\authorize\api\contract\v1\MessagesType:private] => Array
(
[0] => net\authorize\api\contract\v1\MessagesType\MessageAType Object
(
[code:net\authorize\api\contract\v1\MessagesType\MessageAType:private] => E00003
[text:net\authorize\api\contract\v1\MessagesType\MessageAType:private] => The element 'getTransactionDetailsRequest' 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'.
)
)
)
[sessionToken:net\authorize\api\contract\v1\ANetApiResponseType:private] =>
)
07-12-2019 12:08 PM
07-12-2019 12:33 PM