Before asking this question, I have read all the existing questions about "pagseguro notifications".
In SANDBOX, I'm not receiving notifications of the transactions.
I'm testing on a valid domain, hosted on a VM, Linux Ubuntu 14.04, on locaweb.
My notification url has an SSL certificate, Version 3, issued by "COMODO RSA Domain Validation Secure Server CA", with algorithm "Encryption PKCS # 1 SHA-256 with RSA".
I've typed in the APACHE error log: : "NOTIFICATION IS ACTION!", right on the first line of my notifications file, in PHP, which should be called called, every change notification of Transaction Status, as per the code snippet below.
<?php
error_log('NOTIFICACAO ACIONADA!');
$http_origin = $_SERVER['HTTP_ORIGIN'];
$array_origens_permitidas[] = 'https://pagseguro.uol.com.br';
$array_origens_permitidas[] = 'https://ws.pagseguro.uol.com.br';
$array_origens_permitidas[] = 'https://stc.pagseguro.uol.com.br';
$array_origens_permitidas[] = 'https://sandbox.pagseguro.uol.com.br';
$array_origens_permitidas[] = 'https://ws.sandbox.pagseguro.uol.com.br';
$array_origens_permitidas[] = 'https://stc.sandbox.pagseguro.uol.com.br';
if (in_array($http_origin, $array_origens_permitidas)){
header("Access-Control-Allow-Origin: $http_origin");
}
I've also tried using:
$request_headers = apache_request_headers();
$http_origin = $request_headers['Origin'];
Instead of:
$http_origin = $_SERVER['HTTP_ORIGIN'];
Below are modules installed in apache, listed with print_r(apache_get_modules());
Array ( [0] => core [1] => mod_so [2] => mod_watchdog [3] => http_core [4] => mod_log_config [5] => mod_logio [6] => mod_version [7] => mod_unixd [8] => mod_access_compat [9] => mod_alias [10] => mod_auth_basic [11] => mod_authn_core [12] => mod_authn_file [13] => mod_authz_core [14] => mod_authz_host [15] => mod_authz_user [16] => mod_autoindex [17] => mod_cache [18] => mod_deflate [19] => mod_dir [20] => mod_env [21] => mod_expires [22] => mod_file_cache [23] => mod_filter [24] => mod_headers [25] => mod_mime [26] => prefork [27] => mod_negotiation [28] => mod_php5 [29] => mod_setenvif [30] => mod_socache_shmcb [31] => mod_ssl [32] => mod_status )
Clicking the "Resend Notification" button displays the error: "The notification could not be resent." and NOTHING is written in the APACHE log.
Clicking "View log" will display the notification URL and the message: "The notification has not been sent, check the notification URL and start a new transaction." and NOTHING is written in the APACHE log.
When copying and pasting the URL of the notification into a browser, the message "NOTIFICATION ACTIONED!" appears in the APACHE log.
The notification url is being defined through the SANDBOX configuration screen, in the "Test Seller" area, field: "Set URL to receive notifications:".
In addition, I also send the notification url in the payment POST via cURL as "notificationURL".
No firewall log (IPTABLES).
Once, nothing is registered in the APACHE log by clicking the "Resend notification" button, but when I type the URL directly in the BROWSER the access is registered in the APACHE LOG.
Strange that: When you click " Resend local notification ", notification is sent and everything works correctly. Being the data hosted on a WEB server, with public IP and valid URL.
It seems that for some reason PAGSEGURO is not sending the notifications to my notification url.
Would anyone have any idea what might be happening? What could I have done wrong? What can I have forgotten to do?
Any help is welcome!