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 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?
    • By Damo
      When trying to update a customers card via the Admin area the customer is deleted from our Stripe Account.  The logs show an API call that updates the card followed by an immediate call to delete the customer.
    • By Web Host Pro
      We are adding Stripe to our billing processor and wanted to know if anyone here is using them. Any feedback or suggestions before we go live?
      Thank you,
    • By opso
      According to our law, it is not allowed to create 0.0 invoices. Since the invoice (we are considering orders aka proforma invoices until unpaid) 0.0 invoices should not get sequential invoice numbering for the paid ones.
      Is there a way using hooks or others way to prevent this happening?
      The best would be to have a settings to use the "Next Paid Invoice Number" only if > 0.
      I love whmcs and I don't want to search around just for this little (but still important) stuff.
      Thanks, Giuseppe
  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

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