-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
134b1d8
commit f9085aa
Showing
12 changed files
with
546 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?php | ||
class ControllerFraudMaxMind extends Controller { | ||
private $error = array(); | ||
|
||
public function index() { | ||
$this->load->language('fraud/maxmind'); | ||
|
||
$this->document->setTitle($this->language->get('heading_title')); | ||
|
||
$this->load->model('setting/setting'); | ||
|
||
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { | ||
$this->model_setting_setting->editSetting('maxmind', $this->request->post); | ||
|
||
$this->session->data['success'] = $this->language->get('text_success'); | ||
|
||
$this->response->redirect($this->url->link('extension/fraud', 'token=' . $this->session->data['token'], 'SSL')); | ||
} | ||
|
||
$data['heading_title'] = $this->language->get('heading_title'); | ||
|
||
$data['text_edit'] = $this->language->get('text_edit'); | ||
$data['text_enabled'] = $this->language->get('text_enabled'); | ||
$data['text_disabled'] = $this->language->get('text_disabled'); | ||
$data['text_signup'] = $this->language->get('text_signup'); | ||
|
||
$data['entry_key'] = $this->language->get('entry_key'); | ||
$data['entry_score'] = $this->language->get('entry_score'); | ||
$data['entry_order_status'] = $this->language->get('entry_order_status'); | ||
$data['entry_status'] = $this->language->get('entry_status'); | ||
|
||
$data['help_score'] = $this->language->get('help_score'); | ||
$data['help_order_status'] = $this->language->get('help_order_status'); | ||
|
||
$data['button_save'] = $this->language->get('button_save'); | ||
$data['button_cancel'] = $this->language->get('button_cancel'); | ||
|
||
$data['tab_general'] = $this->language->get('tab_general'); | ||
|
||
if (isset($this->error['warning'])) { | ||
$data['error_warning'] = $this->error['warning']; | ||
} else { | ||
$data['error_warning'] = ''; | ||
} | ||
|
||
if (isset($this->error['key'])) { | ||
$data['error_key'] = $this->error['key']; | ||
} else { | ||
$data['error_key'] = ''; | ||
} | ||
|
||
$data['breadcrumbs'] = array(); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('text_home'), | ||
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL') | ||
); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('text_fraud'), | ||
'href' => $this->url->link('extension/fraud', 'token=' . $this->session->data['token'], 'SSL') | ||
); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('heading_title'), | ||
'href' => $this->url->link('fraud/maxmind', 'token=' . $this->session->data['token'], 'SSL') | ||
); | ||
|
||
$data['action'] = $this->url->link('fraud/maxmind', 'token=' . $this->session->data['token'], 'SSL'); | ||
|
||
$data['cancel'] = $this->url->link('extension/fraud', 'token=' . $this->session->data['token'], 'SSL'); | ||
|
||
if (isset($this->request->post['maxmind_key'])) { | ||
$data['maxmind_key'] = $this->request->post['maxmind_key']; | ||
} else { | ||
$data['maxmind_key'] = $this->config->get('maxmind_key'); | ||
} | ||
|
||
if (isset($this->request->post['maxmind_score'])) { | ||
$data['maxmind_score'] = $this->request->post['maxmind_score']; | ||
} else { | ||
$data['maxmind_score'] = $this->config->get('maxmind_score'); | ||
} | ||
|
||
if (isset($this->request->post['maxmind_order_status_id'])) { | ||
$data['maxmind_order_status_id'] = $this->request->post['maxmind_order_status_id']; | ||
} else { | ||
$data['maxmind_order_status_id'] = $this->config->get('maxmind_order_status_id'); | ||
} | ||
|
||
$this->load->model('localisation/order_status'); | ||
|
||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses(); | ||
|
||
if (isset($this->request->post['maxmind_status'])) { | ||
$data['maxmind_status'] = $this->request->post['maxmind_status']; | ||
} else { | ||
$data['maxmind_status'] = $this->config->get('maxmind_status'); | ||
} | ||
|
||
$data['header'] = $this->load->controller('common/header'); | ||
$data['column_left'] = $this->load->controller('common/column_left'); | ||
$data['footer'] = $this->load->controller('common/footer'); | ||
|
||
$this->response->setOutput($this->load->view('fraud/maxmind.tpl', $data)); | ||
} | ||
|
||
protected function validate() { | ||
if (!$this->user->hasPermission('modify', 'fraud/maxmind')) { | ||
$this->error['warning'] = $this->language->get('error_permission'); | ||
} | ||
|
||
if (!$this->request->post['maxmind_key']) { | ||
$this->error['key'] = $this->language->get('error_key'); | ||
} | ||
|
||
return !$this->error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
// Heading | ||
$_['heading_title'] = 'MaxMind Anti-Fraud'; | ||
|
||
// Text | ||
$_['text_fraud'] = 'Anti-Fraud'; | ||
$_['text_success'] = 'Success: You have modified MaxMind anti-fraud!'; | ||
$_['text_edit'] = 'Edit MaxMind Anti-Fraud'; | ||
$_['text_signup'] = 'MaxMind is a fraud detection service. If you don\'t have a license key you can <a href="http://www.maxmind.com/?rId=opencart" target="_blank"><u>sign up here</u></a>.'; | ||
|
||
// Entry | ||
$_['entry_key'] = 'MaxMind License Key'; | ||
$_['entry_score'] = 'Risk Score'; | ||
$_['entry_order_status'] = 'Order Status'; | ||
$_['entry_status'] = 'Status'; | ||
|
||
// Help | ||
$_['help_score'] = 'The higher the score the more likely the order is fraudulent. Set a score between 0 - 100.'; | ||
$_['help_order_status'] = 'Orders that have a score over your set risk score will be assigned this order status and will not be allowed to reach the complete status automatically.'; | ||
|
||
// Error | ||
$_['error_permission'] = 'Warning: You do not have permission to modify MaxMind anti-fraud!'; | ||
$_['error_key'] = 'License Key Required!'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<?php | ||
// Heading | ||
$_['heading_title'] = 'Cheque / Money Order'; | ||
$_['heading_title'] = 'Cheque / Money Order'; | ||
|
||
// Text | ||
$_['text_payment'] = 'Payment'; | ||
$_['text_success'] = 'Success: You have modified cheque / money order account details!'; | ||
$_['text_edit'] = 'Edit Cheque / Money Order'; | ||
$_['text_payment'] = 'Payment'; | ||
$_['text_success'] = 'Success: You have modified cheque / money order account details!'; | ||
$_['text_edit'] = 'Edit Cheque / Money Order'; | ||
|
||
// Entry | ||
$_['entry_payable'] = 'Payable To'; | ||
$_['entry_total'] = 'Total'; | ||
$_['entry_order_status'] = 'Order Status'; | ||
$_['entry_geo_zone'] = 'Geo Zone'; | ||
$_['entry_status'] = 'Status'; | ||
$_['entry_sort_order'] = 'Sort Order'; | ||
$_['entry_payable'] = 'Payable To'; | ||
$_['entry_total'] = 'Total'; | ||
$_['entry_order_status'] = 'Order Status'; | ||
$_['entry_geo_zone'] = 'Geo Zone'; | ||
$_['entry_status'] = 'Status'; | ||
$_['entry_sort_order'] = 'Sort Order'; | ||
|
||
// Help | ||
$_['help_total'] = 'The checkout total the order must reach before this payment method becomes active.'; | ||
$_['help_total'] = 'The checkout total the order must reach before this payment method becomes active.'; | ||
|
||
// Error | ||
$_['error_permission'] = 'Warning: You do not have permission to modify payment cheque / money order!'; | ||
$_['error_payable'] = 'Payable To Required!'; | ||
$_['error_permission'] = 'Warning: You do not have permission to modify payment cheque / money order!'; | ||
$_['error_payable'] = 'Payable To Required!'; |
100 changes: 50 additions & 50 deletions
100
upload/admin/language/english/payment/firstdata_remote.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.