Files
hutko/controllers/front/redirect.php
2025-05-29 10:54:49 +03:00

48 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Hutko - Платіжний сервіс, який рухає бізнеси вперед.
*
* Запускайтесь, набирайте темп, масштабуйтесь ми підстрахуємо всюди.
*
* @author panariga
* @copyright 2025 Hutko
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Class HutkoRedirectModuleFrontController
*
* @property \Hutko $module
*/
class HutkoRedirectModuleFrontController extends ModuleFrontController
{
/**
* Initializes the content of the redirect page for the Hutko payment gateway.
*
* This method is responsible for preparing the necessary data and assigning
* it to the Smarty template that handles the redirection to the Hutko payment
* service. It calls the parent class's `initContent` method first and then
* assigns the Hutko checkout URL and the payment input parameters to the template.
*/
public function initContent()
{
// Call the parent class's initContent method to perform default initializations.
parent::initContent();
// Assign Smarty variables to be used in the redirect template.
$this->context->smarty->assign([
'hutko_url' => $this->module->checkout_url, // The URL of the Hutko payment gateway.
'hutko_inputs' => $this->module->buildInputs(), // An array of input parameters required by Hutko.
]);
// Set the template to be used for displaying the redirection form.
$this->setTemplate('module:' . $this->module->name . '/views/templates/front/redirect.tpl');
}
}