{% from "govuk/components/warning-text/macro.njk" import govukWarningText %} {% from "govuk/components/button/macro.njk" import govukButton %} {% macro PaymentField(component) %} {% set model = component.model %} {% set amount = model.amount %} {% set description = model.description %} {% set paymentState = model.paymentState %} {% set isPreAuthorised = paymentState and paymentState.preAuth and paymentState.preAuth.status == 'success' %}
Continue to submit the form. You will not be charged twice.
{% else %} {# No pre-authorisation - show payment form #}{{ description }}
{{ govukWarningText({ text: "You may see a pending transaction in your bank account but you will only be charged when you submit the form.", iconFallbackText: "Warning" }) }}You can submit the form after you have added your payment details.
Total amount:
{{ amount }}
{{ govukButton({ text: "Add payment details", attributes: { name: "action", value: "external-" + model.name } }) }} {% endif %}