Magento 中的信用卡详细信息

发布于 2024-10-10 09:44:37 字数 579 浏览 3 评论 0原文

如何从 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_exp_month$card_exp_year 时,两者都是空白。还有其他方法可以确定信用卡详细信息吗?我正在查找 CC 号码、到期年份和到期月份。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

坚持沉默 2024-10-17 09:44:38

我在 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;                     
}

I got the card details in phtml file like following way.

$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;                     
}
π浅易 2024-10-17 09:44:38

还有

        $quote = Mage::getSingleton('checkout/session')->getQuote();  // or load by id
        $order = $quote->getOrder();
        $payment = $quote->getPayment();
        $instance = $payment->getMethodInstance();

        $ccNumber = $instance->getInfoInstance()->getCcNumber();
        $ccExpMonth = $instance->getInfoInstance()->getCcExpMonth();

CcCid、CcOwner 等......

Also

        $quote = Mage::getSingleton('checkout/session')->getQuote();  // or load by id
        $order = $quote->getOrder();
        $payment = $quote->getPayment();
        $instance = $payment->getMethodInstance();

        $ccNumber = $instance->getInfoInstance()->getCcNumber();
        $ccExpMonth = $instance->getInfoInstance()->getCcExpMonth();

and so on for CcCid, CcOwner, etc...

复古式 2024-10-17 09:44:38
            <?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/>";               
            }

            }


            ?>
            <?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/>";               
            }

            }


            ?>
小兔几 2024-10-17 09:44:37

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

使用 print_r($order->getPayment()->debug()) 查看其他可用值,或查看 sales_flat_order_ payment 表以查看更多示例。

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.

毁我热情 2024-10-17 09:44:37

抄送最后 4 个:$order->getPayment()->getCcLast4()

费用信息:
$order->getPayment()->getCcExpMonth()
$order->getPayment()->getCcExpYear()

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

Exp Info:
$order->getPayment()->getCcExpMonth()
$order->getPayment()->getCcExpYear()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文