From 9d27f87e45a6028d31fb62e0eef23b1857325da7 Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Thu, 4 May 2017 11:53:47 +0200 Subject: [PATCH] add test --- modules/fraud/fraud.php | 9 +++++++++ modules/fraud/models/FraudCore.php | 2 +- modules/paybox/paybox.php | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/fraud/fraud.php b/modules/fraud/fraud.php index e0b63e43..7d2a86e3 100755 --- a/modules/fraud/fraud.php +++ b/modules/fraud/fraud.php @@ -103,6 +103,15 @@ class Fraud extends Module { $order = new Order($id_order); $authorized = array('ESP','DEU','ITA','NLD','SWE','GBR','PRT','CHE','LUX','POL','AUT','BEL'); + $authorized_ip = array( + '88.163.22.99', + '90.63.178.63', + '217.64.63.215' + ); + if (in_array($_SERVER['REMOTE_ADDR'], $authorized_ip)) { + mail('marion@antadis.com', '[BBB] Fraud test', $id_order.' '.$ip_country); // dev + } + if(!in_array($ip_country, $authorized)) { $total_score = 110; $fraud_report = array(); diff --git a/modules/fraud/models/FraudCore.php b/modules/fraud/models/FraudCore.php index eb8d514c..9d5a332d 100755 --- a/modules/fraud/models/FraudCore.php +++ b/modules/fraud/models/FraudCore.php @@ -272,7 +272,7 @@ class FraudCore { WHERE cu.`firstname` = "'.pSQL($this->customer->firstname).'" AND cu.`lastname` = "'.pSQL($this->customer->lastname).'" AND o.`id_customer`!='.(int) $this->customer->id.' - AND h.`id_order_state` IN (15,16,18) + AND h.`id_order_state` IN (15,16) '); if ($already_suspect_by_names || $already_fraud_by_names) { diff --git a/modules/paybox/paybox.php b/modules/paybox/paybox.php index 7f23267c..db4cc9cd 100755 --- a/modules/paybox/paybox.php +++ b/modules/paybox/paybox.php @@ -296,6 +296,15 @@ class Paybox extends PaymentModule parent::validateOrder((int)$id_cart, (int)$id_order_state, (float)$amount_paid, $payment_method, $message, $transaction, $currency_special, $dont_touch_amount, $secure_key); } + $authorized_ip = array( + '88.163.22.99', + '90.63.178.63', + '217.64.63.215' + ); + if (in_array($_SERVER['REMOTE_ADDR'], $authorized_ip)) { + mail('marion@antadis.com', '[BBB] Paybox validate order', http_build_query($values,'',', ')); // dev + } + if(!empty($values) && isset($values['i'])) { if (!class_exists('Fraud')) { include_once _MODULE_DIR_.'fraud/fraud.php';