diff --git a/application/translations/de/fcPayOne_lang.php b/application/translations/de/fcPayOne_lang.php index d417d550..dee5856e 100755 --- a/application/translations/de/fcPayOne_lang.php +++ b/application/translations/de/fcPayOne_lang.php @@ -34,6 +34,9 @@ 'FCPO_CC_NUMBER_INVALID' => 'Bitte geben Sie eine korrekte Kreditkarten-Nummer ein.', 'FCPO_CC_DATE_INVALID' => 'Bitte geben Sie ein korrektes Gültigkeits-Datum an.', 'FCPO_CC_CVC2_INVALID' => 'Bitte geben Sie eine korrekte Prüfziffer an.', + 'FCPO_CC_CARDHOLDER' => "Karteninhaber", + 'FCPO_CC_CARDHOLDER_HELPTEXT' => "Karteninhaber wie aufgedruckt", + 'FCPO_CC_CARDHOLDER_INVALID' => "Es sind nur A-Z, ÄÖÜ,ß und - erlaubt", 'fcpo_so_ktonr' => 'Kontonummer', 'fcpo_so_blz' => 'BLZ', 'FCPO_MANIPULATION' => 'Verdacht auf Manipulation', diff --git a/application/translations/en/fcPayOne_lang.php b/application/translations/en/fcPayOne_lang.php index 1d5c708e..0775f3fd 100755 --- a/application/translations/en/fcPayOne_lang.php +++ b/application/translations/en/fcPayOne_lang.php @@ -34,6 +34,9 @@ 'FCPO_CC_NUMBER_INVALID' => 'Please enter a valid credit card number.', 'FCPO_CC_DATE_INVALID' => 'Please enter a valid date of expiry.', 'FCPO_CC_CVC2_INVALID' => 'Please enter a valid check digit.', +'FCPO_CC_CARDHOLDER' => "Cardholder", +'FCPO_CC_CARDHOLDER_HELPTEXT' => "Cardholder as printed on card", +'FCPO_CC_CARDHOLDER_INVALID' => "Only A-Z, ÄÖÜ,ß and - are valid", 'fcpo_so_ktonr' => 'Bank account number', 'fcpo_so_blz' => 'Bank identification number', 'FCPO_BANK_GER_OLD' => 'or pay by using your usual bank account number and bank code
(only supported for german accounts).', diff --git a/application/views/frontend/tpl/azure/fcpo_payment_creditcard_ajax.tpl b/application/views/frontend/tpl/azure/fcpo_payment_creditcard_ajax.tpl index 0e9b02a2..da0edaae 100644 --- a/application/views/frontend/tpl/azure/fcpo_payment_creditcard_ajax.tpl +++ b/application/views/frontend/tpl/azure/fcpo_payment_creditcard_ajax.tpl @@ -35,11 +35,22 @@

