first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
|
||||
class stSantanderRatyBackendActions extends autoStSantanderRatyBackendActions
|
||||
{
|
||||
public function validateConfig()
|
||||
{
|
||||
if ($this->getRequest()->getMethod() == sfRequest::POST)
|
||||
{
|
||||
$data = $this->getRequestParameter('config');
|
||||
|
||||
if (isset($data['shop_number']) && empty($data['shop_number']))
|
||||
{
|
||||
$this->getRequest()->setError('config{shop_number}', 'Proszę uzupełnić pole.');
|
||||
}
|
||||
}
|
||||
|
||||
return !$this->getRequest()->hasErrors();
|
||||
}
|
||||
|
||||
protected function saveConfig()
|
||||
{
|
||||
$result = parent::saveConfig();
|
||||
|
||||
if ($this->config->get('enabled'))
|
||||
{
|
||||
stPaymentType::get(stSantanderRatyPaymentType::class)->getConfiguration()->enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
stPaymentType::get(stSantanderRatyPaymentType::class)->getConfiguration()->disable();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class stSantanderRatyBackendComponents extends autoStSantanderRatyBackendComponents
|
||||
{
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
generator:
|
||||
param:
|
||||
model_class: false
|
||||
title: "eRaty Santander Consumer Bank"
|
||||
route: "@stSantanderRatyBackend"
|
||||
icon: "stSantanderRatyPlugin"
|
||||
|
||||
documenation:
|
||||
pl: "https://www.sote.pl/docs/santander_consumer_bank"
|
||||
en: "https://www.soteshop.com/docs/santander_consumer_bank"
|
||||
|
||||
config:
|
||||
display:
|
||||
"NONE": [enabled, autoredirect, shop_number, highlighted_for_product]
|
||||
fields:
|
||||
enabled: {name: "Włącz", type: checkbox_tag, i18n: stPayment}
|
||||
autoredirect: {name: "Automatyczne przekierowanie", type: checkbox_tag, help: "Przekierowuje automatycznie na stronę płatności po złożeniu zamówienia", i18n: stPayment}
|
||||
highlighted_for_product: {name: "Wyróżnij płatność na karcie produktu", type: checkbox_tag}
|
||||
shop_number: {name: "Numer sklepu", required: true}
|
||||
actions:
|
||||
_save: -
|
||||
@@ -0,0 +1,4 @@
|
||||
fields:
|
||||
config{shop_number}:
|
||||
required:
|
||||
msg: Proszę uzupełnić pole.
|
||||
Reference in New Issue
Block a user