function safepay_error($msg) { global $order_id, $payment_id, $db; global $vars; $db->log_error("SAFEPAY ERROR: {$msg}<br />\n" . get_dump($vars)); die($msg); }
function p_log($file, $str, $append = false) { $path_found = false; // võimalikud logifaili asukohad - esimesse kataloog, mis eksisteerib, sinna ka salvestatakse $paths = [P_TMP, "/var/tmp"]; foreach ($paths as $path) { if (file_exists($path)) { $path_found = true; break; } } // kui ei leitud kataloogi if (!$path_found) { return false; } // kui ei ole puhas string, siis hangi antud objekti või massiivi dump if (!is_string($str)) { $str = get_dump($str); } // kas õnnestub faili avamine kirjutamiseks if (!($fp = fopen($path . "/" . $file, $append ? "a" : "w"))) { return false; } // kirjuta dump faili fputs($fp, $str . "\n"); fclose($fp); return true; }
function nochex_error($msg) { global $txn_id, $payment_id; global $vars; # header("Status: 500 Internal Server Error"); fatal_error(sprintf(_PLUG_PAY_NOCHEX_FERROR, $msg, $txn_id, $payment_id, '<br />') . "\n" . get_dump($vars)); }
function adultprocessor_error($msg) { global $order_id, $payment_id, $pnref, $db; global $vars; $db->log_error(sprintf("ADULTPROCESSOR ERROR: %s (Details: PNREF:%s, invoice:%d)%s", $msg, $pnref, $payment_id, '<br />') . "\n" . get_dump($vars)); die($msg); }
function alertpay_error($msg) { global $order_id, $payment_id, $pnref, $db; global $vars; $db->log_error(sprintf(_PLUG_PAY_ALERTPAY_FERROR, $msg, $pnref, $payment_id, '<br />') . "\n" . get_dump($vars)); die($msg); }
function ccbill_error($msg) { global $order_id, $payment_id, $pnref; global $vars, $db; $db->log_error("ccbill ERROR: {$msg} (Details: PNREF:'{$pnref}', invoice:'{$payment_id}')<br />\n" . get_dump($vars)); die("ccBill plugin error, please don't run this file manually - it is not supposed to work from your browser"); }
function payflow_error($msg) { global $order_id, $invoice, $pnref; global $vars; header("HTTP/1.1 404 Not found"); header("Status: 404 Not Found"); fatal_error(sprintf(_PLUG_PAY_PAYFLINK_FERROR, $msg, $pnref, $invoice, '<br />') . "\n" . get_dump($vars)); }
function ematters_error($msg) { global $order_id, $invoice, $pnref; global $vars; header("HTTP/1.1 404 Not found"); header("Status: 404 Not Found"); fatal_error("EMATTERS ERROR: {$msg} (Details: invoice:'{$invoice}')<br />\n" . get_dump($vars)); }
<?php include "../../../config.inc.php"; $this_config = $plugin_config['payment']['realex_redirect']; function get_dump($var) { //dump of array $s = ""; foreach ((array) $var as $k => $v) { $s .= "{$k} => {$v}<br />\n"; } return $s; } $vars = get_input_vars(); $db->log_error("RealEx Redirect DEBUG:<br />" . get_dump($vars)); $merchant_id = $vars['MERCHANT_ID']; $pnref = $vars['PASREF']; $result = $vars['RESULT']; $message = $vars['MESSAGE']; $payment_id = intval($vars['ORDER_ID']); $cvnresult = $vars['CVNRESULT']; $hash = $vars['TIMESTAMP'] . "." . $merchant_id . "." . $payment_id . "." . $result . "." . $message . "." . $pnref . "." . $vars['AUTHCODE']; $response_valid = false; if ($vars['MD5HASH']) { $hash = md5($hash); $hash = $hash . "." . $this_config['secret']; $hash = md5($hash); if ($vars['MD5HASH'] == $hash) { $response_valid = true; } } else {
//dump of array $s = ""; foreach ((array) $var as $k => $v) { $s .= "{$k} => {$v}<br />\n"; } return $s; } function allpay_error($msg) { global $order_id, $payment_id, $pnref, $db; global $vars; $db->log_error(sprintf(_PLUG_PAY_ALLPAY_FERROR, $msg, $pnref, $payment_id, '<br />')); echo "OK"; exit; } $db->log_error("AllPay DEBUG: " . get_dump($vars)); ////////////////////////////////////////////////////////////////////////////// // // M A I N // ////////////////////////////////////////////////////////////////////////////// /// check ip if (!preg_match('/^217\\.17\\.41\\.5/', $_SERVER['REMOTE_ADDR'])) { allpay_error(_PLUG_PAY_ALLPAY_ERROR); } // check status if ($status != 'OK') { allpay_error(_PLUG_PAY_ALLPAY_ERROR2); } // check that it is our payment if ($vars['id'] != $this_config['seller_id']) {
function epassporte_error($msg) { global $order_id, $invoice; global $vars; fatal_error(sprintf(_PLUG_PAY_EPASSPORT_ERROR4, $msg, $invoice, '<br />') . "\n" . get_dump($vars)); }
function passwordcall_error($msg) { global $txn_id, $invoice; global $vars; fatal_error(sprintf(_PLUG_PAY_PSWDCALL_FERROR, $txn_id, $invoice, '<br />') . "\n" . get_dump($vars)); }
function paycom_error($msg) { global $invoice; global $vars; fatal_error(sprintf(_PLUG_PAY_PAYCOM_FERROR, $msg, $invoice, '<br\\>') . "\n" . get_dump($vars)); }
function verotel_error($msg) { global $order_id, $payment_id, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_VEROTEL_FERROR, $msg, $payment_id, '<br />') . "\n" . get_dump($vars)); }
function export() { global $response, $config, $connect; include 'export.php'; $query = "SHOW TABLES;"; $result = mysql_query($query); $tables = array(); if (mysql_num_rows($result) != 0) { while ($row = mysql_fetch_row($result)) { $tables[] = $row[0]; } } get_dump($connect, $tables); $response['export'] = 'dump.sql'; }
function securetrading_error($msg) { global $txn_id, $invoice; global $vars; fatal_error(sprintf(_PLUG_PAY_SECURTRD_FERROR, $msg, $txn_id, $invoice, '<br />') . "\n" . get_dump($vars)); }
function vanco_error($msg) { global $order_id, $invoice, $pnref; global $vars; fatal_error(sprintf('multicards ERROR: %s (Details: PNREF:%s, invoice:%d)%s', $msg, $pnref, $invoice, '<br />') . "\n" . get_dump($vars)); }
function globill_error($msg) { global $order_id, $payment_id, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_GLOBILL_FERROR, $msg, $pnref, $payment_id, '<br />') . "\n" . get_dump($vars)); }
function luotto_error($msg) { global $txn_id, $pid; global $vars; fatal_error("Luottokunta ERROR: {$msg} (Details: txn_id:'{$txn_id}', invoice:'{$pid}')<br>\n" . get_dump($vars)); }
function probilling_error($msg) { global $order_id, $payment_id, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_PROBILLING_FERROR, $msg, $pnref, $payment_id) . "\n" . get_dump($vars)); }
function directone_error($msg) { global $order_id, $payment_id, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_DIRECTONEREM_ERROR, $msg, $pnref, $payment_id, '<br />') . "\n" . get_dump($vars)); }
function egold_error($msg) { global $txn_id, $invoice; global $vars; fatal_error(sprintf(_PLUG_PAY_EGOLD_ERROR, $msg, $vars[PAYMENT_BATCH_NUM], $vars[PAYMENT_ID], '<br />') . "\n" . get_dump($vars)); }
function paydotcom_error($msg) { global $txn_id, $invoice; global $vars; fatal_error("paydotcom ERROR: {$msg} (Details: txn_id:'{$txn_id}', invoice:'{$payment_id}')<br>\n" . get_dump($vars)); }
function beanstream_remote_error($msg) { global $order_id, $payment_id, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_BEANSTREAM_REM_ERROR, $msg, $pnref, $payment_id, "<br />", "\n") . get_dump($vars)); }
function authorize_error($msg) { global $order_id, $invoice, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_AUTHORIZE_ERROR, $msg, $pnref, $invoice, "<br />", "\n") . get_dump($vars)); }
function centipaid_error($msg) { global $order_id, $invoice, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_CENTIP_FERROR, $msg, $pnref, $invoice, '<br />'), "\n" . get_dump($vars)); }
function Chronopay_error($msg) { global $order_id, $payment_id, $pnref; global $vars; fatal_error("Chronopay ERROR: {$msg} (Details: PNREF:'{$pnref}', invoice:'{$payment_id}')<br />\n" . get_dump($vars)); }
function multicards_error($msg) { global $order_id, $invoice, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_MULTICARD_ERROR, $msg, $pnref, $invoice, '<br />') . "\n" . get_dump($vars)); }
function egspay_error($msg) { global $order_id, $payment_id, $pnref; global $vars; fatal_error(sprintf(_PLUG_PAY_EGSPAY_ERROR, $msg, $payment_id, '<br />') . "\n" . get_dump($vars)); }
function stormpay_error($msg) { global $txn_id, $invoice; global $vars; fatal_error(sprintf(_PLUG_PAY_STORMPAY_FERROR, $msg, $txn_id, $invoice, '<br />') . "\n" . get_dump($vars)); }