Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit 9baa1d1

Browse files
committed
init
1 parent 044a44f commit 9baa1d1

File tree

22 files changed

+639
-0
lines changed

22 files changed

+639
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Created by .ignore support plugin (hsz.mobi)

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Prestashop
2+
3+
Module for payment via mobile app [Trisbee](https://www.trisbee.com/#zakaznik).
4+
5+
Tested on 1.6.1.5.
6+
7+
# Installation
8+
9+
@todo

app/config.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<module>
3+
<name>trisbee</name>
4+
<displayName><![CDATA[Trisbee]]></displayName>
5+
<version><![CDATA[1.0.0]]></version>
6+
<description><![CDATA[Accept Trisbee payments]]></description>
7+
<author><![CDATA[PrestaShop]]></author>
8+
<tab><![CDATA[payments_gateways]]></tab>
9+
<is_configurable>0</is_configurable>
10+
<need_instance>1</need_instance>
11+
<limited_countries></limited_countries>
12+
</module>

app/config_cs.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<module>
3+
<name>trisbee</name>
4+
<displayName><![CDATA[Trisbee]]></displayName>
5+
<version><![CDATA[1.0.0]]></version>
6+
<description><![CDATA[Accept Trisbee payments]]></description>
7+
<author><![CDATA[Trisbee]]></author>
8+
<tab><![CDATA[payments_gateways]]></tab>
9+
<is_configurable>0</is_configurable>
10+
<need_instance>1</need_instance>
11+
<limited_countries></limited_countries>
12+
</module>

app/controllers/front/index.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/*
3+
* 2007-2016 PrestaShop
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Academic Free License (AFL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/afl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18+
* versions in the future. If you wish to customize PrestaShop for your
19+
* needs please refer to http://www.prestashop.com for more information.
20+
*
21+
* @author PrestaShop SA <[email protected]>
22+
* @copyright 2007-2016 PrestaShop SA
23+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24+
* International Registered Trademark & Property of PrestaShop SA
25+
*/
26+
27+
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
28+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
29+
30+
header("Cache-Control: no-store, no-cache, must-revalidate");
31+
header("Cache-Control: post-check=0, pre-check=0", false);
32+
header("Pragma: no-cache");
33+
34+
header("Location: ../");
35+
exit;
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
/*
3+
* 2007-2016 PrestaShop
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Academic Free License (AFL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/afl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18+
* versions in the future. If you wish to customize PrestaShop for your
19+
* needs please refer to http://www.prestashop.com for more information.
20+
*
21+
* @author PrestaShop SA <[email protected]>
22+
* @copyright 2007-2016 PrestaShop SA
23+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24+
* International Registered Trademark & Property of PrestaShop SA
25+
*/
26+
27+
/**
28+
* @since 1.5.0
29+
*/
30+
class TrisbeeValidationModuleFrontController extends ModuleFrontController
31+
{
32+
public $ssl = true;
33+
public $display_column_left = false;
34+
35+
public function postProcess()
36+
{
37+
if ($this->context->cart->id_customer == 0 || $this->context->cart->id_address_delivery == 0 || $this->context->cart->id_address_invoice == 0 || !$this->module->active)
38+
Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1');
39+
40+
// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
41+
$authorized = false;
42+
foreach (Module::getPaymentModules() as $module)
43+
if ($module['name'] == 'trisbee')
44+
{
45+
$authorized = true;
46+
break;
47+
}
48+
if (!$authorized)
49+
die(Tools::displayError('This payment method is not available.'));
50+
51+
$customer = new Customer($this->context->cart->id_customer);
52+
if (!Validate::isLoadedObject($customer))
53+
Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1');
54+
55+
if (Tools::getValue('confirm'))
56+
{
57+
$customer = new Customer((int)$this->context->cart->id_customer);
58+
$total = $this->context->cart->getOrderTotal(true, Cart::BOTH);
59+
$this->module->validateOrder((int)$this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);
60+
Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->module->id.'&id_order='.(int)$this->module->currentOrder);
61+
}
62+
}
63+
64+
/**
65+
* @see FrontController::initContent()
66+
*/
67+
public function initContent()
68+
{
69+
parent::initContent();
70+
71+
$this->context->smarty->assign(array(
72+
'total' => $this->context->cart->getOrderTotal(true, Cart::BOTH),
73+
'this_path' => $this->module->getPathUri(),//keep for retro compat
74+
'this_path_trisbee' => $this->module->getPathUri(),
75+
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
76+
));
77+
78+
$this->setTemplate('validation.tpl');
79+
}
80+
}

app/controllers/index.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/*
3+
* 2007-2016 PrestaShop
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Academic Free License (AFL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/afl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18+
* versions in the future. If you wish to customize PrestaShop for your
19+
* needs please refer to http://www.prestashop.com for more information.
20+
*
21+
* @author PrestaShop SA <[email protected]>
22+
* @copyright 2007-2016 PrestaShop SA
23+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24+
* International Registered Trademark & Property of PrestaShop SA
25+
*/
26+
27+
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
28+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
29+
30+
header("Cache-Control: no-store, no-cache, must-revalidate");
31+
header("Cache-Control: post-check=0, pre-check=0", false);
32+
header("Pragma: no-cache");
33+
34+
header("Location: ../");
35+
exit;

app/index.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/*
3+
* 2007-2016 PrestaShop
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Academic Free License (AFL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/afl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18+
* versions in the future. If you wish to customize PrestaShop for your
19+
* needs please refer to http://www.prestashop.com for more information.
20+
*
21+
* @author PrestaShop SA <[email protected]>
22+
* @copyright 2007-2016 PrestaShop SA
23+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24+
* International Registered Trademark & Property of PrestaShop SA
25+
*/
26+
27+
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
28+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
29+
30+
header("Cache-Control: no-store, no-cache, must-revalidate");
31+
header("Cache-Control: post-check=0, pre-check=0", false);
32+
header("Pragma: no-cache");
33+
34+
header("Location: ../");
35+
exit;

app/logo.gif

425 Bytes
Loading

app/logo.png

1.33 KB
Loading

0 commit comments

Comments
 (0)