-
  • - - -
    -
    [{oxmultilang ident="FCPO_IF_DEFERENT_FROM_BILLING_ADDRESS"}]
    +
  • + + +

    [{oxmultilang ident="FCPO_CC_CARDHOLDER_HELPTEXT"}]

    +
    + +
      +
    • [{oxmultilang ident="FCPO_CC_CARDHOLDER_INVALID"}]
    • +
    +
    +
  • diff --git a/application/views/frontend/tpl/azure/fcpo_payment_creditcard_hosted.tpl b/application/views/frontend/tpl/azure/fcpo_payment_creditcard_hosted.tpl index 27f97eea..b37145ff 100644 --- a/application/views/frontend/tpl/azure/fcpo_payment_creditcard_hosted.tpl +++ b/application/views/frontend/tpl/azure/fcpo_payment_creditcard_hosted.tpl @@ -41,13 +41,22 @@
  • -
  • - - -
  • -
  • - - +
  • + + +

    [{oxmultilang ident="FCPO_CC_CARDHOLDER_HELPTEXT"}]

    +
    + +
      +
    • [{oxmultilang ident="FCPO_CC_CARDHOLDER_INVALID"}]
    • +
    +
    +
  • diff --git a/application/views/frontend/tpl/flow/fcpo_payment_creditcard_ajax.tpl b/application/views/frontend/tpl/flow/fcpo_payment_creditcard_ajax.tpl index 64c9d6a7..afe55ca3 100644 --- a/application/views/frontend/tpl/flow/fcpo_payment_creditcard_ajax.tpl +++ b/application/views/frontend/tpl/flow/fcpo_payment_creditcard_ajax.tpl @@ -46,11 +46,23 @@ -
    - +
    +
    - - [{oxmultilang ident="FCPO_IF_DEFERENT_FROM_BILLING_ADDRESS"}] + + [{oxmultilang ident="FCPO_CC_CARDHOLDER_HELPTEXT"}] +
    + + + +
    diff --git a/application/views/frontend/tpl/flow/fcpo_payment_creditcard_hosted.tpl b/application/views/frontend/tpl/flow/fcpo_payment_creditcard_hosted.tpl index 771f6056..02b29e84 100644 --- a/application/views/frontend/tpl/flow/fcpo_payment_creditcard_hosted.tpl +++ b/application/views/frontend/tpl/flow/fcpo_payment_creditcard_hosted.tpl @@ -50,16 +50,23 @@
    -
    - +
    +
    - -
    -
    -
    - -
    - + + [{oxmultilang ident="FCPO_CC_CARDHOLDER_HELPTEXT"}] +
    + + + +
    diff --git a/application/views/frontend/tpl/wave/fcpo_payment_creditcard_ajax.tpl b/application/views/frontend/tpl/wave/fcpo_payment_creditcard_ajax.tpl index 963ba074..5b124677 100644 --- a/application/views/frontend/tpl/wave/fcpo_payment_creditcard_ajax.tpl +++ b/application/views/frontend/tpl/wave/fcpo_payment_creditcard_ajax.tpl @@ -47,10 +47,22 @@
    - +
    - - [{oxmultilang ident="FCPO_IF_DEFERENT_FROM_BILLING_ADDRESS"}] + + [{oxmultilang ident="FCPO_CC_CARDHOLDER_HELPTEXT"}] +
    + + + +
    diff --git a/application/views/frontend/tpl/wave/fcpo_payment_creditcard_hosted.tpl b/application/views/frontend/tpl/wave/fcpo_payment_creditcard_hosted.tpl index b6506dbf..73b01a39 100644 --- a/application/views/frontend/tpl/wave/fcpo_payment_creditcard_hosted.tpl +++ b/application/views/frontend/tpl/wave/fcpo_payment_creditcard_hosted.tpl @@ -50,17 +50,24 @@
    -
    - +
    +
    - + + [{oxmultilang ident="FCPO_CC_CARDHOLDER_HELPTEXT"}]
    -
    - -
    - -
    +
    + + +
    diff --git a/lib/fcporequest.php b/lib/fcporequest.php index 547d10ef..01b51638 100755 --- a/lib/fcporequest.php +++ b/lib/fcporequest.php @@ -338,6 +338,7 @@ protected function _setPaymentParamsCC($aDynvalue) $this->addParameter('pseudocardpan', $aDynvalue['fcpo_pseudocardpan']); // Override mode for creditcard-type $this->addParameter('mode', $aDynvalue['fcpo_ccmode']); + $this->addParameter('cardholder', $aDynvalue['fcpo_kkcardholder']); return true; } diff --git a/out/src/js/fcPayOne.js b/out/src/js/fcPayOne.js index 07b694ed..5d1578f4 100755 --- a/out/src/js/fcPayOne.js +++ b/out/src/js/fcPayOne.js @@ -84,6 +84,9 @@ function resetErrorContainers() { if(document.getElementById('fcpo_cc_cvc2_invalid')) { document.getElementById('fcpo_cc_cvc2_invalid').style.display = ''; } + if(document.getElementById('fcpo_cc_cardholder_invalid')) { + document.getElementById('fcpo_cc_cardholder_invalid').style.display = ''; + } if(document.getElementById('fcpo_cc_error')) { document.getElementById('fcpo_cc_error').style.display = ''; } @@ -243,6 +246,24 @@ function startCCRequest() { return false; } +function validateCardholder(e) { + var error = false; + var cardholder = document.getElementById('fcpo_cc_cardholder').value; + var cardholderLabel = document.getElementById('fcpo_cc_cardholder_label'); + var cardholderReg = new RegExp(/^[A-Za-z \-äöüÄÖÜß]{1,50}$/); + if (cardholderReg.test(cardholder)) { + document.getElementById('fcpo_cc_cardholder_invalid').style.display = ''; + cardholderLabel.classList.remove("text-danger"); + cardholderLabel.classList.remove("cardholder-error"); + } else { + error = true; + document.getElementById('fcpo_cc_cardholder_invalid').style.display = 'block'; + cardholderLabel.classList.add("text-danger"); + cardholderLabel.classList.add("cardholder-error"); + } + return error; +} + function getCleanedNumber(dirtyNumber) { var cleanedNumber = ''; var tmpChar; @@ -470,6 +491,10 @@ function processPayoneResponseELV(response) { } function processPayoneResponseCC(response) { + var cardholderError = validateCardholder(); + if (cardholderError) { + return false; + } if(response.get('status') == 'VALID') { var oForm = getPaymentForm(); oForm["dynvalue[fcpo_pseudocardpan]"].value = response.get('pseudocardpan'); @@ -959,6 +984,11 @@ function validateInputCCHosted(e) { if(paymentId == 'fcpocreditcard' && oForm.fcpo_cc_type.value == 'hosted' && cardType != 'none') { $validateResult = validateCCHostedInputs(); + var cardholderError = validateCardholder(e); + if (cardholderError) { + e.preventDefault(); + return; + } if($validateResult == 0) { e.preventDefault(); $('#errorIncomplete').show();