first commit
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
<?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: actions.class.php 10 2009-08-24 09:32:18Z michal $
|
||||
* @author Michal Prochowski <michal.prochowski@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasa stDotpayFrontendActions
|
||||
*
|
||||
* @package stDotpayPlugin
|
||||
* @subpackage actions
|
||||
*/
|
||||
class stDotpayFrontendActions 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('stDotpayFrontend', 'returnSuccess');
|
||||
}
|
||||
}
|
||||
$this->forward('stDotpayFrontend', '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()
|
||||
{
|
||||
$api = new stDotpay();
|
||||
|
||||
if ($api->verifySignature($this->getRequest()))
|
||||
{
|
||||
$order_id = $this->getRequestParameter('order_id');
|
||||
$order_hash = $this->getRequestParameter('hash');
|
||||
|
||||
$order = OrderPeer::retrieveByIdAndHashCode($order_id, $order_hash);
|
||||
|
||||
if (null !== $order)
|
||||
{
|
||||
$payment = $order->getOrderPayment();
|
||||
|
||||
if (null !== $payment)
|
||||
{
|
||||
if ($this->getRequestParameter('operation_status') == 'completed')
|
||||
{
|
||||
$payment->setStatus(true);
|
||||
$payment->save();
|
||||
stPayment::log('dotpay', "Status Report (order_id: $order_id) - Order paid successfully");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stPayment::log('dotpay', "Status Report (order_id: $order_id) - Missing payment instance");
|
||||
|
||||
return $this->renderText('Missing payment instance');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stPayment::log('dotpay', "Status Report (order_id: $order_id) - Missing order instance");
|
||||
|
||||
return $this->renderText('Missing order instance');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stPayment::log('dotpay', "Status Report (order_id: $order_id) - Wrong signature for params: " . var_export($this->getRequest()->getParameterHolder()->getAll(), true));
|
||||
|
||||
return $this->renderText('Wrong signature');
|
||||
}
|
||||
|
||||
return $this->renderText('OK');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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 15922 2011-11-03 08:43:32Z michal $
|
||||
* @author Michal Prochowski <michal.prochowski@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasa stDotpayFrontendComponents
|
||||
*
|
||||
* @package stDotpayPlugin
|
||||
* @subpackage actions
|
||||
*/
|
||||
class stDotpayFrontendComponents extends sfComponents
|
||||
{
|
||||
/**
|
||||
* Pokazywanie formularza płatności
|
||||
*/
|
||||
public function executeShowPayment()
|
||||
{
|
||||
$this->smarty = new stSmarty('stDotpayFrontend');
|
||||
|
||||
$api = new stDotpay();
|
||||
|
||||
$this->smarty->assign('params', $api->getParams($this->order));
|
||||
$this->smarty->assign('url', $api->getUrl());
|
||||
$this->smarty->assign('check_configuration', $api->checkPaymentConfiguration());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
st_theme_use_stylesheet('stPayment.css');
|
||||
$smarty->display("dotpay_show_payment.html");
|
||||
@@ -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("dotpay_return_fail.html");
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
st_theme_use_stylesheet('stPayment.css');
|
||||
$smarty->display("dotpay_return_success.html");
|
||||
@@ -0,0 +1 @@
|
||||
<?php $smarty->display("dotpay_status_report.html");
|
||||
@@ -0,0 +1,4 @@
|
||||
<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>
|
||||
@@ -0,0 +1,4 @@
|
||||
<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>
|
||||
@@ -0,0 +1,42 @@
|
||||
{if $check_configuration}
|
||||
<div id="st_box_payment">
|
||||
<p>{__ text="Kliknij przycisk"} <b>{__ text='"Zapłać"'}</b> {__ text="aby przejść do serwisu Dotpay."}</p>
|
||||
<p><img id="st_home" src="/images/frontend/theme/default/stDotpayPlugin/logo.jpg" alt=""/></p>
|
||||
{$form_start}
|
||||
{$input_id}
|
||||
{$input_currency}
|
||||
{$input_amount}
|
||||
{$input_description}
|
||||
{$input_lang}
|
||||
{$input_channel}
|
||||
{$input_ch_lock}
|
||||
{$input_onlinetransfer}
|
||||
{$input_url}
|
||||
{$input_type}
|
||||
{$input_buttontext}
|
||||
{$input_urlc}
|
||||
{$input_control}
|
||||
{$input_firstname}
|
||||
{$input_lastname}
|
||||
{$input_email}
|
||||
{$input_street}
|
||||
{$input_street_n1}
|
||||
{$input_street_n2}
|
||||
{$input_city}
|
||||
{$input_postcode}
|
||||
{$input_phone}
|
||||
{$input_country}
|
||||
{$input_p_info}
|
||||
{$input_p_email}
|
||||
<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}
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,21 @@
|
||||
{if $check_configuration}
|
||||
<div id="st_box_payment">
|
||||
<img id="st_home" src="/images/frontend/theme/default2/stDotpayPlugin/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}
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -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="Dotpay"}
|
||||
</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>
|
||||
@@ -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="Dotpay"}
|
||||
</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>
|
||||
@@ -0,0 +1,23 @@
|
||||
<div class="panel panel-default center-block">
|
||||
<div class="panel-heading">
|
||||
{__ text="Dotpay"}
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
{if $check_configuration}
|
||||
<img src="/images/frontend/theme/default2/stDotpayPlugin/logo.jpg" alt="{__ text="Dotpay"}"/><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>
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
Reference in New Issue
Block a user