{% macro transactionRow(transaction, level) %} {% set info = [ { label: "Transaction ID", type:'code', value: transaction.id }, { label: "Transaction Hash", type:'code', value: transaction.hash }, { label: "Gateway Reference", type:'code', value: transaction.reference }, { label: "Gateway Message", type:'text', value: transaction.message }, { label: "Note", type:'text', value: transaction.note ?? '' }, { label: "Gateway Code", type:'code', value: transaction.code }, { label: "Converted Price", type:'text', value: transaction.paymentAmount|currency(transaction.paymentCurrency)~" (1 "~transaction.currency~" = "~transaction.paymentRate|number~" "~transaction.paymentCurrency~")" }, { label: "Gateway Response", type:'response', value: transaction.response|raw } ] %} {{ transaction.type|title }} {{ transaction.status|title|t('commerce') }} {{ transaction.amount|currency(transaction.currency) }} ({{ transaction.currency }}) {{ transaction.paymentAmount|currency(transaction.paymentCurrency) }} ({{ transaction.paymentCurrency }}) {{ transaction.gateway.name ?? 'Missing Gateway'|t }} {{ transaction.dateUpdated|date('H:i:s (jS M Y)') }} {% if currentUser.can('commerce-capturePayment') and transaction.canCapture() %}
{{ csrfInput() }} {{ 'Capture'|t('commerce') }}
{% endif %} {% if currentUser.can('commerce-refundPayment') and transaction.canRefund() %}
{{ csrfInput() }} {% import "_includes/forms" as forms %} {{ forms.text({ id: 'amount', size: 10, name: 'amount', placeholder: transaction.paymentCurrency~' '~transaction.refundableAmount }) }} {{ forms.text({ id: 'note', size: 20, name: 'note', value: transaction.note, placeholder: 'Refund Note' }) }} {{ 'Refund'|t('commerce') }}
{% endif %} {% set transactions = transaction.childTransactions %} {% if transactions|length %} {% import _self as self %} {% for childTransaction in transactions %} {{ self.transactionRow(childTransaction, level +1) }} {% endfor %} {% endif %} {% endmacro %}

{{ "Transactions"|t('commerce') }}

{% if order.nestedTransactions|length %} {% from _self import transactionRow %} {% for transaction in order.nestedTransactions %} {{ transactionRow(transaction, 0) }} {% endfor %}
{{ 'Type'|t('commerce') }} {{ 'Status'|t('commerce') }} {{ 'Amount'|t('commerce') }} {{ 'Payment Amount'|t('commerce') }} {{ 'Gateway'|t('commerce') }} {{ 'Date'|t('commerce') }} {{ 'Info'|t('commerce') }}
{% else %}

{{ 'No transactions.'|t('commerce') }}

{% endif %} {% if not order.isPaid() %}
Make Payment
{% endif %}