| @@ -118,8 +118,16 @@ | ||
| 118 | 118 | 'suredonationPayment', |
| 119 | 119 | Helper::get_form_payment_settings( $form_id ) |
| 120 | 120 | ); |
| 121 | 121 | |
| 122 | + // Expose the resolved validation messages so client-side validation | |
| 123 | + // mirrors the server's configured messages (matches the block render). | |
| 124 | + wp_localize_script( | |
| 125 | + 'suredonation-form-frontend', | |
| 126 | + 'suredonationValidationMessages', | |
| 127 | + \SureDonation\Inc\Field_Validation::get_resolved_validation_messages() | |
| 128 | + ); | |
| 129 | + | |
| 122 | 130 | // Enqueue Stripe.js if Stripe is configured. |
| 123 | 131 | $this->maybe_enqueue_stripe(); |
| 124 | 132 | |
| 125 | 133 | // Allow payment gateway extensions to enqueue their scripts (e.g., PayPal SDK). |