Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Application/translations/de/oxpseasycredit_de_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>
[{/if}]
</dt>
<dd id="easycredit_installment_container" class="payment-option[{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}]activePayment[{/if}]">
<dd id="easycredit_installment_container" class="payment-option[{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}] activePayment[{/if}]">
[{if $easyCreditInstallmentIsPossible}]
<div class="col-lg-offset-3">
<img class="payment-logo-easycredit" src="[{$oViewConf->getModuleUrl('oxpseasycredit')}]out/pictures/eclogo.png" alt="Easy Credit">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>
[{/if}]
</dt>
<dd id="easycredit_invoice_container" class="payment-option[{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}]activePayment[{/if}]">
<dd id="easycredit_invoice_container" class="payment-option[{if $oView->getCheckedPaymentId() == $paymentmethod->oxpayments__oxid->value}] activePayment[{/if}]">
[{if $easyCreditInvoiceIsPossible}]
<div class="col-lg-offset-3">
<img class="payment-logo-easycredit" src="[{$oViewConf->getModuleUrl('oxpseasycredit')}]out/pictures/eclogo.png" alt="Easy Credit">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
});
}
)
Expand Down
2 changes: 1 addition & 1 deletion Core/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
44 changes: 44 additions & 0 deletions Core/Helper/EasyCreditInitializeRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -651,6 +653,7 @@ protected function getResponseUrls()
protected function getPersonals()
{
$user = $this->getUser();
$this->validateUser($user);

if (EasyCreditDicFactory::getDic()->getApiConfig()->getEasyCreditUseApiVersionV3()) {
return [
Expand All @@ -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
*
Expand Down
2 changes: 2 additions & 0 deletions out/src/css/oxpseasycredit_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down