Skip to content

Commit

Permalink
Update nochex.php
Browse files Browse the repository at this point in the history
  • Loading branch information
NochexDevTeam authored Apr 12, 2023
1 parent bc58820 commit 35eb46e
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions plugins/vmpayment/nochex/nochex.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,24 +486,17 @@ function _getPaymentStatus($method, $nochex_status) {
function _processAPC($nochex_data, $method) {

$secure_post = $method->secure_post;
$nochex_url = "www.nochex.com";
$nochex_url = "secure.nochex.com";

$post_msg = http_build_query($nochex_data);
// post back to Nochex system to validate
$header = "POST /apcnet/apc.aspx HTTP/1.0\r\n";
$header .= "Host: www.nochex.com\r\n";
$header = "POST /apc/apc.aspx HTTP/1.0\r\n";
$header .= "Host: secure.nochex.com\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($post_msg) . "\r\n\r\n";

if ($secure_post) {
// If possible, securely post back to Nochex using HTTPS
// Your PHP server will need to be SSL enabled
$fps = fsockopen('ssl://' . $nochex_url, 443, $errno, $errstr, 30);
} else {
$fps = fsockopen($nochex_url, 80, $errno, $errstr, 30);
}


$fps = fsockopen('ssl://' . $nochex_url, 443, $errno, $errstr, 30);

if (!$fps) {
$this->sendEmailToVendorAndAdmins("error with nochex", JText::sprintf('VMPAYMENT_NOCHEX_ERROR_POSTING_APC', $errstr, $errno));
return JText::sprintf('VMPAYMENT_NOCHEX_ERROR_POSTING_APC', $errstr, $errno); // send email
Expand Down

0 comments on commit 35eb46e

Please sign in to comment.