Last updated: Dec 12, 2019

Display Errors

If there is a payment error, your page will reload with a variable that uses the same name as your payment form handle. If you form handle is paymentForm your errors will be available to you via paymentForm.getErrors().

Display Errors #

To display all errors at the top of your payment form, you'll need to loop through your error object. Please add the following code in the template where you're displaying the payment form

{% if paymentForm is defined and paymentForm.getErrors() | length %}
    {% for errors in paymentForm.getErrors() %}
        <ul class="errors">
            {% for error in errors %}
                <li>{{ error }}</li>
            {% endfor %}
    {% endfor %}
{% endif %}