donjao6770 2011-11-21 15:36
浏览 36
已采纳

在Magento Admin中更改信用卡信息的显示

Within Magento we are using the StoredCC procedure to do credit card verification outside of the Magento Admin. The information is stored properly in the database and is secure properly with PCI guidelines. However, if I log into Magento's Admin and go to Sales->Orders and choose an order, the order page will show me the decrypted credit card number.

I know that the Magento database also stores the last four digits of the credit card so what I would like to do is change the display in this location from the full credit card number to something like *-*-**-#### or suppress the display of the number completely. In older versions of Magento I would do this by modifying /app/design/adminhtml/default/default/template/payment/info/cc.phtml but it looks like whatever was contained in there has been moved to getPaymentHTML() but I am not 100% sure.

Ultimate goal, change or suppress the credit card information in Admin at the programming level and not the CSS level. Thanks!

  • 写回答

1条回答 默认 最新

  • doulongti5932 2011-11-21 15:48
    关注

    The way that the payment detail display works is that any information it wants to get displayed is returned in _prepareSpecificInformation() of the Mage/Payment/Block/Info/Ccsave.php file. The chunk of code you should be interested in is

    if (!$this->getIsSecureMode()) {
        $transport->addData(array(
            Mage::helper('payment')->__('Expiration Date') => $this->_formatCardDate(
                $info->getCcExpYear(), $this->getCcExpMonth()
            ),
            Mage::helper('payment')->__('Credit Card Number') => $info->getCcNumber(),
        ));
    }
    

    I don't recall if Saved CC mode also saves the last 4, but if it does you can just swap out the getCcNumber() with getCcLast4(). If that isn't available, you could also just do a substr() on $info->getCcNumber() to only show the last 4.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥85 maple软件,solve求反函数,出现rootof怎么办?
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题