Payment information in order confirmation

Highlighted
Tourist
4 0 1

Hi,

How do I customize my order confirmation notification to include more information about payment than just the gateway name, e.g.

  • Card type (visa/master card etc.)
  • Last 4 digits in card.

Currently I can get a gateway identifier using either

{{ gateway }}

or

{{ unique_gateways }}

 but according to documentation I seem to be limited to these.

Any help is appreciated!

0 Likes
Shopify Staff
Shopify Staff
253 1 20

Hello Mikkel

One of the things that it mentions is that guide is that it can have transactions, they are a whole object so there's more information in this guide.

https://docs.shopify.com/api/transaction#properties

So you could do something like this.

{{ transaction.payment_details.credit_card_number ))

Then you will get something back like...

•••• •••• •••• 4242

Hope that helps!

Shawn

0 Likes
Tourist
4 0 1

Shawn,

I tested this today, and adding the following to the Order confirmation e-mail yielded only the paratheses " ()", ie. no credit card information.

(Note: I placed an order, with real credit card information)

{{ transaction.payment_details.credit_card_company }} ({{ transaction.payment_details.credit_card_number }})

Am I missing something obvious? :-o

Mikkel

0 Likes
New Member
1 0 1

I am also trying to achieve something similar in my New Order email notification.  I would like to list the gateway transaction ID on the email.  We use Authorize.net and want to be sure to match the Authorize emails to the Shopify emails for accounting purposes.  I tried using the following, but no luck:

{{ transaction.id }}

Any advice would be great.  This is the only change I need to make to the very helpful default setup.

Thank you.

 

1 Like
Tourist
4 0 1

Does anyone have an answer to this? Why is the transaction object empty?

0 Likes
Tourist
4 0 1

I found the answer in another forum post:

https://ecommerce.shopify.com/c/shopify-discussion/t/how-do-i-access-transaction-object-properties-i...

Apparently, the transaction object must be accessed through a collection of transactions, like this:

{% for transaction in transactions %}
{{ transaction.payment_details.credit_card_number }}
{% endfor %}

The documentation is misleading, see the Email variable reference article (https://docs.shopify.com/manual/settings/notifications/email-variables) which doesn't explain this properly. It only mentions the transaction variable, and should be updated to reflect the above.

Hope this helps.

1 Like