-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from myopencart/dev
Release 2.3.0.2.2
- Loading branch information
Showing
26 changed files
with
742 additions
and
13 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
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,121 @@ | ||
<?php | ||
class ControllerExtensionPaymentOplata extends Controller | ||
{ | ||
private $error = array(); | ||
|
||
public function index() { | ||
|
||
$this->load->language('extension/payment/oplata'); | ||
$this->document->setTitle($this->language->get('heading_title')); | ||
$this->load->model('setting/setting'); | ||
$this->load->model('localisation/language'); | ||
|
||
$languages = $this->model_localisation_language->getLanguages(); | ||
foreach ($languages as $language) { | ||
if (isset($this->error['bank' . $language['language_id']])) { | ||
$data['error_bank' . $language['language_id']] = $this->error['bank' . $language['language_id']]; | ||
} else { | ||
$data['error_bank' . $language['language_id']] = ''; | ||
} | ||
} | ||
|
||
//------------------------------------------------------------ | ||
|
||
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { | ||
|
||
$this->model_setting_setting->editSetting('oplata', $this->request->post); | ||
$this->session->data['success'] = $this->language->get('text_success'); | ||
$this->response->redirect($this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=payment', true)); | ||
} | ||
|
||
$arr = array( | ||
"heading_title", "text_payment", "text_success", "text_pay", "text_card", | ||
"entry_merchant", "entry_styles" , "entry_secretkey", "entry_order_status", | ||
"entry_currency", "entry_backref", "entry_server_back", "entry_language", "entry_status", | ||
"entry_sort_order", "error_permission", "error_merchant", "error_secretkey", 'text_edit',"entry_help_lang"); | ||
|
||
foreach ($arr as $v) | ||
$data[$v] = $this->language->get($v); | ||
$data['button_save'] = $this->language->get('button_save'); | ||
$data['button_cancel'] = $this->language->get('button_cancel'); | ||
$data['text_enabled'] = $this->language->get('text_enabled'); | ||
$data['text_disabled'] = $this->language->get('text_disabled'); | ||
$data['entry_order_process_status'] = $this->language->get('entry_order_process_status'); | ||
|
||
#$data['LUURL'] = "index.php?route=payment/oplata/callback"; | ||
|
||
|
||
//------------------------------------------------------------ | ||
$arr = array("warning", "merchant", "secretkey", "type"); | ||
foreach ( $arr as $v ) | ||
$data['error_'.$v] = ( isset($this->error[$v]) ) ? $this->error[$v] : ""; | ||
//------------------------------------------------------------ | ||
|
||
$data['breadcrumbs'] = array(); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('text_home'), | ||
'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL'), | ||
'separator' => false | ||
); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('text_payment'), | ||
'href' => $this->url->link('extension/payment', 'token=' . $this->session->data['token'], 'SSL'), | ||
'separator' => ' :: ' | ||
); | ||
|
||
$data['breadcrumbs'][] = array( | ||
'text' => $this->language->get('heading_title'), | ||
'href' => $this->url->link('extension/payment/oplata', 'token=' . $this->session->data['token'], 'SSL'), | ||
'separator' => ' :: ' | ||
); | ||
|
||
$data['action'] = $this->url->link('extension/payment/oplata', 'token=' . $this->session->data['token'], 'SSL'); | ||
$data['cancel'] = $this->url->link('extension/extension', 'token=' . $this->session->data['token'], 'SSL'); | ||
|
||
//------------------------------------------------------------ | ||
$this->load->model('localisation/order_status'); | ||
|
||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses(); | ||
$data['oplata_currencyc']= array('','EUR','USD','GBP','RUB','UAH'); | ||
$arr = array( "oplata_merchant", "oplata_secretkey", "oplata_backref", "oplata_server_back", | ||
"oplata_language", "oplata_status", "oplata_sort_order", "oplata_order_status_id", "oplata_order_process_status_id", "oplata_currency", "oplata_styles"); | ||
|
||
|
||
|
||
|
||
foreach ( $arr as $v ) | ||
{ | ||
$data[$v] = ( isset($this->request->post[$v]) ) ? $this->request->post[$v] : $this->config->get($v); | ||
} | ||
|
||
|
||
//------------------------------------------------------------ | ||
|
||
$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('extension/payment/oplata.tpl', $data)); | ||
} | ||
|
||
//------------------------------------------------------------ | ||
private function validate() { | ||
if (!$this->user->hasPermission('modify', 'extension/payment/oplata')) { | ||
|
||
$this->error['warning'] = $this->language->get('error_permission'); | ||
} | ||
|
||
if (!$this->request->post['oplata_merchant']) { | ||
$this->error['merchant'] = $this->language->get('error_merchant'); | ||
} | ||
|
||
if (!$this->request->post['oplata_secretkey']) { | ||
$this->error['secretkey'] = $this->language->get('error_secretkey'); | ||
} | ||
//print_R (1);die; | ||
return (!$this->error) ? true : false ; | ||
} | ||
} | ||
?> |
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,36 @@ | ||
<?php | ||
// Heading | ||
$_['heading_title'] = 'Fondy'; | ||
$_['text_edit'] = 'Edit module'; | ||
$_['text_enabled'] = 'Enable'; | ||
$_['text_disabled'] = 'Disable'; | ||
$_['text_home'] = 'Dashboard'; | ||
// Text | ||
$_['text_payment'] = 'Payment'; | ||
$_['text_oplata'] = '<a onclick="window.open(\'http://fondy.eu/\');"><img src="view/image/payment/oplata.png" alt="Fondy" title="Fondy" style="border: 1px solid #EEEEEE;" /></a>'; | ||
$_['text_success'] = 'Settings updated'; | ||
$_['text_pay'] = 'Fondy'; | ||
$_['text_card'] = 'Credit Card'; | ||
$_['text_response_description'] = 'Error text:'; | ||
$_['text_oplata_order_status'] = 'Order status:'; | ||
$_['text_response_code'] = 'Error code:'; | ||
|
||
// Entry | ||
$_['entry_merchant'] = 'Merchant ID:'; | ||
$_['entry_secretkey'] = 'Secret key:'; | ||
|
||
|
||
$_['entry_order_status'] = 'Order status after payment:'; | ||
$_['entry_order_process_status'] = 'Order status in progress:'; | ||
$_['entry_currency'] = 'Currency:'; | ||
$_['entry_language'] = 'Language:'; | ||
$_['entry_help_lang'] = 'Default : RU'; | ||
|
||
$_['entry_status'] = 'Status:'; | ||
$_['entry_sort_order'] = 'Ordering:'; | ||
$_['entry_styles'] = 'Fondy Styles'; | ||
// Error | ||
$_['error_permission'] = "You haven't permission !"; | ||
$_['error_merchant'] = 'Merchant ID are incorrect!'; | ||
$_['error_secretkey'] = 'Secret key are empty!'; | ||
?> |
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,38 @@ | ||
<?php | ||
// Heading | ||
$_['heading_title'] = 'Fondy'; | ||
$_['text_enabled'] = 'Включить'; | ||
$_['text_disabled'] = 'Выключить'; | ||
$_['text_home'] = 'Dashboard'; | ||
|
||
// Text | ||
$_['text_edit'] = 'Редакторование модуля'; | ||
|
||
$_['text_payment'] = 'Оплата'; | ||
$_['text_oplata'] = '<a onclick="window.open(\'http://fondy.eu\');"><img src="view/image/payment/oplata.png" alt="Fondy" title="Oplata" style="border: 1px solid #EEEEEE;" /></a>'; | ||
$_['text_success'] = 'Настройки модуля обновлены!'; | ||
$_['text_pay'] = 'Fondy'; | ||
$_['text_card'] = 'Visa/MasterCard'; | ||
|
||
// Entry | ||
$_['entry_merchant'] = 'Merchant ID:'; | ||
$_['entry_secretkey'] = 'Secret key:'; | ||
|
||
$_['text_response_description'] = 'Текст ошибки:'; | ||
$_['text_oplata_order_status'] = 'Статус заказа:'; | ||
$_['text_response_code'] = 'Код ошибки:'; | ||
|
||
$_['entry_order_status'] = 'Статус заказа после оплаты:'; | ||
$_['entry_order_process_status'] = 'Статус заказа в процессе:'; | ||
$_['entry_currency'] = 'Валюта мерчанта'; | ||
$_['entry_language'] = 'Язык страницы:'; | ||
$_['entry_help_lang'] = 'по-умолчанию : RU'; | ||
|
||
$_['entry_status'] = 'Статус:'; | ||
$_['entry_sort_order'] = 'Порядок сортировки:'; | ||
$_['entry_styles'] = 'Стили'; | ||
// Error | ||
$_['error_permission'] = 'У Вас нет прав для управления этим модулем!'; | ||
$_['error_merchant'] = 'Неверный ID магазина (Merchant ID)!'; | ||
$_['error_secretkey'] = 'Отсутствует секретный ключ!'; | ||
?> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.