d
Topic
Posts:
4
Last edited December 21, 2015

Payment information in order confirmation This post is outdated

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!

i
Replies
Shawn Rudolph Shopify Employee
Posts:
253
December 21, 2015

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

Posts:
4
December 22, 2015

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

Posts:
1
December 22, 2015
g
1
upvotes

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.

 

Posts:
4
December 28, 2015

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

Posts:
4
January 21, 2016

I found the answer in another forum post:

https://ecommerce.shopify.com/c/shopify-discussion/t/how-do-i-access-transaction-object-properties-in-an-email-receipt-227314

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.