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
    Commented 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
    Commented Jun 6, 2014 at 13:12

2 Answers 2

4
+50

Try using this code:

$order->getPayment()->getCcLast4();
3
  • Testing this now. Will let you know!
    – sparecycle
    Commented Jun 11, 2014 at 16:25
  • Thank you. That is the correct reference which ultimately led to the discovery of how to implement: stackoverflow.com/questions/23798073/…
    – sparecycle
    Commented Jun 12, 2014 at 13:44
  • Glad to know, that you task is accomplished Commented Jun 12, 2014 at 13:45
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
    Commented 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.