how to get payment information on Magento?

喜夏-厌秋 提交于 2019-11-29 03:24:56

I think it will be

   $payment = $order->getPayment();

It will retrieve the current order payment instance.

//Get Payment
$payment = $order->getPayment()

//Get card type
$payment->getData('cc_type')

//Get Payment Info
$payment->getMethodInstance()->getCode();
$payment->getMethodInstance()->getTitle();

//Get Credit Card info
$payment->getMethodInstance()->getCardsStorage()
$payment->getMethodInstance()->getCardsStorage()->getCards() //array()

To get the method code only it's far safer to use

$order->getPayment()->getMethod();

Skipping instance object which can generate exception if the payment method was uninstalled.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!