Skip to content

Commit

Permalink
Added is_phone_verified field
Browse files Browse the repository at this point in the history
  • Loading branch information
fraudlabspro committed May 28, 2021
1 parent c23e377 commit fb32acc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fraudlabspro/prestashop",
"version": "v1.14.0",
"version": "v1.14.1",
"description": "Enable FraudLabs Pro fraud prevention in PrestaShop.",
"type": "prestashop-module",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>fraudlabspro</name>
<displayName><![CDATA[FraudLabs Pro Fraud Prevention]]></displayName>
<version><![CDATA[1.14.0]]></version>
<version><![CDATA[1.14.1]]></version>
<description><![CDATA[FraudLabs Pro screens transaction for online frauds to protect your store from fraud attempts.]]></description>
<author><![CDATA[FraudLabs Pro]]></author>
<tab><![CDATA[payment_security]]></tab>
Expand Down
9 changes: 8 additions & 1 deletion fraudlabspro.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct()
{
$this->name = 'fraudlabspro';
$this->tab = 'payment_security';
$this->version = '1.14.0';
$this->version = '1.14.1';
$this->author = 'FraudLabs Pro';
$this->controllers = ['payment', 'validation'];
$this->module_key = 'cdb22a61c7ec8d1f900f6c162ad96caa';
Expand Down Expand Up @@ -106,6 +106,7 @@ public function install()
`flp_credits` VARCHAR(10) NOT NULL DEFAULT \'\' COLLATE \'utf8_bin\',
`api_key` CHAR(32) NOT NULL DEFAULT \'\' COLLATE \'utf8_bin\',
`is_blacklisted` CHAR(1) NOT NULL DEFAULT \'0\' COLLATE \'utf8_bin\',
`is_phone_verified` VARCHAR(100) NOT NULL DEFAULT \'0\' COLLATE \'utf8_bin\',
INDEX `id_order` (`id_order`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;');

Expand Down Expand Up @@ -280,6 +281,11 @@ public function hookAdminOrder($params)
$row['flp_rules'] = '';
}

if (!isset($row['is_phone_verified'])) {
Db::getInstance()->Execute('ALTER TABLE `' . _DB_PREFIX_ . 'orders_fraudlabspro` ADD COLUMN `is_phone_verified` VARCHAR(100) NOT NULL DEFAULT "0" AFTER `api_key`;');
$row['is_phone_verified'] = 0;
}

$location = [$row['ip_continent'], $row['ip_country'], $row['ip_region'], $row['ip_city']];
$location = implode(', ', array_unique(array_diff($location, [''])));

Expand Down Expand Up @@ -324,6 +330,7 @@ public function hookAdminOrder($params)
'is_ip_blacklist' => ($row['is_ip_blacklist'] == 'Y') ? 'Yes' : (($row['is_ip_blacklist'] == 'N') ? 'No' : 'N/A'),
'is_device_blacklist' => ($row['is_device_blacklist'] == 'Y') ? 'Yes' : (($row['is_device_blacklist'] == 'N') ? 'No' : 'N/A'),
'triggered_rules' => $triggeredRules,
'is_phone_verified' => ($row['is_phone_verified']) ? $row['is_phone_verified'] : 'No',
'transaction_id' => $row['flp_id'],
'error_message' => ($row['flp_message']) ? $row['flp_message'] : '(None)',
'show_approve_reject_button' => ($row['flp_status'] == 'REVIEW') ? true : false,
Expand Down
4 changes: 3 additions & 1 deletion views/templates/hook/admin_order.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@
<td>&nbsp;</td>
<td><strong>Device Blacklist</strong><div style="font-size:10px;color:#4b4b4b">Whether the client device is in our blacklist database.</div></td>
<td>{$is_device_blacklist}</td>
<td colspan="3">&nbsp;</td>
<td>&nbsp;</td>
<td><strong>Phone Verified</strong><div style="font-size:10px;color:#4b4b4b">Whether the phone number is verified by the client.</div></td>
<td>{$is_phone_verified}</td>
</tr>
<tr>
<td><strong>Triggered Rules</strong></td>
Expand Down

0 comments on commit fb32acc

Please sign in to comment.