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,56 @@
<?php
class stMoneybookersBackendActions extends stActions
{
/**
* Wyświetla konfigurację modułu
*/
public function executeIndex()
{
$this->config = stConfig::getInstance('stMoneybookersBackend');
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
$this->config->setFromRequest('moneybookers');
$this->config->save();
$this->setFlash('notice', 'Twoje zmiany zostały zapisane');
}
$i18n = $this->getContext()->getI18n();
$this->labels = array(
'moneybookers{pay_to_email}' => $i18n->__('Login'),
'moneybookers{secret_word}' => $i18n->__('Słowo podpowiedzi'),
'moneybookers{shop_description}' => $i18n->__('Opis sklepu'),
'moneybookers{return_text}' => $i18n->__('Tekst przycisku powrotu do sklepu'),
);
$this->config->load();
}
public function validateIndex()
{
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
stAuthUsersListener::checkModificationCredentials($this, $this->getRequest(), $this->getModuleName());
}
return true;
}
public function handleErrorIndex()
{
$this->config = stConfig::getInstance('stMoneybookersBackend');
$this->config->setFromRequest('moneybookers');
$this->webRequest = new stWebRequest();
$i18n = $this->getContext()->getI18n();
$this->labels = array(
'moneybookers{pay_to_email}' => $i18n->__('Login'),
'moneybookers{secret_word}' => $i18n->__('Słowo podpowiedzi'),
'moneybookers{shop_description}' => $i18n->__('Opis sklepu'),
'moneybookers{return_text}' => $i18n->__('Tekst przycisku powrotu do sklepu'),
);
return sfView::SUCCESS;
}
}

View File

@@ -0,0 +1,13 @@
<?php
class stMoneybookersBackendComponents extends sfComponents
{
public function executeListMenu()
{
}
}
?>

View File

@@ -0,0 +1,19 @@
<div class="list-menu">
<ul>
<li class="selected">
<?php echo link_to(__('Skrill'),'stMoneybookersBackend/index')?>
</li>
<li>
<?php if (sfContext::getInstance()->getUser()->getCulture() == 'pl_PL'): ?>
<a href="https://www.sote.pl/docs/skrill" target="_blank"><?php echo __('Dokumentacja'); ?></a>
<?php else: ?>
<a href="https://www.soteshop.com/docs/skrill" target="_blank"><?php echo __('Documentation'); ?></a>
<?php endif; ?>
</li>
</ul>
</div>
<div class="clr"></div>

View File

@@ -0,0 +1,23 @@
<?php use_helper('stAdminGenerator');?>
<?php use_stylesheet('backend/stMoneybookersPlugin.css');?>
<?php echo st_get_admin_head('stMoneybookersPlugin', __('Skrill'), null, array('stPayment'));?>
<?php st_view_slot_start('application-menu') ?>
<?php st_include_component('stMoneybookersBackend', 'listMenu') ?>
<?php st_view_slot_end() ?>
<?php st_include_partial('stAdminGenerator/message', array('labels' => $labels)); ?>
<?php echo form_tag('moneybookers/index', array('id' => 'sf_admin_config_form', 'name' => 'sf_admin_config_form', 'class' => 'admin_form', 'autocomlete' => 'off'));?>
<fieldset >
<div class="content">
<?php echo st_admin_get_form_field('moneybookers[pay_to_email]', __('Login'), $config->get('pay_to_email'), 'input_tag', array('required' => true, 'autocomplete' => "off",'size' => '60')) ?>
<?php echo st_admin_get_form_field('moneybookers[secret_word]', __('Słowo podpowiedzi'), $config->get('secret_word'), 'input_tag', array('required' => true, 'autocomplete' => "off",'size' => '60')) ?>
<?php echo st_admin_get_form_field('moneybookers[shop_description]', __('Opis sklepu'), $config->get('shop_description'), 'input_tag', array('required' => true, 'autocomplete' => "off",'size' => '60')) ?>
<?php echo st_admin_get_form_field('moneybookers[return_text]', __('Tekst przycisku powrotu do sklepu'), $config->get('return_text'), 'input_tag', array('help'=>__('Maksymalnie 35 znaków.'),'required' => true, 'autocomplete' => "off",'maxlength' => '35','size' => '60')) ?>
</fieldset>
<?php echo st_get_admin_actions(array(
array('type' => 'save', 'label' => __('Zapisz', null, 'stAdminGeneratorPlugin'))
)) ?>
</form>
<div class="clr"></div>
<?php echo st_get_admin_foot();?>

