Skip to content
Open
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
3 changes: 3 additions & 0 deletions Model/Method/AbstractMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ public function authorize(\Magento\Payment\Model\InfoInterface $payment, $amount
if (empty($message) && stripos($sReason, "IBAN") !== false && stripos($sReason, "invalid") !== false) {
$message = __($sReason);
}
if (empty($message) && stripos($sReason, "Area-code and direct-dial together must contain at least six non-whitespace characters") !== false) {
$message = __('The phone number provided is invalid. Please ensure that the number has at least 6 digits.');
}
throw new PaymentException(__($message)); // RatePAY Error Message
}
}
Expand Down
2 changes: 2 additions & 0 deletions i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ ratepay_terms_block_6, "einverstanden." ,module,RatePAY_Payment
"Payment type","Zahlart",module,RatePAY_Payment
"Validation failed: Bank-account parameter IBAN is invalid.","Validierung fehlgeschlagen: Angegebene IBAN ist ungültig",module,RatePAY_Payment
"Validation failed: Bank-account parameter IBAN (DE) has invalid length (must be 22).","Validierung fehlgeschlagen: Angegebene IBAN hat eine ungültige Länge (muss 22 Zeichen lang sein).",module,RatePAY_Payment
"The phone number provided is invalid. Please ensure that the number has at least 6 digits.","Die angegebene Telefonnummer ist ungültig. Bitte stelle sicher, dass die Nummer mindestens 6 Ziffern enthält.",module,RatePAY_Payment
"Please ensure that the phone number has at least 6 digits.","Bitte stelle sicher, dass die Telefonnummer mindestens 6 Ziffern enthält.",module,RatePAY_Payment
"Ratepay_invoice","Rechnung",module,RatePAY_Payment
"Ratepay_installment","Ratenzahlung",module,RatePAY_Payment
"Ratepay_installment0","0% Finanzierung",module,RatePAY_Payment
Expand Down
10 changes: 10 additions & 0 deletions view/frontend/web/js/view/payment/method-renderer/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ define(
}
return false;
},
isTelephoneNumberInvalid: function () {
if (quote.billingAddress() != null && quote.billingAddress().telephone != undefined) {
let phone = quote.billingAddress().telephone;
phone = phone.replace(" ", "");
if (phone.length > 0 && phone.length < 6) {
return true;
}
}
return false;
},
isDobSet: function () {
if (customer.customerData.dob == undefined || customer.customerData.dob === null) {
return false;
Expand Down
5 changes: 5 additions & 0 deletions view/frontend/web/template/payment/directdebit.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<p><!-- ko i18n: 'Testmode activated, please DONT use this payment method and get in contact with the merchant.'--><!-- /ko --></p>
</div>
<!-- /ko -->
<!-- ko if: isTelephoneNumberInvalid() -->
<div class="message message-warning warning">
<div><!-- ko i18n: 'Please ensure that the phone number has at least 6 digits.'--><!-- /ko --></div>
</div>
<!-- /ko -->
<fieldset data-bind="attr: {class: 'fieldset payment items dob ' + getCode(), id: 'payment_form_' + getCode()}" style="margin: 0 0 5px; ">
<label class="label" data-bind="if: !isB2BModeUsable()">
<span><!-- ko i18n: 'Date of Birth'--><!-- /ko --><br>
Expand Down
5 changes: 5 additions & 0 deletions view/frontend/web/template/payment/installment.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<p><!-- ko i18n: 'Testmode activated, please DONT use this payment method and get in contact with the merchant.'--><!-- /ko --></p>
</div>
<!-- /ko -->
<!-- ko if: isTelephoneNumberInvalid() -->
<div class="message message-warning warning">
<div><!-- ko i18n: 'Please ensure that the phone number has at least 6 digits.'--><!-- /ko --></div>
</div>
<!-- /ko -->
<fieldset data-bind="attr: {class: 'fieldset payment items dob ' + getCode(), id: 'payment_form_' + getCode()}" style="margin: 0 0 5px; ">
<label class="label" data-bind="if: !isB2BModeUsable()">
<span><!-- ko i18n: 'Date of Birth'--><!-- /ko --><br>
Expand Down
5 changes: 5 additions & 0 deletions view/frontend/web/template/payment/invoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
<p><!-- ko i18n: 'Testmode activated, please DONT use this payment method and get in contact with the merchant.'--><!-- /ko --></p>
</div>
<!-- /ko -->
<!-- ko if: isTelephoneNumberInvalid() -->
<div class="message message-warning warning">
<div><!-- ko i18n: 'Please ensure that the phone number has at least 6 digits.'--><!-- /ko --></div>
</div>
<!-- /ko -->
<label class="label" data-bind="if: !isB2BModeUsable()">
<span><!-- ko i18n: 'Date of Birth'--><!-- /ko --><br>
<!-- ko if: currentCustomerData.dob -->
Expand Down