Skip to content

Commit

Permalink
kkiapay plugin for prestashop 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
barbeblance committed Jul 27, 2019
1 parent e023ff1 commit 6d68c43
Show file tree
Hide file tree
Showing 37 changed files with 906 additions and 1,352 deletions.
21 changes: 0 additions & 21 deletions Readme.md

This file was deleted.

13 changes: 13 additions & 0 deletions config_fr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>kkiapay</name>
<displayName><![CDATA[kkiapay]]></displayName>
<version><![CDATA[1.0.0]]></version>
<description><![CDATA[kkiaPay permet aux entreprises de recevoir des paiements en toute s&eacute;curit&eacute; via de l&#039;argent mobile, une carte de cr&eacute;dit ou un compte bancaire.]]></description>
<author><![CDATA[kkiapay]]></author>
<tab><![CDATA[payments_gateways]]></tab>
<confirmUninstall><![CDATA[Voulez-vous désinstaller kkiapay]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>
61 changes: 0 additions & 61 deletions controllers/front/api.php

This file was deleted.

91 changes: 0 additions & 91 deletions controllers/front/confirmation.php

This file was deleted.

69 changes: 35 additions & 34 deletions controllers/front/index.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
<?php
/**
* 2007-2019 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 [email protected] 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 PrestaShop SA <[email protected]>
* @copyright 2007-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;
<?php
/*
* 2007-2016 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 [email protected] 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 PrestaShop SA <[email protected]>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 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;
Expand Down
69 changes: 69 additions & 0 deletions controllers/front/payment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
/*
* 2007-2016 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 [email protected] 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 PrestaShop SA <[email protected]>
* @copyright 2007-2016 PrestaShop SA
* @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 KkiapayPaymentModuleFrontController extends ModuleFrontController
{
public $ssl = true;
public $display_column_left = false;

/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();


$cart = $this->context->cart;
$customer = new Customer($cart->id_customer);
//var_dump($cart);
if (!$this->module->checkCurrency($cart))
Tools::redirect('index.php?controller=order');

$this->context->smarty->assign(array(
'api' => Configuration::get('KKIAPAY_PUBLIC'),
'color' => Configuration::get('KKIAPAY_COLOR'),
'position' => Configuration::get('KKIAPAY_POSITION'),
'test' => Configuration::get('KKIAPAY_CHECKBOX'),
'lastname' => $customer->lastname,
'firstname' => $customer->firstname,
'nbProducts' => $cart->nbProducts(),
'cust_currency' => $cart->id_currency,
'num_cart' => $cart->id,
'currencies' => $this->module->getCurrency((int)$cart->id_currency),
'date' => $cart->date_upd,
'price' => $cart->getOrderTotal(true, Cart::BOTH),
'this_path' => $this->module->getPathUri(),
'this_path_bw' => $this->module->getPathUri(),
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
));

$this->setTemplate('payment_execution.tpl');
}
}
Loading

0 comments on commit 6d68c43

Please sign in to comment.