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.
Does Magento save credit card numbers in the database when the Authorize.net payment method used? No, that information is sent via a token to Authorize.net and confirmed or denied.
The Magento 2 credit card payment module lets customers save their credit card details. They have to enter their credit card number and the expiry date one time.
The Magento payment provider gateway is a mechanism that allows you to integrate your stores with payment service providers. As a result, you can create and handle transactions based on order details.
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 the sales_flat_order_payment
table to see some more examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With