1

Google hasn't been able to solve this one for me and I'm surprised it hasn't been brought up in Magento forums...

I would like to include the credit card type and last 4 of credit card as stored in Magento's Payment Information area for each order. Trying to alleviate confusion for our end-users and make the emails more informative. How would I begin to include these two fields? Thank you.

2
  • 1
    It's not fine to get the credit card information, if you have the credit card info then you have all access of card. this is only happen if you have your own payment method.
    – Ami Kamboj
    Jun 6, 2014 at 7:42
  • This is payment information that Magento does in fact store by default. The last 4 of the CC number and the card type (MC, AMEX, Visa, Discover). I want to present that in an email to the customer. This is the same type of payment validation as seen on other PCI compliant shopping carts/sites.
    – sparecycle
    Jun 6, 2014 at 13:12

2 Answers 2

4
+50

Try using this code:

$order->getPayment()->getCcLast4();
3
1

Please refer to similar questions answered here before

Magento Payment Info Block

Saving extra data with an order in Magento

1
  • I will test this solution and confirm that it solves my problem. Thank for you the links!
    – sparecycle
    Jun 6, 2014 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.