first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
<?php
/**
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Klasa stEcardFrontendActions
*
* @package stEcardPlugin
* @subpackage actions
*/
class stEcardFrontendActions extends stActions
{
/**
* Pozytywny powrót z płatności
*/
public function executeReturn()
{
if ($this->getRequest()->hasParameter('status'))
{
if($this->getRequest()->getParameter('status') == 'OK')
{
$this->forward('stEcardFrontend', 'returnSuccess');
}
}
$this->forward('stEcardFrontend', 'returnFail');
}
/**
* Pozytywny powrót z płatności
*/
public function executeReturnSuccess()
{
$this->smarty = new stSmarty($this->getModuleName());
}
/**
* Negatywny powrót z płatności
*/
public function executeReturnFail()
{
$this->smarty = new stSmarty($this->getModuleName());
$this->contactPage = WebpagePeer::retrieveByState('CONTACT');
}
/**
* Odbieranie statusu transakcji
*/
public function executeStatusReport()
{
$state = $this->getRequestParameter('CURRENTSTATE');
if ($state == 'payment_deposited' || $state == 'payment_closed' || $state == 'transfer_closed')
{
if ($this->getRequestParameter('hash') == stEcard::getPostSecureHash())
{
$id = $this->getRequestParameter('ORDERNUMBER');
$transaction = EcardTransactionPeer::retrieveByPK($id);
$transaction_id = $transaction ? $transaction->getOrderId() : $id;
$order = OrderPeer::retrieveByPK($transaction_id);
if ($order && $order->getOrderPayment())
{
$order->getOrderPayment()->setStatus(1);
$order->getOrderPayment()->setTransactionId($transaction_id);
$order->getOrderPayment()->save();
}
}
}
return $this->renderText('OK');
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* SOTESHOP/stDotpayPlugin
*
* Ten plik należy do aplikacji stDotpayPlugin opartej na licencji (Professional License SOTE).
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stDotpayPlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/sote (Professional License SOTE)
* @version $Id: components.class.php 12055 2011-04-05 11:36:39Z michal $
* @author Michal Prochowski <michal.prochowski@sote.pl>
*/
/**
* Klasa stDotpayFrontendComponents
*
* @package stDotpayPlugin
* @subpackage actions
*/
class stEcardFrontendComponents extends sfComponents
{
/**
* Pokazywanie formularza płatności
*/
public function executeShowPayment()
{
$this->smarty = new stSmarty('stEcardFrontend');
if (stPaymentType::hasOrderInSummary())
{
$this->stEcard = new stEcard();
$this->stWebRequest = new stWebRequest();
$this->order = stPaymentType::getOrderInSummary();
$this->user = $this->order->getOrderUserDataBilling();
$this->lang = stPaymentType::getLanguage(array('PL', 'EN', 'DE', 'FR', 'RU', 'CZ', 'IT', 'ES'));
$this->hash = stPaymentType::getPaymentHash($this->order->getId());
$this->country = stPaymentType::getCountry($this->user);
$this->currency = stPaymentType::getCurrency($this->order->getId());
/**
* Pobieranie hash
*/
// $postParameters = array( 'orderNumber' => $this->order->getId(),
// 'orderDescription' => '',
// 'amount' => $this->stEcard->getOrderAmount(stPayment::getUnpayedAmountByOrder($this->order)),
// 'currency' => $this->currency->getCode(),
// 'merchantId' => $this->stEcard->getEcardId(),
// 'password' => $this->stEcard->getEcardPassword(),
// );
// $b = new sfWebBrowser(array(), 'sfCurlAdapter', array('ssl_verify' => false));
// $b->post($this->stEcard->getHashUrl(), $postParameters);
// $this->hash = trim($b->getResponseText());
$this->params = $this->stEcard->getPaymentParams($this->order);
}
}
}

View File

@@ -0,0 +1,38 @@
<?php
st_theme_use_stylesheet('stPayment.css');
$smarty->assign("check_configuration",$stEcard->checkPaymentConfiguration());
$smarty->assign('url', 'https://pay.ecard.pl/payment/PS');
if ($stEcard->checkPaymentConfiguration())
{
// if ($stEcard->getTest())
// {
// $smarty->assign("form_start", form_tag($stEcard->getTestUrl(), array('class' => 'st_form')));
// }else
// {
// $smarty->assign("form_start", form_tag($stEcard->getUrl(), array('class' => 'st_form')));
// }
// $smarty->assign("input_order_number", input_hidden_tag('ORDERNUMBER', $order->getId()));
// $smarty->assign("input_merchant_id", input_hidden_tag('MERCHANTID', $stEcard->getEcardId()));
// $smarty->assign("input_order_description", input_hidden_tag('ORDERDESCRIPTION', $order->getId()));
// $smarty->assign("input_amount", input_hidden_tag('AMOUNT', $stEcard->getOrderAmount(stPayment::getUnpayedAmountByOrder($order))));
// $smarty->assign("input_currency", input_hidden_tag('CURRENCY', $currency->getCode()));
// $smarty->assign("input_session_id", input_hidden_tag('SESSIONID', $hash));
// $smarty->assign("input_name", input_hidden_tag('NAME', $user->getName()));
// $smarty->assign("input_surname", input_hidden_tag('SURNAME', $user->getSurname()));
// $smarty->assign("input_autodeposit", input_hidden_tag('AUTODEPOSIT', '1'));
// $smarty->assign("input_bin", input_hidden_tag('BIN', ''));
// $smarty->assign("input_language", input_hidden_tag('LANGUAGE', $lang));
// $smarty->assign("input_charset", input_hidden_tag('CHARSET', 'UTF-8'));
// $smarty->assign("input_country", input_hidden_tag('COUNTRY', '616'));
// $smarty->assign("input_js", input_hidden_tag('JS', '1'));
// $smarty->assign("input_hash", input_hidden_tag('HASH', $hash));
// $smarty->assign("input_payment_type", input_hidden_tag('PAYMENTTYPE', $stEcard->getPaymentType()));
// $smarty->assign("input_link_fail", input_hidden_tag('LINKFAIL', 'http://'.$stWebRequest->getHost().'/ecard/returnFail?'));
// $smarty->assign("input_link_ok", input_hidden_tag('LINKOK', 'http://'.$stWebRequest->getHost().'/ecard/returnSuccess?'));
// $smarty->assign("input_transparent_pages", input_hidden_tag('TRANSPARENTPAGES', '0'));
// $smarty->assign("submit_button", submit_tag(__('Zapłać')));
// $smarty->assign("description", stPaymentType::getSummaryDescriptionByOrderIdAndHash($order->getId()));
$smarty->assign('params', $params);
}
$smarty->display("ecard_show_payment.html");
?>

View File

@@ -0,0 +1,4 @@
<?php
st_theme_use_stylesheet('stPayment.css');
$smarty->assign('contactLink', is_object($contactPage) ? url_for('stWebpageFrontend/index?url='.$contactPage->getFriendlyUrl()) : null);
$smarty->display("ecard_return_fail.html");

View File

@@ -0,0 +1,3 @@
<?php
st_theme_use_stylesheet('stPayment.css');
$smarty->display("ecard_return_success.html");

View File

@@ -0,0 +1,8 @@
<div class="st_application">
<h1 class="st_title">
{__ text="Płatność"}
</h1>
<p style="text-align: center; margin-bottom: 20px;">
{__ text="Płatność nie została zrealizowana."}
</p>
</div>

View File

@@ -0,0 +1,8 @@
<div class="st_application">
<h1 class="st_title">
{__ text="Płatność"}
</h1>
<p style="text-align: center; margin-bottom: 20px;">
{__ text="Dziękujemy za dokonanie płatności."}
</p>
</div>

View File

@@ -0,0 +1,36 @@
{if $check_configuration}
<div id="st_box_payment">
<p>{__ text="Kliknij przycisk"} <b>{__ text='"Zapłać"'}</b> {__ text="aby przejść do serwisu eCard."}</p>
<p><img id="st_home" src="/images/frontend/theme/default/stEcardPlugin/logo.jpg" alt=""/></p>
{$form_start}
{$input_order_number}
{$input_merchant_id}
{$input_order_description}
{$input_amount}
{$input_currency}
{$input_session_id}
{$input_name}
{$input_surname}
{$input_autodeposit}
{$input_bin}
{$input_language}
{$input_charset}
{$input_country}
{$input_js}
{$input_hash}
{$input_payment_type}
{$input_link_fail}
{$input_link_ok}
{$input_transparent_pages}
<div id="st_form-payment-submit" class="st_button-container">
<div class="st_button st_align-right">
<div class="st_button-left">
{$submit_button}
</div>
</div>
</div>
</form>
</div>
{else}
{__ text="Płatność została błędnie skonfigurowana."}
{/if}

View File

@@ -0,0 +1,8 @@
<div id="stPayment_return" class="box roundies">
<div class="title">
<h2>{__ text="Płatność"}</h2>
</div>
<div class="content">
<p>{__ text="Płatność nie została zrealizowana."}</p>
</div>
</div>

View File

@@ -0,0 +1,8 @@
<div id="stPayment_return" class="box roundies">
<div class="title">
<h2>{__ text="Płatność"}</h2>
</div>
<div class="content">
<p>{__ text="Dziękujemy za dokonanie płatności."}</p>
</div>
</div>

View File

@@ -0,0 +1,21 @@
{if $check_configuration}
<div id="st_box_payment">
<img id="st_home" src="/images/frontend/theme/default2/stEcardPlugin/logo.jpg" alt=""/><br />
<span>
{$description}
</span>
<form action="{$url}" method="post">
{foreach key=name item=value from=$params}
<input type="hidden" name="{$name}" value="{$value}" />
{/foreach}
<div class="buttons right">
<button type="submit" class="important roundies">
<span class="arrow_right">{__ text="Zapłać"}</span>
</button>
</div>
<br class="clear" />
</form>
</div>
{else}
{__ text="Płatność została błędnie skonfigurowana."}
{/if}

View File

@@ -0,0 +1,20 @@
{set layout="one_column"}
<div id="payment">
<div class="title">
<h1>{__ text="Płatność"}</h1>
</div>
<div class="panel panel-default center-block">
<div class="panel-heading">
{__ text="eCard"}
</div>
<div class="panel-body text-center">
<p>
{__ text="Płatność nie została zrealizowana."}<br/>
{__ text="Skontaktuj się z nami." langCatalogue="stPayment"}
</p>
{if $contactLink}
<a href="{$contactLink}" class="btn btn-primary">{__ text="Kontakt" langCatalogue="stPayment"}</a>
{/if}
</div>
</div>
</div>

View File

@@ -0,0 +1,15 @@
{set layout="one_column"}
<div id="payment">
<div class="title">
<h1>{__ text="Płatność"}</h1>
</div>
<div class="panel panel-default center-block">
<div class="panel-heading">
{__ text="eCard"}
</div>
<div class="panel-body text-center">
<p>{__ text="Dziękujemy za dokonanie płatności."}</p>
<a href="/" class="btn btn-primary">{__ text="Wróć do zakupów" langCatalogue="stPayment"}</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<div class="panel panel-default center-block">
<div class="panel-heading">
{__ text="eCard"}
</div>
<div class="panel-body text-center">
{if $check_configuration}
<img src="/images/frontend/theme/default2/stEcardPlugin/logo.jpg" alt="{__ text="eCard"}"/><br />
<span>
{$description}
</span>
<form action="{$url}" method="post">
{foreach key=name item=value from=$params}
<input type="hidden" name="{$name}" value="{$value}" />
{/foreach}
<button type="submit" class="btn btn-primary pull-right">
{__ text="Zapłać"}
</button>
</form>
{else}
{__ text="Płatność została błędnie skonfigurowana."}
{/if}
</div>
</div>