更改 Magento 管理中信用卡信息的显示

发布于 2024-12-17 09:27:35 字数 469 浏览 1 评论 0原文

在 Magento 中,我们使用 StoredCC 程序在 Magento 管理员之外进行信用卡验证。信息正确存储在数据库中,并且符合 PCI 准则,确保安全。但是,如果我登录 Magento 的管理员并转到“销售”->“订单”并选择一个订单,订单页面将显示解密的信用卡号。

我知道 Magento 数据库还存储信用卡的最后四位数字,所以我想做的是将这个位置的显示从完整的信用卡号更改为类似 *-*-**-#### 或完全抑制数字的显示。在旧版本的 Magento 中,我会通过修改 /app/design/adminhtml/default/default/template/ payment/info/cc.phtml 来做到这一点,但看起来其中包含的内容已被移至 getPaymentHTML() 但我是不是100%确定。

最终目标是在编程级别而不是 CSS 级别更改或隐藏 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!

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

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

发布评论

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

评论(1

染年凉城似染瑾 2024-12-24 09:27:35

付款详细信息显示的工作方式是,它想要显示的任何信息都在 Mage/Payment/Block/Info/Ccsave.php 文件的 _prepareSpecificInformation() 中返回。您应该感兴趣的代码块是

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(),
    ));
}

我不记得“保存的 CC”模式是否也保存了最后 4 个,但如果是的话,您可以将 getCcNumber() 替换为 getCcLast4 ()。如果该选项不可用,您也可以对 $info->getCcNumber() 执行 substr() 来仅显示最后 4 个。

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.

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