Skip to content

Commit 3c29598

Browse files
committed
fix: wrap redirect description in div for proper rendering in classic checkout
All payment methods now wrap redirect mode descriptions in a div with class 'monei-redirect-description' to match blocks checkout pattern and ensure consistent rendering and styling across classic and blocks checkout. Changes: - WCGatewayMoneiCC: wrap description in div - WCGatewayMoneiBizum: wrap description in div - WCGatewayMoneiPaypal: wrap description in div - WCGatewayMoneiAppleGoogle: wrap description in div
1 parent fee6b06 commit 3c29598

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/Gateways/PaymentMethods/WCGatewayMoneiAppleGoogle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ public function payment_fields() {
294294
ob_start();
295295
// Show description only in redirect mode
296296
if ( $this->redirect_flow && $this->description ) {
297+
echo '<div class="monei-redirect-description">';
297298
echo wp_kses_post( wpautop( wptexturize( $this->description ) ) );
299+
echo '</div>';
298300
}
299301
$this->render_google_pay_form();
300302
ob_end_flush();

src/Gateways/PaymentMethods/WCGatewayMoneiBizum.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ protected function get_frontend_generated_token() {
185185
public function payment_fields() {
186186
// Show description only in redirect mode
187187
if ( $this->redirect_flow && $this->description ) {
188+
echo '<div class="monei-redirect-description">';
188189
echo wp_kses_post( wpautop( wptexturize( $this->description ) ) );
190+
echo '</div>';
189191
}
190192
// Only render Bizum button if not using redirect flow
191193
if ( ! $this->redirect_flow ) {

src/Gateways/PaymentMethods/WCGatewayMoneiCC.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ public function payment_fields() {
338338
} elseif ( is_checkout_pay_page() ) {
339339
// Order-pay page: Don't show saved cards (matches Stripe behavior)
340340
// Always require new payment method for failed payment retries
341+
// Show description in redirect mode
342+
if ( $this->redirect_flow && $this->description ) {
343+
echo '<div class="monei-redirect-description">';
344+
echo wp_kses_post( wpautop( wptexturize( $this->description ) ) );
345+
echo '</div>';
346+
}
341347
if ( ! $this->redirect_flow ) {
342348
$this->render_monei_form();
343349
}
@@ -358,7 +364,9 @@ public function payment_fields() {
358364
// Checkout screen.
359365
// Show description only in redirect mode
360366
if ( $this->redirect_flow && $this->description ) {
367+
echo '<div class="monei-redirect-description">';
361368
echo wp_kses_post( wpautop( wptexturize( $this->description ) ) );
369+
echo '</div>';
362370
}
363371
if ( $this->tokenization ) {
364372
$this->saved_payment_methods();

src/Gateways/PaymentMethods/WCGatewayMoneiPaypal.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ protected function get_frontend_generated_token() {
188188
public function payment_fields() {
189189
// Show description only in redirect mode
190190
if ( $this->redirect_flow && $this->description ) {
191+
echo '<div class="monei-redirect-description">';
191192
echo wp_kses_post( wpautop( wptexturize( $this->description ) ) );
193+
echo '</div>';
192194
}
193195

194196
// Only render PayPal button if not using redirect flow

0 commit comments

Comments
 (0)