<MidniteExpress msgversion="{{ version }}"
                {%- if reference_number %}
                id="{{ reference_number }}"
                {%- endif %}
                function="{{ function }}"
                {%- if ticket_number %}
                poschecknumber="{{ ticket_number }}"
                {%- endif %}
                posuser="{{ employee_id }}"
                posterminal="{{ terminal_id }}">
    <Payments>
        <Payment type="{{ transaction_type }}"
                 pan="{{ account }}"
                 {%- if expires %}
                 exp="{{ expires }}"
                 {%- endif %}
                 {%- if card_cvc2 %}
                 cid="{{ card_cvc2 }}"
                 {%- endif %}
                 {%- if billing_zip %}
                 avs="{{ billing_zip }}"
                 {%- endif %}
                 {%- if amount %}
                 amount="{{ amount }}"
                 {%- endif %}
                 {%- if prev_trans_id %}
                 transid="{{ prev_trans_id }}"
                 {%- endif %}>
        </Payment>
    </Payments>
</MidniteExpress>
