Php Magento中的信用卡详细信息

Php Magento中的信用卡详细信息,php,magento,Php,Magento,如何从OnepageController.php获取Magento中的信用卡详细信息? 我检索了所有其他信息,如账单信息、发货信息和用户详细信息。我使用以下命令获取卡的详细信息,但返回为空: $lastQuoteId = $session->getLastQuoteId(); $lastOrderId = $session->getLastOrderId(); $order = Mage::getModel('sales/order')->load($lastOrderId)

如何从
OnepageController.php
获取Magento中的信用卡详细信息? 我检索了所有其他信息,如账单信息、发货信息和用户详细信息。我使用以下命令获取卡的详细信息,但返回为空:

$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)

当我打印
$card\u exp\u month
$card\u exp\u year
时,两者都是空的。是否有其他方法可以确定信用卡的详细信息?我正在查找抄送号码、到期年份和到期月份。

而不是
$order->getCcExpMonth($lastOrderId)
尝试
$order->getPayment()->getCcExpMonth($lastOrderId)


使用
print\r($order->getPayment()->debug())
查看其他可用值,或查看
sales\u flat\u order\u payment
表查看更多示例。

CC Last 4:
$order->getPayment()->getCcLast4()

出口信息:
$order->getPayment()->getCcExpMonth()

$order->getPayment()->getCcExpYear()

我以如下方式在phtml文件中获得了卡的详细信息

$lastOrderId = Mage::getSingleton('checkout/session')
                                        ->getLastRealOrderId();

$order=Mage::getModel('sales/order')->loadByIncrementID($lastOrderId);
$payarry=$order->getPayment()->debug();
foreach($payarry as $key => $cardinfo)
{                   
    echo $key;
    echo $cardinfo;                     
}

等等,用于CcCid、CcOwner等。


            <?php

            require_once("app/Mage.php");
            $app = Mage::app('');
            $salesModel=Mage::getModel("sales/order");
            $salesCollection = $salesModel->getCollection();
            foreach($salesCollection as $order)
            {
                $orderId= $order->getIncrementId(); echo "<br/>";
                echo $orderId;

            $payarry=$order->getPayment()->debug();
            foreach($payarry as $key => $cardinfo)
            {     
                 echo"<pre>"; print_r($payarry);

                //echo $key; echo "<br/>";
                //echo $cardinfo;       echo "<br/>";               
            }

            }


            ?>

你能为你的例子提供更多的解释吗?//Nahi aaya:)+1,这是一个有味道的好问题。
gettype(…->getCcType())='null'&gettype(…->getCcLast4())='null'
所以这不是magento v1.5.1.0的答案,你得到的是空CcCid,
gettype(…->getCcType())='null-&gettype(…->getCcLast4())=='null'
所以不是magento v1.5.1.0的答案
            <?php

            require_once("app/Mage.php");
            $app = Mage::app('');
            $salesModel=Mage::getModel("sales/order");
            $salesCollection = $salesModel->getCollection();
            foreach($salesCollection as $order)
            {
                $orderId= $order->getIncrementId(); echo "<br/>";
                echo $orderId;

            $payarry=$order->getPayment()->debug();
            foreach($payarry as $key => $cardinfo)
            {     
                 echo"<pre>"; print_r($payarry);

                //echo $key; echo "<br/>";
                //echo $cardinfo;       echo "<br/>";               
            }

            }


            ?>