diff --git a/README.md b/README.md
index 2bd0b41..7dd0924 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Paysera.com payment gateway plugin for PrestaShop
Requirements
------------
-- PrestaShop 1.5.x
+- PrestaShop 1.6.x
Installation
------------
@@ -18,6 +18,7 @@ Installation
OR
+
1. Download this repository as zip and Go to "Modules" and click "Add new module"
2. Browse for module and upload.
3. In mokejimai module area press "Install" button, after installation is complete press "Configure" button and fill in required details;
diff --git a/mokejimai/config.xml b/mokejimai/config.xml
deleted file mode 100755
index ebec24e..0000000
--- a/mokejimai/config.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- mokejimai
-
-
-
-
-
- Are you sure you want to delete your details?
- 1
- 1
-
-
\ No newline at end of file
diff --git a/mokejimai/controllers/front/callback.php b/mokejimai/controllers/front/callback.php
deleted file mode 100755
index 46dd67b..0000000
--- a/mokejimai/controllers/front/callback.php
+++ /dev/null
@@ -1,50 +0,0 @@
- $this->module->project_id,
- 'sign_password' => $this->module->signature,
- ));
-
- if ($response['status'] == 1) {
- $Order = new Order($response['orderid']);
- $orderAmount = $Order->getOrdersTotalPaid();
- $cartCurrency = Currency::getCurrency($Order->id_currency);
-
- if (intval(number_format($response['amount'], 0, '', '')) < intval(number_format(($orderAmount * 100), 0, '', ''))) {
- exit('Bad amount: ' . $response['amount']);
- }
-
- if ($response['currency'] != $cartCurrency['iso_code']) {
- exit('Bad currency: ' . $response['currency']);
- }
-
- $history = new OrderHistory();
- $history->id_order = $response['orderid'];
- $history->changeIdOrderState((int)Configuration::get('PS_OS_PAYMENT'), $response['orderid']);
- $history->addWithemail(true, array(
- 'order_name' => $response['orderid'],
- ));
- }
- exit('OK');
- } catch (Exception $e) {
- exit(get_class($e) . ': ' . $e->getMessage());
- }
- }
-}
diff --git a/mokejimai/controllers/front/cancel.php b/mokejimai/controllers/front/cancel.php
deleted file mode 100755
index 4da02c0..0000000
--- a/mokejimai/controllers/front/cancel.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
-* @copyright 2007-2012 PrestaShop SA
-* @version Release: $Revision: 13573 $
-* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-*/
-
-/**
- * @since 1.5.0
- */
-class MokejimaiPaymentModuleFrontController extends ModuleFrontController {
- public $display_column_left = false;
- public $ssl = true;
-
- /**
- * @see FrontController::initContent()
- */
- public function initContent() {
- parent::initContent();
-
- global $cookie;
-
- $cart = $this->context->cart;
- if (!$this->module->checkCurrency($cart)) {
- Tools::redirect('index.php?controller=order');
- }
-
- $payCurrency = Context::getContext()->currency;
- $payAmount = $cart->getOrderTotal() * 100;
-
- //siuo metu pasirinkta kalba
- $language = Language::getIsoById(intval($cookie->id_lang));
- $language = (!in_array($language, array('lt', 'en', 'ru'))) ? 'en' : $language;
-
- $methods = WebToPay::getPaymentMethodList($this->module->project_id, $payCurrency->iso_code)
- ->filterForAmount($payAmount, $payCurrency->iso_code)
- ->setDefaultLanguage($language)
- ->getCountries();
-
- $this->context->smarty->assign(array(
- 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/',
- 'amount' => ($payAmount / 100),
- 'currency' => $payCurrency->iso_code,
- 'displayPayments' => $this->module->paymentList,
- 'isoCode' => $language, //Language::getIsoById(intval($cookie->id_lang)),
- 'defaultCountry' => $this->module->defaultCountry,
- 'payMethods' => $methods,
- ));
-
- $this->setTemplate('payment_execution.tpl');
- }
-}
diff --git a/mokejimai/controllers/front/redirect.php b/mokejimai/controllers/front/redirect.php
deleted file mode 100755
index a002e03..0000000
--- a/mokejimai/controllers/front/redirect.php
+++ /dev/null
@@ -1,71 +0,0 @@
-context->cart;
- if (!$this->module->checkCurrency($cart)) {
- Tools::redirect('index.php?controller=order');
- }
-
- $address = new Address(intval($cart->id_address_invoice));
- $customer = new Customer(intval($cart->id_customer));
- $country = new Country(intval($address->id_country));
- $currency = Context::getContext()->currency;
- $total = floatval(number_format($cart->getOrderTotal(true, 3), 2, '.', ''));
- $languageCode = strtoupper(Language::getIsoById(intval($cookie->id_lang)));
- $urlLanguage = ($languageCode == 'LT') ? 'LIT' : 'ENG';
-
- $this->module->validateOrder($cart->id, Configuration::get('PAYSERA_PENDING'), $total, $this->module->displayName, NULL, NULL, $currency->id);
-
- try {
- $request = WebToPay::buildRequest(array(
- 'projectid' => $this->module->project_id,
- 'sign_password' => $this->module->signature,
-
- 'orderid' => $this->module->currentOrder,
- 'amount' => intval(number_format($total, 2, '', '')),
- 'currency' => $currency->iso_code,
- 'lang' => ($languageCode == 'LT') ? 'LTU' : 'ENG',
-
- 'accepturl' => $link->getModuleLink('mokejimai', 'validation'),
- 'cancelurl' => $link->getModuleLink('mokejimai', 'cancel'),
- 'callbackurl' => $link->getModuleLink('mokejimai', 'callback'),
- 'payment' => (isset($_POST['payment'])) ? $_POST['payment'] : '',
-
- 'p_firstname' => $customer->firstname,
- 'p_lastname' => $customer->lastname,
- 'p_email' => $customer->email,
- 'p_street' => $address->address1,
- 'p_city' => $address->city,
- 'p_zip' => $address->postcode,
- 'p_countrycode' => $country->iso_code,
- 'test' => $this->module->sandbox,
- ));
- } catch (WebToPayException $e) {
- echo get_class($e) . ': ' . $e->getMessage();
- }
-
- $this->context->smarty->assign(array(
- 'payUrl' => WebToPay::getPaymentUrl($urlLanguage),
- 'request' => $request,
- ));
-
- $this->setTemplate('redirect.tpl');
- }
-}
diff --git a/mokejimai/controllers/front/validation.php b/mokejimai/controllers/front/validation.php
deleted file mode 100755
index c7a6dc2..0000000
--- a/mokejimai/controllers/front/validation.php
+++ /dev/null
@@ -1,22 +0,0 @@
-context->cart;
- if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
- Tools::redirect('index.php?controller=order&step=1');
- }
-
- $customer = new Customer($cart->id_customer);
- if (!Validate::isLoadedObject($customer)) {
- Tools::redirect('index.php?controller=order&step=1');
- }
-
- Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key);
- }
-}
\ No newline at end of file
diff --git a/mokejimai/img/logo-lt.png b/mokejimai/img/logo-lt.png
deleted file mode 100755
index 2eb25cf..0000000
Binary files a/mokejimai/img/logo-lt.png and /dev/null differ
diff --git a/mokejimai/logo.gif b/mokejimai/logo.gif
deleted file mode 100755
index df43871..0000000
Binary files a/mokejimai/logo.gif and /dev/null differ
diff --git a/mokejimai/mokejimai.php b/mokejimai/mokejimai.php
deleted file mode 100755
index 5d25c75..0000000
--- a/mokejimai/mokejimai.php
+++ /dev/null
@@ -1,280 +0,0 @@
-name = 'mokejimai';
- $this->tab = 'payments_gateways';
- $this->version = WebToPay::VERSION;
- $this->author = 'EVP International';
-
- $config = Configuration::getMultiple(array(
- 'PAYSERA_PROJECT_ID',
- 'PAYSERA_SIGNATURE',
- 'PAYSERA_SANDBOX',
- 'PAYSERA_PAYMENTLIST',
- 'PAYSERA_DEFAULT_COUNTRY'
- ));
-
- $this->project_id = self::setValue($config, 'PAYSERA_PROJECT_ID');
- $this->signature = self::setValue($config, 'PAYSERA_SIGNATURE', '');
- $this->sandbox = self::setValue($config, 'PAYSERA_SANDBOX');
- $this->paymentList = self::setValue($config, 'PAYSERA_PAYMENTLIST', 1);
- $this->defaultCountry = self::setValue($config, 'PAYSERA_DEFAULT_COUNTRY', 'lt');
-
- if (!$this->project_id) {
- $this->project_id = '12345';
- }
-
- parent::__construct();
-
- $this->page = basename(__FILE__, '.php');
- $this->displayName = $this->l('Mokejimai');
- $this->description = $this->l('Accept payments by Mokejimai.lt system');
- $this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
-
- if (!isset($this->project_id) || !isset($this->signature)) {
- $this->warning = $this->l('Project details must be configured in order to use this module correctly.');
- }
-
- if (!count(Currency::checkPaymentCurrencies($this->id))) {
- $this->warning = $this->l('No currency set for this module');
- }
- }
-
- public function install() {
- if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) {
- return false;
- }
-
- /* add pending order state */
- $OrderPending = new OrderState();
- $OrderPending->name = array_fill(0, 10, 'AWAITING MOKEJIMAI.LT PAYMENT');
- $OrderPending->send_email = 0;
- $OrderPending->invoice = 0;
- $OrderPending->color = 'RoyalBlue';
- $OrderPending->unremovable = false;
- $OrderPending->logable = 0;
-
- if ($OrderPending->add()) {
- @copy(_PS_ROOT_DIR_ . '/modules/mokejimai/img/order-logo.gif', _PS_ROOT_DIR_ . '/img/os/' . (int)$OrderPending->id . '.gif');
- }
-
- Configuration::updateValue('PAYSERA_PENDING', $OrderPending->id);
-
- return true;
- }
-
- public function uninstall() {
- $OrderStatePending = new OrderState(Configuration::get('PAYSERA_PENDING'));
-
- return (
- Configuration::deleteByName('PAYSERA_PROJECT_ID') AND
- Configuration::deleteByName('PAYSERA_SIGNATURE') AND
- Configuration::deleteByName('PAYSERA_SANDBOX') AND
- Configuration::deleteByName('PAYSERA_PAYMENTLIST') AND
- Configuration::deleteByName('PAYSERA_DEFAULT_COUNTRY') AND
- Configuration::deleteByName('PAYSERA_PENDING') AND
- $OrderStatePending->delete() AND
- parent::uninstall()
- );
- }
-
- private function validatePostRequest() {
- if (isset($_POST['btnSubmit'])) {
- if (empty($_POST['project_id'])) {
- $this->messages[] = array(
- 'class' => 'warning warn',
- 'src' => '../img/admin/warning.gif',
- 'msg' => $this->l('Project ID is required!'),
- );
-
- return false;
- }
- }
-
- return true;
- }
-
- private function processPostRequest() {
- if (isset($_POST['btnSubmit'])) {
- Configuration::updateValue('PAYSERA_PROJECT_ID', intval($_POST['project_id']));
- Configuration::updateValue('PAYSERA_SIGNATURE', $_POST['signature']);
- Configuration::updateValue('PAYSERA_SANDBOX', intval($_POST['sandbox']));
- Configuration::updateValue('PAYSERA_PAYMENTLIST', intval($_POST['paymentList']));
- Configuration::updateValue('PAYSERA_DEFAULT_COUNTRY', $_POST['defaultCountry']);
-
- $this->project_id = intval($_POST['project_id']);
- $this->signature = $_POST['signature'];
- $this->sandbox = intval($_POST['sandbox']);
- $this->paymentList = intval($_POST['paymentList']);
- $this->defaultCountry = $_POST['defaultCountry'];
-
- $this->messages[] = array(
- 'class' => 'conf confirm',
- 'src' => '../img/admin/ok.gif',
- 'msg' => $this->l('Settings updated'),
- );
- }
- }
-
- public function getContent() {
- global $cookie, $smarty;
-
- if ($this->validatePostRequest()) {
- $this->processPostRequest();
- }
-
- $methods = WebToPay::getPaymentMethodList($this->project_id)
- ->setDefaultLanguage(Language::getIsoById(intval($cookie->id_lang)))
- ->getCountries();
-
- $smarty->assign(array(
- 'messages' => $this->messages,
- 'lang' => $cookie->id_lang,
- 'requestUrl' => $_SERVER['REQUEST_URI'],
- 'projectId' => $this->project_id,
- 'projectPass' => $this->signature,
- 'defaultCountry' => $this->defaultCountry,
- 'sandboxOn' => ($this->sandbox) ? 'checked="checked"' : '',
- 'sandboxOff' => (!$this->sandbox) ? 'checked="checked"' : '',
- 'payListOn' => ($this->paymentList) ? 'checked="checked"' : '',
- 'payListOff' => (!$this->paymentList) ? 'checked="checked"' : '',
- 'countries' => $methods,
- ));
-
- return $this->display(__FILE__, 'views/templates/front/configuration.tpl');
- }
-
-
- /**
- * NOT IMPLEMENTED
- *
- * @param int $orderId
- * @return string
- */
- private function restoreOrder($orderId) {
- global $smarty, $cookie;
-
- $order = new Order($orderId);
-
- if (Validate::isLoadedObject($order) && $order->id_customer == $cookie->id_customer) {
- try {
- $request = WebToPay::buildRepeatRequest(array(
- 'projectid' => $this->project_id,
- 'sign_password' => $this->signature,
- 'orderid' => $orderId,
- ));
- } catch (WebToPayException $e) {
- echo get_class($e) . ': ' . $e->getMessage();
- }
-
- $smarty->assign(array(
- 'payUrl' => WebToPay::PAY_URL,
- 'request' => $request,
- ));
-
- return $this->display(__FILE__, 'views/templates/front/restore.tpl');
- } else {
- exit('Bad restore number!');
- }
- }
-
- public function hookPayment($params) {
- global $smarty;
-
- $iso_code = $this->context->language->iso_code;
- $smarty->assign(array(
- 'lang' => $iso_code,
- 'this_path' => $this->_path,
- 'this_path_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://') . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'modules/' . $this->name . '/'
- ));
-
- return $this->display(__FILE__, 'views/templates/hook/payment.tpl');
- }
-
- public function hookPaymentReturn($params) {
- global $smarty;
-
- $state = $params['objOrder']->getCurrentState();
- if ($state == Configuration::get('PAYSERA_ACCEPTED') OR $state == _PS_OS_OUTOFSTOCK_ || 1) {
- $smarty->assign(array(
- 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false, false),
- 'status' => 'ok',
- 'id_order' => $params['objOrder']->id
- ));
- } else {
- $smarty->assign('status', 'failed');
- }
-
- return $this->display(__FILE__, 'views/templates/front/payment_return.tpl');
- }
-
- /**
- * @param int $id_currency : this parameter is optionnal but on 1.5 version of Prestashop, it will be REQUIRED
- * @return Currency
- */
- public function getCurrency($current_id_currency = null) {
- if (!(int)$current_id_currency)
- $current_id_currency = Context::getContext()->currency->id;
-
- if (!$this->currencies)
- return false;
- if ($this->currencies_mode == 'checkbox') {
- $currencies = Currency::getPaymentCurrencies($this->id);
- return $currencies;
- } elseif ($this->currencies_mode == 'radio') {
- $currencies = Currency::getPaymentCurrenciesSpecial($this->id);
- $currency = $currencies['id_currency'];
- if ($currency == -1)
- $id_currency = (int)$current_id_currency;
- elseif ($currency == -2)
- $id_currency = (int)Configuration::get('PS_CURRENCY_DEFAULT'); else
- $id_currency = $currency;
- }
- if (!isset($id_currency) || empty($id_currency))
- return false;
- return (new Currency($id_currency));
- }
-
- public function checkCurrency($cart) {
- $currency_order = new Currency($cart->id_currency);
- $currencies_module = $this->getCurrency($cart->id_currency);
-
- if (is_array($currencies_module)) {
- foreach ($currencies_module as $currency_module) {
- if ($currency_order->id == $currency_module['id_currency']) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- private static function setValue($config = array(), $value = '', $default = 0) {
- return (isset($config[$value])) ? $config[$value] : $default;
- }
-
- /**
- * Debug function
- *
- * @param $var
- */
- private static function d($var) {
- echo '
';
- print_r($var);
- echo '
';
- }
-
-}
diff --git a/mokejimai/translations/en.php b/mokejimai/translations/en.php
deleted file mode 100755
index 6022bdd..0000000
--- a/mokejimai/translations/en.php
+++ /dev/null
@@ -1,18 +0,0 @@
-configuration_3f86574ad34d16a8cf2ba530c9aafee7'] = 'This module allows you to accept payments by Paysera.com';
-$_MODULE['<{mokejimai}default>configuration_b6af2d31afe71aedcceca73cc27fec29'] = 'If the client chooses this payment mode, the order will change its status into a \'Waiting for payment\' status.';
-$_MODULE['<{mokejimai}default>configuration_aa9f04d1be872e3bdaca1cccf7f02d12'] = 'Payment module details';
-$_MODULE['<{mokejimai}default>configuration_f5f04b11870f0822cfc263fdc6214528'] = 'Please specify the Paysera.com details';
-$_MODULE['<{mokejimai}default>configuration_e082f55a3e947645b3cfc4a3837564be'] = 'Paysera.com project ID:';
-$_MODULE['<{mokejimai}default>configuration_ae71d10996c375bccc46d24665b318a9'] = 'Paysera.com project passaword:';
-$_MODULE['<{mokejimai}default>configuration_2f1120281bc59dbf84f4b7d9f210b421'] = 'Test mode:';
-$_MODULE['<{mokejimai}default>configuration_93cba07454f06a4a960172bbd6e2a435'] = 'Yes';
-$_MODULE['<{mokejimai}default>configuration_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No';
-$_MODULE['<{mokejimai}default>configuration_2f8251979372d44fa8e3df67202cbef1'] = 'Display payments list:';
-$_MODULE['<{mokejimai}default>configuration_49b80feb114d68c0b124c0129536bd02'] = 'Default payment country:';
-$_MODULE['<{mokejimai}default>configuration_b17f3f4dcf653a5776792498a9b44d6a'] = 'Update settings';
-$_MODULE['<{mokejimai}default>payment_8d0e94f6e1d030f33f8ce19548051b3d'] = 'Pay by Paysera.com';
-$_MODULE['<{mokejimai}default>payment_3af059bc2293e9e46a898bdc659e0a0c'] = 'Pay by Paysera.com (order process will be faster) ';
diff --git a/mokejimai/translations/lt.php b/mokejimai/translations/lt.php
deleted file mode 100755
index da0122b..0000000
--- a/mokejimai/translations/lt.php
+++ /dev/null
@@ -1,35 +0,0 @@
-mokejimai_2d2b05368867f2d9b017e65ce9c1526a'] = 'Mokėjimai.lt';
-$_MODULE['<{mokejimai}default>mokejimai_e0355bb27ba85e136a8eddc1d95ada91'] = 'Prrimti mokėjimus per Mokėjimai.lt sistemą';
-$_MODULE['<{mokejimai}default>mokejimai_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Ar tikrai norite ištrinti nustatymus';
-$_MODULE['<{mokejimai}default>mokejimai_ef6222485ff756bb929a8dfc9c722ea9'] = 'Turi būti suvesti projekto nustatymai, kad veiktų teisingai apmokėjimas.';
-$_MODULE['<{mokejimai}default>mokejimai_4402acab1c8f90dcf4a31dc96833bd86'] = 'Nepasirinkta valiuta šiame modulyje';
-$_MODULE['<{mokejimai}default>mokejimai_b4ba0005dcd53932c2b8106963281b62'] = 'Privaloma įvesti projekto ID';
-$_MODULE['<{mokejimai}default>mokejimai_c888438d14855d7d96a2724ee9c306bd'] = 'Nustatymai atnaujinti';
-$_MODULE['<{mokejimai}default>configuration_3f86574ad34d16a8cf2ba530c9aafee7'] = 'Šis modulis leidžia priimti mokėjimus per Mokėjimai.lt sistemą.';
-$_MODULE['<{mokejimai}default>configuration_b6af2d31afe71aedcceca73cc27fec29'] = 'Jeigu klientas pasirinks šį mokėjimo būdą, užsakymas pakeis savo būklę į \"Laukiama\" apmokėjimo';
-$_MODULE['<{mokejimai}default>configuration_aa9f04d1be872e3bdaca1cccf7f02d12'] = 'Mokėjimo modulio nustatymai';
-$_MODULE['<{mokejimai}default>configuration_f5f04b11870f0822cfc263fdc6214528'] = 'Įrašykite mokėjimai.lt modulio duomenis.';
-$_MODULE['<{mokejimai}default>configuration_e082f55a3e947645b3cfc4a3837564be'] = 'Mokėjimai.lt projekto ID';
-$_MODULE['<{mokejimai}default>configuration_ae71d10996c375bccc46d24665b318a9'] = 'Mokėjimai.lt projekto slaptažodis:';
-$_MODULE['<{mokejimai}default>configuration_2f1120281bc59dbf84f4b7d9f210b421'] = 'Testinis režimas?';
-$_MODULE['<{mokejimai}default>configuration_93cba07454f06a4a960172bbd6e2a435'] = 'Taip';
-$_MODULE['<{mokejimai}default>configuration_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Ne';
-$_MODULE['<{mokejimai}default>configuration_2f8251979372d44fa8e3df67202cbef1'] = 'Rodyti mokėjimo būdų pasirinkimą?';
-$_MODULE['<{mokejimai}default>configuration_49b80feb114d68c0b124c0129536bd02'] = 'Pradinė mokėjimo būdų pasirinkimo šalis';
-$_MODULE['<{mokejimai}default>configuration_b17f3f4dcf653a5776792498a9b44d6a'] = 'Atnaujinti nustatymus';
-$_MODULE['<{mokejimai}default>payment_execution_289148aed2fe892082cadcfd5c1e5805'] = 'Mokėjimai.lt mokėjimo būdas';
-$_MODULE['<{mokejimai}default>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Užsąkymo detalės:';
-$_MODULE['<{mokejimai}default>payment_execution_e0b4f8216cad5c2c286f08d187503ed0'] = 'Mokėjimai.lt mokėjimo būdas';
-$_MODULE['<{mokejimai}default>payment_execution_2d2b05368867f2d9b017e65ce9c1526a'] = 'Mokėjimai';
-$_MODULE['<{mokejimai}default>payment_execution_c047e6ab568a2227653f7d1d30bcf1c2'] = 'Jūs pasirinkote mokėti per Mokejimai.lt';
-$_MODULE['<{mokejimai}default>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Užsąkymo detalės:';
-$_MODULE['<{mokejimai}default>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Bendra užsąkymo suma';
-$_MODULE['<{mokejimai}default>payment_execution_48034ce5085e9fd93c65ce59966acf9e'] = 'Pakeikite mokėjimo šalį';
-$_MODULE['<{mokejimai}default>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Patvirtinti užsąkymą';
-$_MODULE['<{mokejimai}default>payment_8d0e94f6e1d030f33f8ce19548051b3d'] = 'Mokėti per Mokejimai.lt';
-$_MODULE['<{mokejimai}default>payment_3af059bc2293e9e46a898bdc659e0a0c'] = 'Mokėti per Mokejimai.lt (užsąkymas bus atliktas greičiau)';
-$_MODULE['<{mokejimai}default>payment_fb1b6ccdcee225de3d8caf01885d2204'] = 'Toliau >>';
diff --git a/mokejimai/views/templates/front/configuration.tpl b/mokejimai/views/templates/front/configuration.tpl
deleted file mode 100755
index 64df758..0000000
--- a/mokejimai/views/templates/front/configuration.tpl
+++ /dev/null
@@ -1,66 +0,0 @@
-
-{l s='This module allows you to accept payments by mokejimai.lt.' mod='mokejimai'}
-
-{l s='If the client chooses this payment mode, the order will change its status into a \'Waiting for payment\' status.' mod='mokejimai'}
-
-
-
-{if $messages ne ''}
- {foreach from=$messages item=message}
-
-

- {$message.msg}
-
- {/foreach}
-{/if}
-
-
\ No newline at end of file
diff --git a/mokejimai/views/templates/front/redirect.tpl b/mokejimai/views/templates/front/redirect.tpl
deleted file mode 100755
index 4663ac5..0000000
--- a/mokejimai/views/templates/front/redirect.tpl
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-...
-
-
diff --git a/mokejimai/views/templates/hook/payment.tpl b/mokejimai/views/templates/hook/payment.tpl
deleted file mode 100755
index 6cdd7eb..0000000
--- a/mokejimai/views/templates/hook/payment.tpl
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- {l s='Pay by Paysera.com/Mokejimai.lt (order process will be faster)' mod='mokejimai'}
- {l s='Continue >>' mod='mokejimai'}
-
-
\ No newline at end of file
diff --git a/mokejimai/views/templates/hook/payment_return.tpl b/mokejimai/views/templates/hook/payment_return.tpl
deleted file mode 100755
index 00e28bf..0000000
--- a/mokejimai/views/templates/hook/payment_return.tpl
+++ /dev/null
@@ -1,15 +0,0 @@
-{if $status == 'ok'}
- {l s='Your order on' mod='mokejimai'} {$shop_name} {l s='is complete.' mod='mokejimai'}
-
- Apmokėjimą už prekes gavome ir Jūsų užsakymas Nr. {$id_order} perduotas vykdymui.
-
- Užsakymą peržiūrėti galite paspaudę šią nuorodą.
-
- Apie tolimesnę užsakymo vykdymo eigą būsite informuoti elektroniniu paštu.
-
-{else}
-
- {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='mokejimai'}
- {l s='customer support' mod='mokejimai'}.
-
-{/if}
\ No newline at end of file
diff --git a/paysera/config.xml b/paysera/config.xml
new file mode 100644
index 0000000..c833989
--- /dev/null
+++ b/paysera/config.xml
@@ -0,0 +1,13 @@
+
+
+ paysera
+
+
+
+
+
+
+ 1
+ 1
+
+
\ No newline at end of file
diff --git a/paysera/controllers/front/callback.php b/paysera/controllers/front/callback.php
new file mode 100755
index 0000000..51619e8
--- /dev/null
+++ b/paysera/controllers/front/callback.php
@@ -0,0 +1,70 @@
+
+ * @copyright 2004-2014 EVP International, JSC
+ * @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+
+require_once(_PS_MODULE_DIR_.'/paysera/vendor/webtopay/libwebtopay/WebToPay.php');
+
+class PayseraCallbackModuleFrontController extends ModuleFrontController {
+ public $display_column_left = false;
+ public $display_column_right = false;
+ public $display_header = false;
+ public $display_footer = false;
+ public $ssl = true;
+
+ /**
+ * @see FrontController::postProcess()
+ */
+ public function postProcess()
+ {
+ try {
+ $response = WebToPay::checkResponse($_REQUEST, array(
+ 'projectid' => $this->module->project_id,
+ 'sign_password' => $this->module->signature,
+ ));
+
+ if ($response['status'] == 1)
+ {
+ $orderid = $response['orderid'];
+ $order = new Order($orderid);
+ $order_amount = $order->getOrdersTotalPaid();
+ $cart_currency = Currency::getCurrency($order->id_currency);
+
+ if (number_format($response['amount'], 0, '', '') < number_format(($order_amount * 100), 0, '', '')) exit('Bad amount: '.$response['amount']);
+
+ if ($response['currency'] != $cart_currency['iso_code']) exit('Bad currency: '.$response['currency']);
+
+ $history = new OrderHistory();
+ $history->id_order = $orderid;
+ $history->changeIdOrderState((int)Configuration::get('PS_OS_PAYMENT'), $response['orderid']);
+ $history->addWithemail(true, array(
+ 'order_name' => $orderid,
+ ));
+ exit('OK');
+ }
+ } catch (Exception $e) {
+ exit(get_class($e).': '.$e->getMessage());
+ }
+ }
+}
diff --git a/paysera/controllers/front/cancel.php b/paysera/controllers/front/cancel.php
new file mode 100755
index 0000000..1871737
--- /dev/null
+++ b/paysera/controllers/front/cancel.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+class PayseraCancelModuleFrontController extends ModuleFrontController {
+ /**
+ * @see FrontController::postProcess()
+ */
+ public function postProcess()
+ {
+ Tools::redirect('index.php?controller=order&step=1');
+ }
+}
diff --git a/paysera/controllers/front/index.php b/paysera/controllers/front/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/controllers/front/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/paysera/controllers/front/payment.php b/paysera/controllers/front/payment.php
new file mode 100755
index 0000000..4bf186e
--- /dev/null
+++ b/paysera/controllers/front/payment.php
@@ -0,0 +1,63 @@
+
+ * @copyright 2007-2014 Illicopresta
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+
+class PayseraPaymentModuleFrontController extends ModuleFrontController {
+ public $display_column_left = false;
+ public $ssl = true;
+
+ /**
+ * @see FrontController::initContent()
+ */
+ public function initContent()
+ {
+ parent::initContent();
+
+ $cart = $this->context->cart;
+ if (!$this->module->checkCurrency($cart)) Tools::redirect('index.php?controller=order');
+
+ $pay_currency = Context::getContext()->currency;
+ $pay_amount = $cart->getOrderTotal() * 100;
+
+ //siuo metu pasirinkta kalba
+ $language = Language::getIsoById($this->context->language->id);
+ $language = (!in_array($language, array('lt', 'en', 'ru'))) ? 'en' : $language;
+
+ $methods = WebToPay::getPaymentMethodList($this->module->project_id, $pay_currency->iso_code)->filterForAmount($pay_amount,
+ $pay_currency->iso_code)->setDefaultLanguage($language)->getCountries();
+
+ $this->context->smarty->assign(array(
+ 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/',
+ 'amount' => ($pay_amount / 100),
+ 'currency' => $pay_currency->iso_code,
+ 'displayPayments' => $this->module->payment_list,
+ 'isoCode' => $language, //Language::getIsoById(intval($cookie->id_lang)),
+ 'defaultCountry' => $this->module->default_country,
+ 'payMethods' => $methods,
+ ));
+
+ $this->setTemplate('payment_execution.tpl');
+ }
+}
diff --git a/paysera/controllers/front/redirect.php b/paysera/controllers/front/redirect.php
new file mode 100755
index 0000000..7a1b307
--- /dev/null
+++ b/paysera/controllers/front/redirect.php
@@ -0,0 +1,91 @@
+
+ * @copyright 2004-2014 EVP International, JSC
+ * @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+
+class PayseraRedirectModuleFrontController extends ModuleFrontController {
+ public $display_column_left = true;
+ public $display_column_right = true;
+ public $display_header = true;
+ public $display_footer = true;
+ public $ssl = true;
+
+ /**
+ * @see FrontController::initContent()
+ */
+ public function initContent()
+ {
+ parent::initContent();
+
+ $cart = $this->context->cart;
+ if (!$this->module->checkCurrency($cart)) Tools::redirect('index.php?controller=order');
+
+ $address = new Address((int)$cart->id_address_invoice);
+ $customer = new Customer((int)$cart->id_customer);
+ $country = new Country((int)$address->id_country);
+ $currency = Context::getContext()->currency;
+ $total = (float)number_format($cart->getOrderTotal(true, 3), 2, '.', '');
+ $language_code = Tools::strtoupper(Language::getIsoById((int)$this->context->language->id));
+ $url_language = ($language_code == 'LT') ? 'LIT' : 'ENG';
+
+ $this->module->validateOrder($cart->id, Configuration::get('PAYSERA_PENDING'), $total, $this->module->displayName, null, null, $currency->id);
+
+ try {
+ $request = WebToPay::buildRequest(array(
+ 'projectid' => $this->module->project_id,
+ 'sign_password' => $this->module->signature,
+
+ 'orderid' => $this->module->currentOrder,
+ 'amount' => (int)number_format($total, 2, '', ''),
+ 'currency' => $currency->iso_code,
+ 'lang' => ($language_code == 'LT') ? 'LTU' : 'ENG',
+ 'country' => $country->iso_code,
+ 'accepturl' => $this->context->link->getModuleLink('paysera', 'validation'),
+ 'cancelurl' => $this->context->link->getModuleLink('paysera', 'cancel'),
+ 'callbackurl' => $this->context->link->getModuleLink('paysera', 'callback'),
+ 'payment' => Tools::getValue('payment_method'),
+ 'p_firstname' => $customer->firstname,
+ 'p_lastname' => $customer->lastname,
+ 'p_email' => $customer->email,
+ 'p_street' => $address->address1,
+ 'p_city' => $address->city,
+ 'p_zip' => $address->postcode,
+ 'p_countrycode' => $country->iso_code,
+ 'test' => $this->module->sandbox,
+ 'delivery' => '',
+ 'system' => 'Prestashop 1.6',
+ 'component' => '',
+ ));
+ } catch (WebToPayException $e) {
+ echo get_class($e).': '.$e->getMessage();
+ }
+
+ $this->context->smarty->assign(array(
+ 'payUrl' => WebToPay::getPaymentUrl($url_language),
+ 'request' => $request,
+ ));
+
+ $this->setTemplate('redirect.tpl');
+ }
+}
diff --git a/paysera/controllers/front/validation.php b/paysera/controllers/front/validation.php
new file mode 100755
index 0000000..d17cb91
--- /dev/null
+++ b/paysera/controllers/front/validation.php
@@ -0,0 +1,43 @@
+
+ * @copyright 2007-2014 Illicopresta
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+
+class PayseraValidationModuleFrontController extends ModuleFrontController {
+ /**
+ * @see FrontController::postProcess()
+ */
+ public function postProcess()
+ {
+ $cart = $this->context->cart;
+ if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active)
+ Tools::redirect('index.php?controller=order&step=1');
+
+ $customer = new Customer($cart->id_customer);
+ if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1');
+
+ Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.
+ '&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
+ }
+}
diff --git a/paysera/controllers/index.php b/paysera/controllers/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/controllers/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/paysera/img/index.php b/paysera/img/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/img/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/mokejimai/img/logo-en.png b/paysera/img/logo-en.png
similarity index 100%
rename from mokejimai/img/logo-en.png
rename to paysera/img/logo-en.png
diff --git a/paysera/img/logo-lt.png b/paysera/img/logo-lt.png
new file mode 100755
index 0000000..448f886
Binary files /dev/null and b/paysera/img/logo-lt.png differ
diff --git a/paysera/img/order-logo.gif b/paysera/img/order-logo.gif
new file mode 100755
index 0000000..8500659
Binary files /dev/null and b/paysera/img/order-logo.gif differ
diff --git a/paysera/index.php b/paysera/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/mokejimai/img/order-logo.gif b/paysera/logo.gif
similarity index 75%
rename from mokejimai/img/order-logo.gif
rename to paysera/logo.gif
index 4cb058f..f1f8005 100755
Binary files a/mokejimai/img/order-logo.gif and b/paysera/logo.gif differ
diff --git a/paysera/paysera.php b/paysera/paysera.php
new file mode 100755
index 0000000..b1ba631
--- /dev/null
+++ b/paysera/paysera.php
@@ -0,0 +1,305 @@
+
+ * @copyright 2004-2014 EVP International, JSC
+ * @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+
+if (!defined('_PS_VERSION_'))
+ exit;
+
+require_once(_PS_MODULE_DIR_.'/paysera/vendor/webtopay/libwebtopay/WebToPay.php');
+
+class Paysera extends PaymentModule {
+
+ private $messages = array();
+
+ public $project_id;
+ public $signature;
+ public $sandbox;
+ public $payment_list;
+ public $default_country;
+
+ public function __construct()
+ {
+ $this->name = 'paysera';
+ $this->tab = 'payments_gateways';
+ $this->version = '1.6';
+ $this->author = 'EVP International';
+ $this->module_key = 'b830e1e952dfce7551c31477a86221af';
+
+ $config = Configuration::getMultiple(array(
+ 'PAYSERA_PROJECT_ID',
+ 'PAYSERA_SIGNATURE',
+ 'PAYSERA_SANDBOX',
+ 'PAYSERA_PAYMENTLIST',
+ 'PAYSERA_DEFAULT_COUNTRY'
+ ));
+
+ $this->project_id = self::setValue($config, 'PAYSERA_PROJECT_ID');
+ $this->signature = self::setValue($config, 'PAYSERA_SIGNATURE', '');
+ $this->sandbox = self::setValue($config, 'PAYSERA_SANDBOX');
+ $this->payment_list = self::setValue($config, 'PAYSERA_PAYMENTLIST', 1);
+ $this->default_country = self::setValue($config, 'PAYSERA_DEFAULT_COUNTRY', 'lt');
+
+ if (!$this->project_id) $this->project_id = '12345';
+
+ parent::__construct();
+
+ $this->page = basename(__FILE__, '.php');
+ $this->displayName = $this->l('Paysera');
+ $this->description = $this->l('Accept payments by Paysera system');
+ $this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
+
+ if (!isset($this->project_id) || !isset($this->signature))
+ $this->warning = $this->l('Project details must be configured in order to use this module correctly.');
+
+ if (!count(Currency::checkPaymentCurrencies($this->id))) $this->warning = $this->l('No currency set for this module');
+ }
+
+ public function install()
+ {
+ if (!parent::install() || !$this->registerHook('payment') || !$this->registerHook('paymentReturn')) return false;
+
+ /* add pending order state */
+ $order_pending = new OrderState();
+ $order_pending->name = array_fill(0, 10, 'AWAITING PAYSERA PAYMENT');
+ $order_pending->send_email = 0;
+ $order_pending->invoice = 0;
+ $order_pending->color = 'RoyalBlue';
+ $order_pending->unremovable = false;
+ $order_pending->logable = 0;
+
+ if ($order_pending->add()) copy(_PS_ROOT_DIR_.'/modules/paysera/img/order-logo.gif', _PS_ROOT_DIR_.'/img/os/'.(int)$order_pending->id.'.gif');
+
+ Configuration::updateValue('PAYSERA_PENDING', $order_pending->id);
+
+ return true;
+ }
+
+ public function uninstall()
+ {
+ $order_state_pending = new OrderState(Configuration::get('PAYSERA_PENDING'));
+
+ return (
+ Configuration::deleteByName('PAYSERA_PROJECT_ID') &&
+ Configuration::deleteByName('PAYSERA_SIGNATURE') &&
+ Configuration::deleteByName('PAYSERA_SANDBOX') &&
+ Configuration::deleteByName('PAYSERA_PAYMENTLIST') &&
+ Configuration::deleteByName('PAYSERA_DEFAULT_COUNTRY') &&
+ Configuration::deleteByName('PAYSERA_PENDING') &&
+ $order_state_pending->delete() &&
+ parent::uninstall()
+ );
+ }
+
+ private function validatePostRequest()
+ {
+ if (Tools::getValue('btnSubmit'))
+ {
+ $pro_id = Tools::getValue('project_id');
+ if (empty($pro_id))
+ {
+ $this->messages[] = array(
+ 'class' => 'warning warn',
+ 'src' => '../img/admin/warning.gif',
+ 'msg' => $this->l('Project ID is required!'),
+ );
+
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private function processPostRequest()
+ {
+ if (Tools::getValue('btnSubmit'))
+ {
+ Configuration::updateValue('PAYSERA_PROJECT_ID', (int)Tools::getValue('project_id'));
+ Configuration::updateValue('PAYSERA_SIGNATURE', Tools::getValue('signature'));
+ Configuration::updateValue('PAYSERA_SANDBOX', (int)Tools::getValue('sandbox'));
+ Configuration::updateValue('PAYSERA_PAYMENTLIST', (int)Tools::getValue('paymentList'));
+ Configuration::updateValue('PAYSERA_DEFAULT_COUNTRY', Tools::getValue('defaultCountry'));
+
+ $this->project_id = (int)Tools::getValue('project_id');
+ $this->signature = Tools::getValue('signature');
+ $this->sandbox = (int)Tools::getValue('sandbox');
+ $this->payment_list = (int)Tools::getValue('paymentList');
+ $this->default_country = Tools::getValue('defaultCountry');
+
+ $this->messages[] = array(
+ 'class' => 'conf confirm',
+ 'src' => '../img/admin/ok.gif',
+ 'msg' => $this->l('Settings updated'),
+ );
+ }
+ }
+
+ public function getContent()
+ {
+ if ($this->validatePostRequest()) $this->processPostRequest();
+
+ $methods = WebToPay::getPaymentMethodList($this->project_id)->setDefaultLanguage(
+ Language::getIsoById($this->context->language->id))->getCountries();
+
+ $this->smarty->assign(array(
+ 'messages' => $this->messages,
+ 'lang' => $this->context->language->id,
+ 'requestUrl' => $_SERVER['REQUEST_URI'],
+ 'projectId' => $this->project_id,
+ 'projectPass' => $this->signature,
+ 'defaultCountry' => $this->default_country,
+ 'sandboxOn' => ($this->sandbox) ? 'checked="checked"' : '',
+ 'sandboxOff' => (!$this->sandbox) ? 'checked="checked"' : '',
+ 'payListOn' => ($this->payment_list) ? 'checked="checked"' : '',
+ 'payListOff' => (!$this->payment_list) ? 'checked="checked"' : '',
+ 'countries' => $methods,
+ ));
+
+ return $this->display(__FILE__, 'views/templates/front/configuration.tpl');
+ }
+
+
+ /**
+ * NOT IMPLEMENTED
+ *
+ * @param int $order_id
+ * @return string
+ */
+ private function restoreOrder($order_id)
+ {
+ $order = new Order($order_id);
+
+ if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id)
+ {
+ try {
+ $request = WebToPay::buildRepeatRequest(array(
+ 'projectid' => $this->project_id,
+ 'sign_password' => $this->signature,
+ 'orderid' => $order_id,
+ ));
+ } catch (WebToPayException $e) {
+ echo get_class($e).':'.$e->getMessage();
+ }
+
+ $this->smarty->assign(array(
+ 'payUrl' => WebToPay::PAY_URL,
+ 'request' => $request,
+ ));
+
+ return $this->display(__FILE__, 'views/templates/front/restore.tpl');
+ }
+ else exit('Bad restore number!');
+ }
+
+ public function hookPayment()
+ {
+ $iso_code = $this->context->language->iso_code;
+ $this->smarty->assign(array(
+ 'lang' => $iso_code,
+ 'this_path' => $this->_path,
+ 'this_path_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').
+ htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name.'/'
+ ));
+
+ return $this->display(__FILE__, 'views/templates/hook/payment.tpl');
+ }
+
+ public function hookPaymentReturn($params)
+ {
+ $state = $params['objOrder']->getCurrentState();
+ if ($state == Configuration::get('PAYSERA_ACCEPTED') || $state == _PS_OS_OUTOFSTOCK_ || 1)
+ {
+ $this->smarty->assign(array(
+ 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false, null),
+ 'status' => 'ok',
+ 'id_order' => $params['objOrder']->id
+ ));
+ }
+ else
+ $this->smarty->assign('status', 'failed');
+
+ return $this->display(__FILE__, 'views/templates/front/payment_return.tpl');
+ }
+
+ /**
+ * @param int $id_currency : this parameter is optionnal but on 1.5 version of Prestashop, it will be REQUIRED
+ * @return Currency
+ */
+ public function getCurrency($current_id_currency = null)
+ {
+ if (!(int)$current_id_currency)
+ $current_id_currency = Context::getContext()->currency->id;
+
+ if (!$this->currencies)
+ return false;
+ if ($this->currencies_mode == 'checkbox')
+ {
+ $currencies = Currency::getPaymentCurrencies($this->id);
+ return $currencies;
+ }
+ elseif ($this->currencies_mode == 'radio')
+ {
+ $currencies = Currency::getPaymentCurrenciesSpecial($this->id);
+ $currency = $currencies['id_currency'];
+ if ($currency == -1)
+ $id_currency = (int)$current_id_currency;
+ elseif ($currency == -2)
+ $id_currency = (int)Configuration::get('PS_CURRENCY_DEFAULT'); else
+ $id_currency = $currency;
+ }
+ if (!isset($id_currency) || empty($id_currency))
+ return false;
+ return (new Currency($id_currency));
+ }
+
+ public function checkCurrency($cart)
+ {
+ $currency_order = new Currency($cart->id_currency);
+ $currencies_module = $this->getCurrency($cart->id_currency);
+
+ if (is_array($currencies_module))
+ foreach ($currencies_module as $currency_module) if ($currency_order->id == $currency_module['id_currency']) return true;
+
+ return false;
+ }
+
+ private static function setValue($config = array(), $value = '', $default = 0)
+ {
+ return (isset($config[$value])) ? $config[$value] : $default;
+ }
+
+ /**
+ * Debug function
+ *
+ * @param $var
+ */
+ private static function d($var)
+ {
+ echo '';
+ print_r($var);
+ echo '
';
+ }
+
+}
diff --git a/paysera/translations/en.php b/paysera/translations/en.php
new file mode 100755
index 0000000..3e08b37
--- /dev/null
+++ b/paysera/translations/en.php
@@ -0,0 +1,18 @@
+configuration_3f86574ad34d16a8cf2ba530c9aafee7'] = 'This module allows you to accept payments by Paysera';
+$_MODULE['<{paysera}default>configuration_b6af2d31afe71aedcceca73cc27fec29'] = 'If the client chooses this payment mode, the order will change its status into a \'Waiting for payment\' status.';
+$_MODULE['<{paysera}default>configuration_aa9f04d1be872e3bdaca1cccf7f02d12'] = 'Payment module details';
+$_MODULE['<{paysera}default>configuration_f5f04b11870f0822cfc263fdc6214528'] = 'Please specify the Paysera details';
+$_MODULE['<{paysera}default>configuration_e082f55a3e947645b3cfc4a3837564be'] = 'Paysera.com project ID:';
+$_MODULE['<{paysera}default>configuration_ae71d10996c375bccc46d24665b318a9'] = 'Paysera.com project passaword:';
+$_MODULE['<{paysera}default>configuration_2f1120281bc59dbf84f4b7d9f210b421'] = 'Test mode:';
+$_MODULE['<{paysera}default>configuration_93cba07454f06a4a960172bbd6e2a435'] = 'Yes';
+$_MODULE['<{paysera}default>configuration_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No';
+$_MODULE['<{paysera}default>configuration_2f8251979372d44fa8e3df67202cbef1'] = 'Display payments list:';
+$_MODULE['<{paysera}default>configuration_49b80feb114d68c0b124c0129536bd02'] = 'Default payment country:';
+$_MODULE['<{paysera}default>configuration_b17f3f4dcf653a5776792498a9b44d6a'] = 'Update settings';
+$_MODULE['<{paysera}default>payment_8d0e94f6e1d030f33f8ce19548051b3d'] = 'Pay by Paysera';
+$_MODULE['<{paysera}default>payment_3af059bc2293e9e46a898bdc659e0a0c'] = 'Pay by Paysera (order process will be faster) ';
diff --git a/paysera/translations/index.php b/paysera/translations/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/translations/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/paysera/translations/lt.php b/paysera/translations/lt.php
new file mode 100755
index 0000000..5b2de6d
--- /dev/null
+++ b/paysera/translations/lt.php
@@ -0,0 +1,71 @@
+mokejimai_2d2b05368867f2d9b017e65ce9c1526a'] = 'Paysera.lt';
+$_MODULE['<{paysera}default>mokejimai_e0355bb27ba85e136a8eddc1d95ada91'] = 'Prrimti mokėjimus per Paysera.lt sistemą';
+$_MODULE['<{paysera}default>mokejimai_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Ar tikrai norite ištrinti nustatymus';
+$_MODULE['<{paysera}default>mokejimai_ef6222485ff756bb929a8dfc9c722ea9'] = 'Turi būti suvesti projekto nustatymai, kad veiktų teisingai apmokėjimas.';
+$_MODULE['<{paysera}default>mokejimai_4402acab1c8f90dcf4a31dc96833bd86'] = 'Nepasirinkta valiuta šiame modulyje';
+$_MODULE['<{paysera}default>mokejimai_b4ba0005dcd53932c2b8106963281b62'] = 'Privaloma įvesti projekto ID';
+$_MODULE['<{paysera}default>mokejimai_c888438d14855d7d96a2724ee9c306bd'] = 'Nustatymai atnaujinti';
+$_MODULE['<{paysera}default>configuration_3f86574ad34d16a8cf2ba530c9aafee7'] = 'Šis modulis leidžia priimti mokėjimus per Mokėjimai.lt sistemą.';
+$_MODULE['<{paysera}default>configuration_b6af2d31afe71aedcceca73cc27fec29'] = 'Jeigu klientas pasirinks šį mokėjimo būdą, užsakymas pakeis savo būklę į \"Laukiama\" apmokėjimo';
+$_MODULE['<{paysera}default>configuration_aa9f04d1be872e3bdaca1cccf7f02d12'] = 'Mokėjimo modulio nustatymai';
+$_MODULE['<{paysera}default>configuration_f5f04b11870f0822cfc263fdc6214528'] = 'Įrašykite mokėjimai.lt modulio duomenis.';
+$_MODULE['<{paysera}default>configuration_e082f55a3e947645b3cfc4a3837564be'] = 'Paysera.lt projekto ID';
+$_MODULE['<{paysera}default>configuration_ae71d10996c375bccc46d24665b318a9'] = 'Paysera.lt projekto slaptažodis:';
+$_MODULE['<{paysera}default>configuration_2f1120281bc59dbf84f4b7d9f210b421'] = 'Testinis režimas?';
+$_MODULE['<{paysera}default>configuration_93cba07454f06a4a960172bbd6e2a435'] = 'Taip';
+$_MODULE['<{paysera}default>configuration_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Ne';
+$_MODULE['<{paysera}default>configuration_2f8251979372d44fa8e3df67202cbef1'] = 'Rodyti mokėjimo būdų pasirinkimą?';
+$_MODULE['<{paysera}default>configuration_49b80feb114d68c0b124c0129536bd02'] = 'Pradinė mokėjimo būdų pasirinkimo šalis';
+$_MODULE['<{paysera}default>configuration_b17f3f4dcf653a5776792498a9b44d6a'] = 'Atnaujinti nustatymus';
+$_MODULE['<{paysera}default>payment_execution_289148aed2fe892082cadcfd5c1e5805'] = 'Paysera.lt mokėjimo būdas';
+$_MODULE['<{paysera}default>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Užsąkymo detalės:';
+$_MODULE['<{paysera}default>payment_execution_e0b4f8216cad5c2c286f08d187503ed0'] = 'Paysera.lt mokėjimo būdas';
+$_MODULE['<{paysera}default>payment_execution_2d2b05368867f2d9b017e65ce9c1526a'] = 'Mokėjimai';
+$_MODULE['<{paysera}default>payment_execution_c047e6ab568a2227653f7d1d30bcf1c2'] = 'Jūs pasirinkote mokėti per Mokejimai.lt';
+$_MODULE['<{paysera}default>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Užsąkymo detalės:';
+$_MODULE['<{paysera}default>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Bendra užsąkymo suma';
+$_MODULE['<{paysera}default>payment_execution_48034ce5085e9fd93c65ce59966acf9e'] = 'Pakeikite mokėjimo šalį';
+$_MODULE['<{paysera}default>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Patvirtinti užsąkymą';
+$_MODULE['<{paysera}default>payment_8d0e94f6e1d030f33f8ce19548051b3d'] = 'Mokėti per Paysera.lt';
+$_MODULE['<{paysera}default>payment_3af059bc2293e9e46a898bdc659e0a0c'] = 'Mokėti per Paysera.lt (užsąkymas bus atliktas greičiau)';
+$_MODULE['<{paysera}default>payment_fb1b6ccdcee225de3d8caf01885d2204'] = 'Toliau >>';
+$_MODULE['<{paysera}prestashop>paysera_b246b83153b335903d29fae121e0e75c'] = 'Paysera';
+$_MODULE['<{paysera}prestashop>paysera_19e3b9538dc6293bc44f2b70245b924c'] = 'Gauti mokėjimus per Paysera ';
+$_MODULE['<{paysera}prestashop>paysera_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Ar tikrai norite ištrinti duomenis?';
+$_MODULE['<{paysera}prestashop>paysera_ef6222485ff756bb929a8dfc9c722ea9'] = 'Projekto informacija turi įvesta, norint naudoti modulį.';
+$_MODULE['<{paysera}prestashop>paysera_4402acab1c8f90dcf4a31dc96833bd86'] = 'Nėra priskirtos valiutos šiam moduliui.';
+$_MODULE['<{paysera}prestashop>paysera_b4ba0005dcd53932c2b8106963281b62'] = 'Projekto ID yra privalomas';
+$_MODULE['<{paysera}prestashop>paysera_c888438d14855d7d96a2724ee9c306bd'] = 'Nustatymai atnaujinti';
+$_MODULE['<{paysera}prestashop>configuration_1114e078142b1c96114ff8c129ab8b31'] = 'Šis modulis leis gauti mokėjimus per Paysera';
+$_MODULE['<{paysera}prestashop>configuration_b6af2d31afe71aedcceca73cc27fec29'] = 'Jei klientas apmokės per payserą, užsakymo statusas bus \"Laukiamas apmokėjimas\"';
+$_MODULE['<{paysera}prestashop>configuration_aa9f04d1be872e3bdaca1cccf7f02d12'] = 'Mokėjimo būdo informacija';
+$_MODULE['<{paysera}prestashop>configuration_bf2ae895e3cc22f3232cc3b76cf1ea12'] = 'Patikslinkite informaciją';
+$_MODULE['<{paysera}prestashop>configuration_bfe77056046f0cd49d88c469f8abbe18'] = 'Projekto ID:';
+$_MODULE['<{paysera}prestashop>configuration_ae71d10996ccc375bccc46d24665b318a9'] = 'Projekto slaptažodis:';
+$_MODULE['<{paysera}prestashop>configuration_2f1120281bc59dbf84f4b7d9f210b421'] = 'Testavimo režimas:';
+$_MODULE['<{paysera}prestashop>configuration_93cba07454f06a4a960172bbd6e2a435'] = 'Taip';
+$_MODULE['<{paysera}prestashop>configuration_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Ne';
+$_MODULE['<{paysera}prestashop>configuration_2f8251979372d44fa8e3df67202cbef1'] = 'Atvaizduoti mokėjimo būdus:';
+$_MODULE['<{paysera}prestashop>configuration_49b80feb114d68c0b124c0129536bd02'] = 'Šalis pagal nutylėjimą:';
+$_MODULE['<{paysera}prestashop>configuration_b17f3f4dcf653a5776792498a9b44d6a'] = 'Atnaujintį nustatymus';
+$_MODULE['<{paysera}prestashop>payment_execution_289148aed2fe892082cadcfd5c1e5805'] = 'Paysera mokėjimo būdas';
+$_MODULE['<{paysera}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Užsakymo detalės';
+$_MODULE['<{paysera}prestashop>payment_execution_ba26c386695bf530997971eb4005c0a5'] = 'Paysera mokėjimo būdas';
+$_MODULE['<{paysera}prestashop>payment_execution_b246b83153b335903d29fae121e0e75c'] = 'Paysera';
+$_MODULE['<{paysera}prestashop>payment_execution_086ce42431bcf38825ea2c06fbb4b395'] = 'Jūs pasirinkote apmokėti per Paysera';
+$_MODULE['<{paysera}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Jūsų užsakymo detalės:';
+$_MODULE['<{paysera}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Bendra užsakymo suma ';
+$_MODULE['<{paysera}prestashop>payment_execution_48034ce5085e9fd93c65ce59966acf9e'] = 'Pasirinkite mokėjimo šalį';
+$_MODULE['<{paysera}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Kiti mokėjimo būdai';
+$_MODULE['<{paysera}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Patvirtinu užsakymą';
+$_MODULE['<{paysera}prestashop>redirect_fb1b6ccdcee225de3d8caf01885d2204'] = 'Tęsti >>';
+$_MODULE['<{paysera}prestashop>payment_7bb6728c85d67886c2da0b9fc433d85a'] = 'Mokėti per Paysera';
+$_MODULE['<{paysera}prestashop>payment_17def51ac90b26b3cbb0fb8d105ef18b'] = 'apmokėsite greičiau';
+$_MODULE['<{paysera}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'jūsų užsakymas ';
+$_MODULE['<{paysera}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'baigtas.';
+$_MODULE['<{paysera}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Pastebėjome problemą su Jūsų užsakymu, susisiekite su mūsų';
+$_MODULE['<{paysera}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'klientų pagalbos skyriumi.';
diff --git a/mokejimai/translations/ru.php b/paysera/translations/ru.php
similarity index 100%
rename from mokejimai/translations/ru.php
rename to paysera/translations/ru.php
diff --git a/paysera/vendor/index.php b/paysera/vendor/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/vendor/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/paysera/vendor/webtopay/index.php b/paysera/vendor/webtopay/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/vendor/webtopay/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/mokejimai/vendor/webtopay/libwebtopay/.hgignore b/paysera/vendor/webtopay/libwebtopay/.hgignore
similarity index 100%
rename from mokejimai/vendor/webtopay/libwebtopay/.hgignore
rename to paysera/vendor/webtopay/libwebtopay/.hgignore
diff --git a/mokejimai/vendor/webtopay/libwebtopay/.hgtags b/paysera/vendor/webtopay/libwebtopay/.hgtags
similarity index 100%
rename from mokejimai/vendor/webtopay/libwebtopay/.hgtags
rename to paysera/vendor/webtopay/libwebtopay/.hgtags
diff --git a/mokejimai/vendor/webtopay/libwebtopay/WebToPay.php b/paysera/vendor/webtopay/libwebtopay/WebToPay.php
similarity index 100%
rename from mokejimai/vendor/webtopay/libwebtopay/WebToPay.php
rename to paysera/vendor/webtopay/libwebtopay/WebToPay.php
diff --git a/paysera/vendor/webtopay/libwebtopay/index.php b/paysera/vendor/webtopay/libwebtopay/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/vendor/webtopay/libwebtopay/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/paysera/views/index.php b/paysera/views/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/views/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/paysera/views/templates/front/configuration.tpl b/paysera/views/templates/front/configuration.tpl
new file mode 100755
index 0000000..e9cc528
--- /dev/null
+++ b/paysera/views/templates/front/configuration.tpl
@@ -0,0 +1,90 @@
+{*
+* 2007-2014 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author EVP International, JSC
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+{l s='This module allows you to accept payments by Paysera.' mod='paysera'}
+
+{l s='If the client chooses this payment mode, the order will change its status into a \'Waiting for payment\' status.' mod='paysera'}
+
+
+
+{if $messages ne ''}
+ {foreach from=$messages item=message}
+
+

+ {$message.msg|escape:'quotes'}
+
+ {/foreach}
+{/if}
+
+
diff --git a/paysera/views/templates/front/index.php b/paysera/views/templates/front/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/views/templates/front/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/mokejimai/views/templates/front/payment_execution.tpl b/paysera/views/templates/front/payment_execution.tpl
similarity index 59%
rename from mokejimai/views/templates/front/payment_execution.tpl
rename to paysera/views/templates/front/payment_execution.tpl
index 2dcbe1b..516d62d 100755
--- a/mokejimai/views/templates/front/payment_execution.tpl
+++ b/paysera/views/templates/front/payment_execution.tpl
@@ -1,3 +1,27 @@
+{*
+* 2007-2014 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author EVP International, JSC
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+...
+
+
diff --git a/paysera/views/templates/hook/index.php b/paysera/views/templates/hook/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/views/templates/hook/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;
diff --git a/paysera/views/templates/hook/payment.tpl b/paysera/views/templates/hook/payment.tpl
new file mode 100755
index 0000000..c8ab2a6
--- /dev/null
+++ b/paysera/views/templates/hook/payment.tpl
@@ -0,0 +1,34 @@
+{*
+* 2007-2014 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author EVP International, JSC
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
diff --git a/paysera/views/templates/hook/payment_return.tpl b/paysera/views/templates/hook/payment_return.tpl
new file mode 100755
index 0000000..9835db3
--- /dev/null
+++ b/paysera/views/templates/hook/payment_return.tpl
@@ -0,0 +1,39 @@
+{*
+* 2007-2014 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author EVP International, JSC
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+{if $status == 'ok'}
+ {l s='Your order on' mod='paysera'} {$shop_name|escape:'quotes'} {l s='is complete.' mod='paysera'}
+
+ Apmokėjimą už prekes gavome ir Jūsų užsakymas Nr. {$id_order|escape:'quotes'} perduotas vykdymui.
+
+ Užsakymą peržiūrėti galite paspaudę šią nuorodą.
+
+ Apie tolimesnę užsakymo vykdymo eigą būsite informuoti elektroniniu paštu.
+
+{else}
+
+ {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='paysera'}
+ {l s='customer support' mod='paysera'}.
+
+{/if}
diff --git a/paysera/views/templates/index.php b/paysera/views/templates/index.php
new file mode 100755
index 0000000..e62f4c7
--- /dev/null
+++ b/paysera/views/templates/index.php
@@ -0,0 +1,35 @@
+
+* @copyright 2004-2014 EVP International, JSC
+* @license http://opensource.org/licenses/GPL-3.0 GNU GENERAL PUBLIC LICENSE (GPL-3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+
+header("Location: ../");
+exit;