How can I get the credit card detail in Magento from OnepageController.php?
I have retrieved all the other information like billing information, shipping information and user details. I am using the following to get the card detail but it returns blank:
$lastQuoteId = $session->getLastQuoteId();
$lastOrderId = $session->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$card_exp_month = $order->getCcExpMonth($lastOrderId);///(Nahi AAya)
$card_exp_year = $order->getCcExpYear($lastOrderId);///(Nahi AAya)
When I print $card_exp_month and $card_exp_year, both are blank. Is there another way by which I can determine the credit card detail? I’m looking for CC number, expiry year and expiry month.
Instead of
$order->getCcExpMonth($lastOrderId)try$order->getPayment()->getCcExpMonth($lastOrderId).Use
print_r($order->getPayment()->debug())to see what other values are available, or view thesales_flat_order_paymenttable to see some more examples.