first commit

This commit is contained in:
2025-01-06 20:47:25 +01:00
commit 3bdbd78c2f
25591 changed files with 3586440 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2013 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 PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 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;

View File

@@ -0,0 +1,50 @@
<?php
class SantandercreditSantanderCreditReturnModuleFrontController extends ModuleFrontController {
public function __construct() {
parent::__construct();
}
public function initContent() {
parent::initContent();
$returnTemplate = 'santanderCreditReturn.tpl';
$errors = '';
if (Tools::getValue('orderId') != 0 && Tools::getValue('id_wniosku') != '') {
$order = new Order(Tools::getValue('orderId'));
if ($order) {
$orderPaymentCollection = $order->getOrderPaymentCollection();
$payment = $orderPaymentCollection->getFirst();
if ($payment) {
$payment->transaction_id = Tools::getValue('id_wniosku');
$payment->save();
$this->context->smarty->assign(
array('wniosekId' => preg_replace('#[^0-9/ZAG]#', '', $_GET['id_wniosku']),
'orderId' => (int) $_GET['orderId']
)
);
// $returnTemplate = 'santanderCreditReturn.tpl';
} else {
$errors .= "Błąd w trakcie aktualizacji numeru transakcji (transactionId, wniosekId).";
$this->context->smarty->assign(array('errors' => $errors, 'wniosekId' => preg_replace('#[^0-9/ZAG]#', '', $_GET['id_wniosku']),
'orderId' => $_GET['orderId']));
$returnTemplate = 'paymentErrors.tpl';
}
} else {
$errors .= "Błędny numer zamówienia w sklepie (orderId).";
$this->context->smarty->assign(array('errors' => $errors, 'wniosekId' => preg_replace('#[^0-9/ZAG]#', '', $_GET['id_wniosku']),
'orderId' => $_GET['orderId']));
$returnTemplate = 'paymentErrors.tpl';
}
} else {
$errors .= "Nieokreślony numer wniosku lub numer zamówienia w odpowiedzi Banku (orderId, id_wniosku).";
$this->context->smarty->assign(array('errors' => $errors));
$returnTemplate = 'paymentErrors.tpl';
}
$this->setTemplate('module:santandercredit/views/templates/front/'.$returnTemplate);
}
}

View File

@@ -0,0 +1,49 @@
<?php
class santandercreditsantanderCreditValidateModuleFrontController extends ModuleFrontController {
public function initContent() {
parent::initContent();
$santanderCredit = new SantanderCredit();
$santanderCredit->execValidation();
$this->setTemplate('santanderCreditValidate.tpl');
}
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');
// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
$authorized = false;
foreach (Module::getPaymentModules() as $module)
if ($module['name'] == 'santandercredit') {
$authorized = true;
break;
}
if (!$authorized)
die('NOT AUTHORIZED: santanderCreditValidate');
$customer = new Customer($cart->id_customer);
if (!Validate::isLoadedObject($customer))
Tools::redirect('index.php?controller=order&step=1');
/*
$currency = $this->context->currency;
$total = (float) $cart->getOrderTotal(true, Cart::BOTH);
$this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $this->module->displayName, NULL, $mailVars, (int) $currency->id, false, $customer->secure_key);
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);
*/
$currency = $this->context->currency;
$total = floatval(number_format($cart->getOrderTotal(true, 3), 2, '.', ''));
$useOrderState = Configuration::get('SANTANDERCREDIT_USE_ORDER_STATE');
$this->module->validateOrder($cart->id, (int) Configuration::get($useOrderState), $total, $this->module->displayName, NULL, NULL, $currency->id, false, $customer->secure_key);
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);
}
}
?>

View File

@@ -0,0 +1,31 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* http://localhost/presta/prestashop_1.7.1.0/module/santandercredit/test
*/
class SantandercreditTestModuleFrontController extends ModuleFrontController {
public function __construct(){
parent::__construct();
}
public function initContent(){
parent::initContent();
$mess = Tools::getValue('orderId');
$this->context->smarty->assign('test', 'to tylko test '. $mess);
$this->setTemplate('module:santandercredit/views/templates/front/test.tpl');
}
public function postProcess()
{
// global $smarty;
// $templatePath = dirname(__FILE__).'/../../views/templates/front/test.tpl';
// $smarty->assign(array(
// 'test' => 'to tylko test'
// ));
// $smarty->display($templatePath);
}
}