AuthorizeNetController.php in Ubercart 8.4
File
payment/uc_authorizenet/src/Controller/AuthorizeNetController.php
View source
<?php
namespace Drupal\uc_authorizenet\Controller;
use Drupal\Core\Controller\ControllerBase;
class AuthorizeNetController extends ControllerBase {
public function silentPost() {
$arb = (isset($_POST['x_subscription_id']) and isset($_POST['x_subscription_paynum']));
if (variable_get('uc_authnet_report_arb_post', FALSE)) {
$args = [
'@arb' => $arb ? 'ARB ' : '',
'@order_id' => $_POST['x_invoice_num'],
'@post' => print_r($_POST, TRUE),
];
$this
->getLogger('uc_authorizenet')
->notice('@arbSilent POST received for order @order_id: <pre>@post</pre>', $args);
}
$login_data = _uc_authorizenet_login_data();
if ($arb) {
$md5 = strtoupper(md5($login_data['md5_hash'] . $_POST['x_trans_id'] . $_POST['x_amount']));
if ($_POST['x_MD5_Hash'] != $md5) {
$this
->getLogger('uc_authorizenet')
->error('Invalid ARB payment notification received.');
}
else {
$this
->moduleHandler()
->invokeAll('uc_auth_arb_payment', [
$_POST,
]);
}
}
exit;
}
}