diff --git a/Application/translations/de/oxpseasycredit_de_lang.php b/Application/translations/de/oxpseasycredit_de_lang.php index 9249d31..9a6c325 100644 --- a/Application/translations/de/oxpseasycredit_de_lang.php +++ b/Application/translations/de/oxpseasycredit_de_lang.php @@ -48,6 +48,13 @@ 'OXPS_EASY_CREDIT_ERROR_BESTAETIGEN_FAILED' => 'Die Ratenzahlung wurde von easyCredit leider nicht bestätigt. Bitte wählen Sie eine andere Zahlungsart.', 'OXPS_EASY_CREDIT_PAYMENT_PROFILEDATA_CAPTION' => 'Für eine optimale Ratenentscheidung vervollständigen Sie bitte diese Profildaten', 'OXPS_EASY_CREDIT_VALIDATION_ERROR' => 'Es ist ein Fehler aufgetreten.', + 'OXPS_EASY_CREDIT_ORDER_INFO' => 'Bestellinformation', + 'OXPS_EASY_CREDIT_ERROR_FNAME_SMALL' => 'Der Vorname muss beim easyCredit-Ratenkauf mindestens zwei Zeichen lang sein.', + 'OXPS_EASY_CREDIT_ERROR_FNAME_LONG' => 'Der Vorname darf bei easyCredit-Ratenkäufen maximal 27 Zeichen lang sein.', + 'OXPS_EASY_CREDIT_ERROR_LNAME_SMALL' => 'Der Nachname muss beim easyCredit-Ratenkauf mindestens zwei Zeichen lang sein.', + 'OXPS_EASY_CREDIT_ERROR_LNAME_LONG' => 'Der Nachname darf bei easyCredit-Ratenkäufen maximmal 27 Zeichen lang sein.', + 'OXPS_EASY_CREDIT_ERROR_FNAME_CONTAINS_INVALID_CHAR' => 'Ungültige Zeichen im Vornamensfeld beim easyCredit-Ratenkauf: %s', + 'OXPS_EASY_CREDIT_ERROR_LNAME_CONTAINS_INVALID_CHAR' => 'Ungültige Zeichen im Nachnamensfeld beim easyCredit-Ratenkauf: %s', 'OXPS_EASY_CREDIT_ADMIN_DELIVERY_STATE_LIEFERUNG_MELDEN' => 'Lieferung melden', 'OXPS_EASY_CREDIT_ADMIN_DELIVERY_STATE_V3_REPORT_CAPTURE' => 'Lieferung melden', diff --git a/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinstallment.tpl b/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinstallment.tpl index 00593dc..0ab0389 100644 --- a/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinstallment.tpl +++ b/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinstallment.tpl @@ -14,7 +14,7 @@ [{/if}] -
diff --git a/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinvoice.tpl b/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinvoice.tpl
index 808ae16..91f80db 100644
--- a/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinvoice.tpl
+++ b/Application/views/page/checkout/inc/oxpseasycredit_payment_easycreditinvoice.tpl
@@ -14,7 +14,7 @@
diff --git a/Application/views/widgets/oxpseasycredit_examplecalculation.tpl b/Application/views/widgets/oxpseasycredit_examplecalculation.tpl
index bfeb1e0..dc6ba17 100644
--- a/Application/views/widgets/oxpseasycredit_examplecalculation.tpl
+++ b/Application/views/widgets/oxpseasycredit_examplecalculation.tpl
@@ -31,10 +31,16 @@
$('#easycredit-example-dialog').html(data);
$('#easycredit-example-dialog').dialog({
+ draggable: false,
+ resizable: false,
close: true,
modal: true,
width: 570,
- height: 786
+ height: 786,
+ classes: {
+ "ui-dialog": "easycredit-widget",
+ "ui-dialog-titlebar-close": "btn-close"
+ }
});
}
)
diff --git a/Core/Events.php b/Core/Events.php
index 91909b6..1fc3d7c 100644
--- a/Core/Events.php
+++ b/Core/Events.php
@@ -17,7 +17,7 @@
use OxidEsales\Eshop\Core\DbMetaDataHandler;
use OxidEsales\Eshop\Core\Exception\StandardException;
use OxidEsales\Eshop\Core\Field;
-use \OxidEsales\Eshop\Core\Model\MultiLanguageModel;
+use OxidEsales\Eshop\Core\Model\MultiLanguageModel;
use OxidEsales\Eshop\Application\Model\Content;
use OxidEsales\Eshop\Core\Registry;
use OxidProfessionalServices\EasyCredit\Core\Api\EasyCreditWebServiceClientFactory;
diff --git a/Core/Helper/EasyCreditInitializeRequestBuilder.php b/Core/Helper/EasyCreditInitializeRequestBuilder.php
index 5c4c48f..4c9895e 100644
--- a/Core/Helper/EasyCreditInitializeRequestBuilder.php
+++ b/Core/Helper/EasyCreditInitializeRequestBuilder.php
@@ -25,10 +25,12 @@
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Exception\SystemComponentException;
+use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Session;
use OxidProfessionalServices\EasyCredit\Core\Di\EasyCreditApiConfig;
use OxidProfessionalServices\EasyCredit\Core\Di\EasyCreditDic;
use OxidProfessionalServices\EasyCredit\Core\Di\EasyCreditDicFactory;
+use OxidProfessionalServices\EasyCredit\Core\Exception\EasyCreditException;
/**
* Class to build the data for request "VorgangInitialisierenRequest" as part of initialization of easyCredit
@@ -651,6 +653,7 @@ protected function getResponseUrls()
protected function getPersonals()
{
$user = $this->getUser();
+ $this->validateUser($user);
if (EasyCreditDicFactory::getDic()->getApiConfig()->getEasyCreditUseApiVersionV3()) {
return [
@@ -670,6 +673,47 @@ protected function getPersonals()
}
}
+ private function validateUser($user)
+ {
+ $fname = $user->oxuser__oxfname->value;
+ $lname = $user->oxuser__oxlname->value;
+ $fnameLength = strlen($fname);
+ $lnameLength = strlen($lname);
+
+ if ($fnameLength < 2) {
+ throw new EasyCreditException('OXPS_EASY_CREDIT_ERROR_FNAME_SMALL');
+ }
+
+ if ($fnameLength > 27) {
+ throw new EasyCreditException('OXPS_EASY_CREDIT_ERROR_FNAME_LONG');
+ }
+
+ if ($lnameLength < 2) {
+ throw new EasyCreditException('OXPS_EASY_CREDIT_ERROR_LNAME_SMALL');
+ }
+
+ if ($lnameLength > 27) {
+ throw new EasyCreditException('OXPS_EASY_CREDIT_ERROR_LNAME_LONG');
+ }
+
+ // Define the allowed character set
+ $pattern = '/[^-a-zÀ-žA-ZäüößÄÖÜěščřžůďťňĎŇŤŠČŘŽŮĚO\'\.\, ]/';
+
+ // Check for invalid characters in first name
+ if (preg_match_all($pattern, $fname, $matches)) {
+ $invalidChars = implode(', ', array_unique($matches[0]));
+ $exceptionMessage = Registry::getLang()->translateString('OXPS_EASY_CREDIT_ERROR_FNAME_CONTAINS_INVALID_CHAR');
+ throw new EasyCreditException(sprintf($exceptionMessage, $invalidChars));
+ }
+
+ // Check for invalid characters in last name
+ if (preg_match_all($pattern, $lname, $matches)) {
+ $invalidChars = implode(', ', array_unique($matches[0]));
+ $exceptionMessage = Registry::getLang()->translateString('OXPS_EASY_CREDIT_ERROR_LNAME_CONTAINS_INVALID_CHAR');
+ throw new EasyCreditException(sprintf($exceptionMessage, $invalidChars));
+ }
+ }
+
/**
* Returns contact information
*
diff --git a/out/src/css/oxpseasycredit_style.css b/out/src/css/oxpseasycredit_style.css
index 2d8026a..8f03fc8 100644
--- a/out/src/css/oxpseasycredit_style.css
+++ b/out/src/css/oxpseasycredit_style.css
@@ -4,6 +4,8 @@
background-repeat: no-repeat;
padding: 10px 0 20px 60px;
background-position-y: center;
+ max-width: 100%;
+ z-index: 1111!important;
}
.easycredit-link {