first commit
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stPolcardPlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stPolcardPlugin 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 stPolcardPlugin
|
||||
* @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 stPolcardFrontendActions
|
||||
*
|
||||
* @package stPolcardPlugin
|
||||
* @subpackage actions
|
||||
*/
|
||||
class stPolcardFrontendActions extends stActions
|
||||
{
|
||||
/**
|
||||
* Pozytywny powrót z płatności
|
||||
*/
|
||||
public function executeReturnSuccess()
|
||||
{
|
||||
$this->smarty = new stSmarty($this->getModuleName());
|
||||
|
||||
$params = $this->getRequest()->getParameterHolder()->getAll();
|
||||
|
||||
$this->processResponse($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Brak autoryzacji płatności
|
||||
*/
|
||||
public function executeReturnFail()
|
||||
{
|
||||
$this->smarty = new stSmarty($this->getModuleName());
|
||||
|
||||
$webpage = WebpagePeer::retrieveByState('CONTACT');
|
||||
|
||||
if ($webpage)
|
||||
{
|
||||
sfLoader::loadHelpers(array('Helper', 'stUrl'));
|
||||
$this->smarty->assign('contact_url', st_url_for('stWebpageFrontend/index?url='.$webpage->getFriendlyUrl()));
|
||||
}
|
||||
}
|
||||
|
||||
public function executeStatusReport()
|
||||
{
|
||||
$params = $this->getRequest()->getParameterHolder()->getAll();
|
||||
|
||||
return $this->renderText($this->processResponse($params));
|
||||
}
|
||||
|
||||
protected function processResponse($params)
|
||||
{
|
||||
$api = new stPolcard();
|
||||
|
||||
stPayment::log('payeezy', json_encode($params, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE));
|
||||
|
||||
if ($api->isValid($params) && isset($params['order_id']) && isset($params['response_code']) && in_array($params['response_code'], array(30, 35)))
|
||||
{
|
||||
$order = OrderPeer::retrieveByNumber($params['order_id']);
|
||||
|
||||
if ($order)
|
||||
{
|
||||
$payment = $order->getOrderPayment();
|
||||
|
||||
if ($payment)
|
||||
{
|
||||
$payment->setStatus(1);
|
||||
$payment->save();
|
||||
stPayment::log('payeezy', sprintf("Zamówienie o numerze \"%s\" zostało opłacone", $params['order_id']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$log = sprintf("Zamówienie o numerze \"%s\" nie posiada płatności", $params['order_id']);
|
||||
stPayment::log('payeezy', $log);
|
||||
return $log;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$log = sprintf("Zamówienie o numerze \"%s\" nie istnieje", $params['order_id']);
|
||||
stPayment::log('payeezy', $log);
|
||||
return $log;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$log = "Brak zgodności sum kontrolnych";
|
||||
stPayment::log('payeezy', $log);
|
||||
return $log;
|
||||
}
|
||||
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stPolcardPlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stPolcardPlugin 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 stPolcardPlugin
|
||||
* @subpackage actions
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: components.class.php 10 2009-08-24 09:32:18Z michal $
|
||||
* @author Michal Prochowski <michal.prochowski@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasa stPolcardFrontendComponents
|
||||
*
|
||||
* @package stPolcardPlugin
|
||||
* @subpackage actions
|
||||
*/
|
||||
class stPolcardFrontendComponents extends sfComponents {
|
||||
|
||||
/**
|
||||
* Pokazywanie formularza płatności
|
||||
*/
|
||||
public function executeShowPayment() {
|
||||
$this->smarty = new stSmarty('stPolcardFrontend');
|
||||
|
||||
|
||||
$order = stPaymentType::getOrderInSummary();
|
||||
|
||||
$api = new stPolcard();
|
||||
$params = $api->getFormParams($order);
|
||||
|
||||
$this->smarty->assign('params', $params);
|
||||
$this->smarty->assign('url', $api->getUrl());
|
||||
$this->smarty->assign('check_configuration', $api->checkPaymentConfiguration());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
st_theme_use_stylesheet('stPayment.css');
|
||||
|
||||
$smarty->display('polcard_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('polcard_return_fail_error.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('polcard_return_fail.html');
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
st_theme_use_stylesheet('stPayment.css');
|
||||
$smarty->display('polcard_return_success.html');
|
||||
@@ -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. Wystąpił błąd autoryzacji."}
|
||||
</p>
|
||||
</div>
|
||||
@@ -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. Wystąpił błąd spowodowany brakiem autoryzacji."}
|
||||
</p>
|
||||
</div>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,30 @@
|
||||
{if $check_configuration}
|
||||
<div id="st_box_payment">
|
||||
<p>{__ text="Kliknij przycisk"} <b>{__ text='"Zapłać"'}</b> {__ text="aby przejść do serwisu Polcard."}</p>
|
||||
<p><img id="st_home" src="/images/frontend/theme/default/stPolcardPlugin/logo.jpg" alt=""/></p>
|
||||
{$form_start}
|
||||
{$hidden_order_id}
|
||||
{$hidden_pos_id}
|
||||
{$hidden_amount}
|
||||
{$hidden_language}
|
||||
{$hidden_email}
|
||||
{$hidden_test}
|
||||
{$hidden_client_ip}
|
||||
{$hidden_street}
|
||||
{$hidden_street_n1}
|
||||
{$hidden_street_n2}
|
||||
{$hidden_city}
|
||||
{$hidden_postcode}
|
||||
{$hidden_country}
|
||||
<div id="st_form-payment-submit" class="st_button-container">
|
||||
<div class="st_button st_align-right">
|
||||
<div class="st_button-left">
|
||||
{$pay_submit}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{else}
|
||||
{__ text="Płatność została błędnie skonfigurowana."}
|
||||
{/if}
|
||||
@@ -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. Wystąpił błąd autoryzacji."}</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,18 @@
|
||||
{if $check_configuration}
|
||||
<div id="st_box_payment">
|
||||
<img id="st_home" src="/images/frontend/theme/default2/stPolcardPlugin/logo.png" alt=""/>
|
||||
<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,25 @@
|
||||
{set layout="one_column"}
|
||||
|
||||
{set layout="one_column"}
|
||||
<div id="payment">
|
||||
<div class="panel panel-default center-block">
|
||||
<div class="panel-heading">
|
||||
{__ text="Payeezy"}
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<p>
|
||||
<img src="/images/frontend/theme/default2/stPolcardPlugin/logo.png" alt="{__ text="Payeezy"}"/>
|
||||
</p>
|
||||
<p>
|
||||
{__ text="Płatność nie została zrealizowana."}
|
||||
</p>
|
||||
{if $contact_url}
|
||||
<p>
|
||||
<a href="{$contact_url}" class="btn btn-primary">
|
||||
{__ text="Skontaktuj się z nami"}
|
||||
</a>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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="Polcard"}
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<p>
|
||||
{__ text="Płatność nie została zrealizowana. Wystąpił błąd spowodowany brakiem autoryzacji."}<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,14 @@
|
||||
{set layout="one_column"}
|
||||
|
||||
<div id="payment">
|
||||
<div class="panel panel-default center-block">
|
||||
<div class="panel-heading">
|
||||
{__ text="Payeezy"}
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<img src="/images/frontend/theme/default2/stPolcardPlugin/logo.png" alt="{__ text="Payeezy"}"/>
|
||||
<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,25 @@
|
||||
<div id="payment">
|
||||
<div class="panel panel-default center-block">
|
||||
<div class="panel-heading">
|
||||
{__ text="Payeezy"}
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
{if $check_configuration}
|
||||
<img src="/images/frontend/theme/default2/stPolcardPlugin/logo.png" alt="{__ text="Payeezy"}"/>
|
||||
<div>
|
||||
{$description}
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
Reference in New Issue
Block a user