Modifying Order Printer Template to exclude Authorization Transactions

Topic summary

Issue: User migrating to new Order Printer app wants to modify invoice template to exclude authorization transactions from the transaction list at bottom of invoices, as these confuse customers.

Initial Problem: Authorization transactions still appearing despite attempted filter using transaction.type != 'authorization'.

Additional Requirement: Display credit card information (brand and last 4 digits) only when applicable, and show all other transaction types with appropriate labels.

Solution Provided:

  • Change filter from transaction.type to transaction.kind != 'authorization'
  • Add conditional statement to display credit card details only when transaction.gateway == 'shopify_payments'
  • For other gateways, display transaction.gateway_display_name instead

Status: Resolved. Working code snippet provided that successfully filters out authorization transactions while properly handling credit card information display based on payment gateway.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

I am migrating over to the new order printer app and trying to make some changes to my order printer invoice template.

At the bottom of the default template for invoices is a list of transactions. So far I have added the customer’s credit card brand as well as the last 4 digits of their card, but I’d like to get rid of the ‘authorization’ transactions since that’s just confusing for the customer. With the authorization transactions the bottom section of the invoice looks like this:

One of those transactions is the payment authorization, and the other is the payment capture. I want all transactions to be included except for authorizations.

The code for that section looks like the following, however authorization transactions are still being shown as in the picture above. Any help would be greatly appreciated:

{% for transaction in transactions %}
   {% if transaction.type != 'authorization' %}
        
          {{ transaction.payment_details.credit_card_company }} ending in {{ transaction.payment_details.credit_card_last_four_digits }}
          {{ transaction.amount | money }}
          {{ transaction.status }}
        
        {% endif %}
      {% endfor %}

I also just realized that it will only display information in the first column if there is a credit card company and last 4 digits. I’ll need it to also be able to display all other transactions and have a title for them, just not the authorizations as previously requested.

For your initial question: You already had the right idea - You just need to change “transaction.type” to “transaction.kind”.

For the second question: Set up an if statement to output the CC info only when the transaction gateway = “shopify_payments”.

This code is working for me:

{% for transaction in transactions %}
    {% if transaction.kind != 'authorization' %}
        
            
                {% if transaction.gateway == 'shopify_payments' %}
                    {{ transaction.payment_details.credit_card_company }} ending in {{ transaction.payment_details.credit_card_last_four_digits }}
                {% else %}
                    {{ transaction.gateway_display_name }}
                {% endif %}
            
            {{ transaction.amount | money }}
            {{ transaction.status }}
        
    {% endif %}
{% endfor %}
1 Like

That’s excellent, thanks very much!