Magento2 – How to Get Credit Card Details Using Authorize.net Method

authorize.netcredit-cardmagento2

Does default Magento2 authorize.net payment method save the credit card details?

If yes, then How can we retrieve the credit card details used by authorize.net?

If not, please suggest the best way to achieve so.

Best Answer

Yes, you can retrieve credit card details from order.

$order is of type Magento\Sales\Model\Order

The following methods get the credit card details:

$order->getPayment()->getCcExpMonth(); 
$order->getPayment()->getCcExpYear();
$order->getPayment()->getCcLast4();
Related Topic