Jump to content

Credit card type and last 4 digits on invoices

Recommended Posts


Has anyone implemented a way to show the card type and four digits of the credit card used for invoice payments?

We would like to do three things:

  1. If no card is on file display a note on the PDF invoice / email template / print invoice.
  2. If a card is on file display the card issuer and 4 digits on the PDF invoice / email template / print invoice.
  3. As for #2 display the same information in the transactions table below the transaction ID.

I was not able to find any template variables so suspect it may be a direct call to the database to look this up.

Thanks, as always.

Share this post

Link to post
Share on other sites

If you are editing a file where $clientsdetails are available (may be part of another param array too), you should find cctype and cardlastfour are parameters available to you.

There are separate merge fields for these values available in Email Templates.

$clientsdetails is available in the PDF invoice and the online viewable invoice.


In a template, remember you can use {debug} to see the variables available. This also applies to email templates, but you have to send the email to see what is available. https://www.smarty.net/docs/en/language.function.debug.tpl


Share this post

Link to post
Share on other sites

Oh perfect. Thanks!

I didn’t know about {debug} but it makes sense given it’s Smarty based. 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By WHMCS John
      An issue has been identified in the 7.4.2 release - published on 9th January, 2018 - that can result in tax being rounded down in certain circumstances when a negative line item is manually added to an invoice.
      This can result in the tax being calculated at 0.01 too little on some invoices.
      We are releasing a hot-fix patch which resolves the underlying issue.
      Applying the HotFix
      To apply the fix, download the zip file from the link below. Extract the contents and upload to your whmcs directory overwriting the existing files.
      Note: This file is only applicable if you are running Version 7.4.2
    • By wellconnit
      Hi Guys,
      A much asked for feature over the last few years for API users has been the ability to retrieve PDF Invoices from the system.
      I stumbled across a link from The Wandering System Admin who has done a great job at dissecting the system and getting it to spit out a PDF invoice. (http://thewanderingsysadmin.net/?p=35)
      However I'm having a bit of trouble getting it working.
      I've created the request and passed it $username,$password & a static invoice ID of 10 however I'm getting a response of, 
      I've created the api request file in /includes/api/genpdffile.php however it's still not working.
      Happy to drop the working code once I get it, because I know a few people are looking for it on here, and WHMCS support are yet to implement this natively.
      Thanks to anyone with any ideas.
      Anyone can follow the ticket if they want to keep updated on the issue.
    • By didier1
      Hello, we are sending our clients some custom emails template for product renewal notice. We would like our clients email to be received with the renewal information  in a PDF instead of inside the email body. Same delivery method than a WHMCS invoice.
      Also, like invoices, we would like the PDF to be available to client trough their client area in a document download section  ( I know I'm asking a lot) 
      Which avenue our company need to take in order to accomplish that : custom devlopement, specific module or really easy customisation ?
      thanks again to help me just a few weeks before the holidays!
    • By sufi
      How do I add 2CO recurring payment (subscribed without WHMCS) to WHMCS invoice?
    • By HarryAdney
      I have a client who pays very unreliably. He currently gets invoices from me fore renewals which he should pay off, but only the domain name being lost or his website not working gives him the prompt to pay up. (This happens every year!)
      Is there a way to change his payments to a monthly direct debit? Will I need to setup a new service?
  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

By using this site, you agree to our Terms of Use & Guidelines