Skip to content

Commit 45cdfa9

Browse files
committed
fix: display error text in cardholder name validation
- Remove unnecessary br tag from error display - Add missing nameErrorString parameter to classic checkout
1 parent aaa14b6 commit 45cdfa9

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

.mcp.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
22
"mcpServers": {
3-
"chrome-devtools": {
4-
"command": "npx",
5-
"args": ["chrome-devtools-mcp@latest"]
6-
},
73
"browsermcp": {
84
"command": "npx",
95
"args": ["@browsermcp/mcp@latest"]

assets/css/monei-classic-checkout.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ label .monei-icons {
5656
font-size: 16px;
5757
height: 50px;
5858
line-height: 1;
59-
margin: 0 0 12px 0;
6059
min-height: 0;
6160
padding: 0;
6261
width: 100%;

assets/js/monei-cc-classic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
init_counter: 0,
4848
init_apple_counter: 0,
4949
total: wc_monei_params.total,
50-
cardholderNameRegex: /^[A-Za-zÀ-ú- ]{5,50}$/,
50+
cardholderNameRegex: /^[A-Za-zÀ-ú\s-]{5,50}$/,
5151
init() {
5252
// Checkout Page
5353
if ( this.$checkout_form.length ) {
@@ -288,7 +288,7 @@
288288
errorContainer = wc_monei_form.$errorContainer;
289289
}
290290
$( errorContainer ).html(
291-
'<br /><ul class="woocommerce_error woocommerce-error monei-error"><li /></ul>'
291+
'<ul class="woocommerce_error woocommerce-error monei-error"><li /></ul>'
292292
);
293293
$( errorContainer ).find( 'li' ).text( error_string );
294294
// Scroll to error

src/Gateways/PaymentMethods/WCGatewayMoneiCC.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ public function monei_scripts() {
459459
'apple_logo' => WC_Monei()->image_url( 'apple-logo.svg' ),
460460
'card_input_style' => json_decode( $card_input_style ),
461461
'card_brands' => $this->cardBrandHelper->getCardBrandsConfig(),
462+
'nameErrorString' => esc_html__( 'Please enter a valid name. Special characters are not allowed.', 'monei' ),
462463
)
463464
);
464465

0 commit comments

Comments
 (0)