{% extends "base.html" %} {% block title %}{{ t('payment_new.title') }} — painfree{% endblock %} {% block body %}

{{ t('payment_new.heading') }}

{{ t('payment_new.lede') }}

{# The two refusals an operator can hit before the bank is involved -- the model's own shape rules and the Swiss Payment Standards rules -- render as one list. To the person fixing them they are the same kind of problem, and the location is the name of the input they typed into. #} {% if failures %}
{{ t('payment_new.refused') }} {% for failure in failures %} {% endfor %}
{{ t('payment_new.field') }}{{ t('payment_new.problem') }}
{{ failure.location }} {{ failure.message }}
{{ failure.rule }}
{% endif %} {% if not connection.initialised %}
{{ t('payment_new.not_initialised') }}

{{ t('payment_new.not_initialised_body') }}

{% endif %}

{{ t('payment_new.debtor') }}

{# A select, and a text field beside it, rather than one or the other. `AccountInfo` is optional in the H005 schema so a bank may publish none, and a catalogue is only as current as the last fetch -- a closed list built from either would refuse a payment the bank would have taken. That argument is why this was a datalist, and a datalist renders as a hint rather than a choice: the browser shows the placeholder as though it were a value, and nothing is preselected when there is only one account. So both. The list is a real dropdown, selected when the bank published exactly one, and the field below overrides it when something has to be typed. No script -- which is also why the override cannot simply appear when "other" is chosen. #} {% if accounts %} {# Folded away, not removed. The published list can be empty, stale, or simply miss the account somebody needs, so a form without this refuses a payment the bank would have taken -- but on a connection with one account it is a second IBAN field nobody needs, and its placeholder reads as a filled value, which is the thing that made the old datalist confusing. `details` and not a script: closed until asked for, and the browser does the asking. #}
{{ t('payment_new.debtor_iban_other') }}

{{ t('payment_new.debtor_iban_other_hint') }}

{% else %} {# Said rather than hidden: an empty dropdown with no explanation reads as "this connection has no accounts", which is not what it means. #}

{{ t('payment_new.debtor_iban_no_htd') }} {{ t('payment_new.debtor_iban_ask') }}

{% endif %} {# No debtor BIC field. The debit account is one the bank itself published in `HTD`, so the bank knows which institution holds it better than the person typing -- and `DbtrAgt` is derived from the IBAN rather than from anything entered here. An optional field that is right to leave empty on every payment is a field that only offers a way to be wrong. The API still accepts `debtor_bic` for callers that have a reason to set it. #}

{{ t('payment_new.creditor') }}

{{ t('payment_new.the_payment') }}

{# QRR and SCOR are not interchangeable and the rule about which goes with which account is in `painfree.sps`, not here. The form offers the choice and lets that module refuse the combination. #}
{{ t('common.cancel') }}

{{ t('payment_new.preview_hint') }}

{% endblock %}