View File

@@ -0,0 +1,13 @@
fields:
moneybookers{pay_to_email}:
required:
msg: Proszę uzupełnić pole.
moneybookers{secret_word}:
required:
msg: Proszę uzupełnić pole.
moneybookers{shop_description}:
required:
msg: Proszę uzupełnić pole.
moneybookers{return_text}:
required:
msg: Proszę uzupełnić pole.

View File

@@ -0,0 +1,81 @@
<?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 stMoneybookersFrontendActions extends stActions
{
/**
* 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()
{
$this->setLayout(false);
$requestMerchantId = $this->getRequestParameter('merchant_id');
$requestTransactionId = $this->getRequestParameter('transaction_id');
$requestMbAmount = $this->getRequestParameter('mb_amount');
$requestMbCurrency = $this->getRequestParameter('mb_currency');
$requestStatus = $this->getRequestParameter('status');
$requestMd5sig = $this->getRequestParameter('md5sig');
$requestHash = $this->getRequestParameter('hash');
$stMoneybookers = new stMoneybookers();
$shopMd5sig = strtoupper(md5($requestMerchantId.$requestTransactionId.strtoupper(md5($stMoneybookers->getSecretWord())).$requestMbAmount.$requestMbCurrency.$requestStatus));
if ($requestMd5sig == $shopMd5sig)
{
$stPayment = new stPayment();
switch ($requestStatus) {
case -2: // błędna
$stPayment->cancelPayment($requestHash);
break;
case -1: // anulowana
$stPayment->cancelPayment($requestHash);
break;
case 0: // nowa
break;
case 2: // zaakceptowana
$stPayment->confirmPayment($requestHash);
break;
}
}
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* SOTESHOP/stMoneybookersPlugin
*
* Ten plik należy do aplikacji stMoneybookersPlugin 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 stMoneybookersPlugin
* @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 stMoneybookersFrontendComponents
*
* @package stMoneybookersPlugin
* @subpackage actions
*/
class stMoneybookersFrontendComponents extends sfComponents
{
/**
* Pokazywanie formularza płatności
*/
public function executeShowPayment()
{
$this->smarty = new stSmarty('stMoneybookersFrontend');
if (stPaymentType::hasOrderInSummary())
{
$this->stMoneybookers = new stMoneybookers();
$this->stWebRequest = new stWebRequest();
$this->order = stPaymentType::getOrderInSummary();
$this->user = $this->order->getOrderUserDataBilling();
$this->lang = stPaymentType::getLanguage();
$this->hash = stPaymentType::getPaymentHash($this->order->getId());
$this->country = stPaymentType::getCountry($this->user);
}
}
}

View File

@@ -0,0 +1,34 @@
<?php
st_theme_use_stylesheet('stPayment.css');
$smarty->assign("check_configuration",$stMoneybookers->checkPaymentConfiguration());
if ($stMoneybookers->checkPaymentConfiguration())
{
$smarty->assign("form_start", form_tag($stMoneybookers->getUrl(), array('class' => 'st_form')));
$smarty->assign("input_pay_to_email", input_hidden_tag('pay_to_email', $stMoneybookers->getPayToEmail()));
$smarty->assign("input_recipient_description", input_hidden_tag('recipient_description', $stMoneybookers->getShopDescription()));
$smarty->assign("input_transaction_id", input_hidden_tag('transaction_id', $order->getId()));
$smarty->assign("input_return_url", input_hidden_tag('return_url', 'http://'.$stWebRequest->getHost().'/moneybookers/returnSuccess'));
$smarty->assign("input_return_url_text", input_hidden_tag('return_url_text', $stMoneybookers->getReturnText()));
$smarty->assign("input_cancel_url", input_hidden_tag('cancel_url', 'http://'.$stWebRequest->getHost().'/moneybookers/returnFail'));
$smarty->assign("input_status_url", input_hidden_tag('status_url', 'http://'.$stWebRequest->getHost().'/moneybookers/statusReport'));
$smarty->assign("input_language", input_hidden_tag('language', $lang));
$smarty->assign("input_firstname", input_hidden_tag('firstname', $user->getName()));
$smarty->assign("input_lastname", input_hidden_tag('lastname', $user->getSurname()));
$smarty->assign("input_address", input_hidden_tag('address', $user->getStreet().' '.$user->getHouse().''.$user->getFlat()));
$smarty->assign("input_postal_code", input_hidden_tag('postal_code', $user->getCode()));
$smarty->assign("input_city", input_hidden_tag('city', $user->getTown()));
$smarty->assign("input_country", input_hidden_tag('country', $country->getIsoA3()));
$smarty->assign("input_amount", input_hidden_tag('amount', $stMoneybookers->getOrderAmount(stPayment::getUnpayedAmountByOrder($order))));
$smarty->assign("input_currency", input_hidden_tag('currency', $order->getOrderCurrency()->getShortcut()));
$smarty->assign("input_detail1_description", input_hidden_tag('detail1_description', __('Numer zamówienia:')));
$smarty->assign("input_detail1_text", input_hidden_tag('detail1_text', $order->getId()));
$smarty->assign("input_merchant_fields", input_hidden_tag('merchant_fields', 'hash, referring_platform'));
$smarty->assign("input_hash", input_hidden_tag('hash', $hash));
$smarty->assign("input_referring_platform", input_hidden_tag('referring_platform', 'SOTESHOP'));
$smarty->assign("input_hide_login", input_hidden_tag('hide_login', 1));
$smarty->assign("input_pay_from_email", input_hidden_tag('pay_from_email', $order->getGuardUser()->getUsername()));
$smarty->assign("input_payment_methods", input_hidden_tag('payment_methods', "ACC,PWY,"));
$smarty->assign("submit_button", submit_tag(__('Zapłać')));
$smarty->assign("description", stPaymentType::getSummaryDescriptionByOrderIdAndHash($order->getId()));
}
$smarty->display("moneybookers_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("moneybookers_return_fail.html");

View File

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

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,45 @@
{if $check_configuration}
<div id="st_box_payment">
<img id="st_home" src="/images/frontend/theme/default2/stMoneybookersPlugin/logo_with_bank.png" alt=""/><br />
<span>
{$description}
</span>
{$form_start}
{$input_pay_to_email}
{$input_recipient_description}
{$input_transaction_id}
{$input_return_url}
{$input_return_url_text}
{$input_cancel_url}
{$input_status_url}
{$input_language}
{$input_firstname}
{$input_lastname}
{$input_address}
{$input_postal_code}
{$input_city}
{$input_country}
{$input_amount}
{$input_currency}
{$input_detail1_description}
{$input_detail1_text}
{$input_merchant_fields}
{$input_hash}
{$input_referring_platform}
{$input_hide_login}
{$input_pay_from_email}
{$input_payment_methods}
<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}
<div id="st_box_payment">
<p><img id="st_home" src="/images/frontend/theme/default2/stMoneybookersPlugin/logo_with_bank.png" alt=""/></p>
{__ text="Płatność została błędnie skonfigurowana."}
</div>
{/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="Skrill"}
</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="Skrill"}
</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,44 @@
<div class="panel panel-default center-block">
<div class="panel-heading">
{__ text="Skrill"}
</div>
<div class="panel-body text-center">
{if $check_configuration}
<img src="/images/frontend/theme/default2/stMoneybookersPlugin/logo_with_bank.png" alt="{__ text="Skrill"}"/><br />
<span>
{$description}
</span>
{$form_start}
{$input_pay_to_email}
{$input_recipient_description}
{$input_transaction_id}
{$input_return_url}
{$input_return_url_text}
{$input_cancel_url}
{$input_status_url}
{$input_language}
{$input_firstname}
{$input_lastname}
{$input_address}
{$input_postal_code}
{$input_city}
{$input_country}
{$input_amount}
{$input_currency}
{$input_detail1_description}
{$input_detail1_text}
{$input_merchant_fields}
{$input_hash}
{$input_referring_platform}
{$input_hide_login}
{$input_pay_from_email}
{$input_payment_methods}
<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>