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 spartanza
      Quick question... in the backend/admin area of WHMCS, where can I edit the invoice and the invoice logo that is attached to an email that is sent.
      I have installed an Invoice Style add-on, however, it seems to not be affecting the attachment invoice that is sent to clients. Where can I edit that logo and where does it take the logo from?
      Thank you
    • By Frankc
      Original invoice amount is $100
      Payment of $50 applied
      But the invoice amount still stay $100 on notices, admin and client area etc even while the amount due is now $50 and correct in all calculations.
      While not a problem by itself it cause unnecessry support calls and misunderstandings when the invoice is still for $100 and not $50
      Even if the PDF invoice can't be changed, surely the notices and outstanding invoices can show the DUE AMOUNT for that invoice instead than original invoice amount?
    • By wellconnit
      Hi All,
      Has anyone had any experience with a hook updating an invoice?
      I want to use InvoicePaidPreEmail to append a credit card fee to the invoice.
      I understand WHMCS is not willing to budge on per Gateway charges, but I can disclose to my customers that there is a credit card fee of x% and then send the right payment value to the bank, once it returns as approved I can then append it to the invoice and prior to the email being sent it will now include the charge on the invoice.
      Any help with this is appreciated.
    • 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.
  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

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