如何获取客户迄今为止在 Magento 中输入的所有信用卡详细信息?

发布于 2024-10-14 15:00:05 字数 76 浏览 2 评论 0原文

我已从 Magento 管理面板启用“CC 已保存”方法。我想要客户在结帐页面的下拉列表中输入的所有信用卡详细信息的列表。有人可以帮我吗。

I have enabled "CC saved" method from Magento Admin Panel. I want list of all credit card details entered by Customer in drop down on checkout page. Can anybody help me out.

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

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

发布评论

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

评论(3

混浊又暗下来 2024-10-21 15:00:05

这不是您使用“自己动手”的解决方案。有些交易处理公司具有卡钱包功能,不需要您自己保存信用卡详细信息,这将比这种思路更安全。

有关存储信用卡数据的法律非常严格,从表面上看,这种思路将打破其中的一些法律,使客户面临信用卡欺诈的重大风险。

我本来想找到一个完整的解决方案,但无法做到。

This is not a solution that you use "roll your own" for. There are transaction processing companies that have card wallet features that don't require you to save the credit card details yourself, which will be safer and more secure than this line of thinking.

The laws around storing credit card data are stringent, and from the sounds of it, this line of thinking will break several of them, exposing customers to a significant risk of credit card fraud.

I was going to find a solution for completeness, but couldn't bring myself to it.

农村范ル 2024-10-21 15:00:05

上周我偶然为一位客户做了这件事。我的解决方案是通过提供使用此配置启用的新类来创建 Mage_Sales_Model_Mysql4_Order_Payment_Collection 的后代:

<config>
    <global>
        <models>
            <mymodule>
                <class>My_Module_Model</class>
                <resourceModel>mymodule_eav</resourceModel>
            </mymodule>
            <mymodule_eav>
                <class>My_Module_Model_Resource</class>
                <entities>
                    <payment><table>sales_flat_order_payment</table></payment>
                </entities>
            </mymodule_eav>
        </models>
    </global>
</config>

app/code/local/My/Module/Model/Payment.php

class My_Module_Model_Payment extends Mage_Sales_Model_Order_Payment
{
    protected function _construct()
    {
        $this->_init('mymodule/payment'); // name of single resource model
    }
}

<代码>app/code/local/My/Module/Model/Resource/Payment.php:

class My_Module_Model_Resource_Payment extends Mage_Sales_Model_Mysql4_Order_Payment
{} // no more is needed

app/code/local/My/Module/Model/Resource/Payment/Collection.php

class My_Module_Model_Resource_Payment_Collection extends Mage_Sales_Model_Mysql4_Order_Payment_Collection
{

    protected function _construct()
    {
        $this->_init('mymodule/payment'); // model alias
    }

    public function addSavedFilter($customerId)
    {
        $this->join('sales/order', '`main_table`.`parent_id`=`sales/order`.`entity_id`', '');
        $this->addAttributeToFilter('customer_id', $customerId)
             ->addAttributeToFilter('cc_number_enc', array('neq'=>''))
             ->getSelect()->group(array('cc_exp_year', 'cc_exp_month', 'cc_owner', 'cc_last4', 'cc_type'));
        return $this;
    }
}

然后我可以获得这样的列表:

$payments = Mage::getModel('mymodule/payment')->getCollection()->addSavedFilter($customer->getId());

PS
正如约瑟夫指出的那样,存储信用卡详细信息有一定的法律考虑。在这个特殊的案例中,我的客户意识到了这一切,并准备承担责任。

By chance I did exactly this for a client last week. My solution was to create a descendant of Mage_Sales_Model_Mysql4_Order_Payment_Collection by supplying new classes, enabled with this config:

<config>
    <global>
        <models>
            <mymodule>
                <class>My_Module_Model</class>
                <resourceModel>mymodule_eav</resourceModel>
            </mymodule>
            <mymodule_eav>
                <class>My_Module_Model_Resource</class>
                <entities>
                    <payment><table>sales_flat_order_payment</table></payment>
                </entities>
            </mymodule_eav>
        </models>
    </global>
</config>

app/code/local/My/Module/Model/Payment.php:

class My_Module_Model_Payment extends Mage_Sales_Model_Order_Payment
{
    protected function _construct()
    {
        $this->_init('mymodule/payment'); // name of single resource model
    }
}

app/code/local/My/Module/Model/Resource/Payment.php:

class My_Module_Model_Resource_Payment extends Mage_Sales_Model_Mysql4_Order_Payment
{} // no more is needed

app/code/local/My/Module/Model/Resource/Payment/Collection.php:

class My_Module_Model_Resource_Payment_Collection extends Mage_Sales_Model_Mysql4_Order_Payment_Collection
{

    protected function _construct()
    {
        $this->_init('mymodule/payment'); // model alias
    }

    public function addSavedFilter($customerId)
    {
        $this->join('sales/order', '`main_table`.`parent_id`=`sales/order`.`entity_id`', '');
        $this->addAttributeToFilter('customer_id', $customerId)
             ->addAttributeToFilter('cc_number_enc', array('neq'=>''))
             ->getSelect()->group(array('cc_exp_year', 'cc_exp_month', 'cc_owner', 'cc_last4', 'cc_type'));
        return $this;
    }
}

I could then get a list like this:

$payments = Mage::getModel('mymodule/payment')->getCollection()->addSavedFilter($customer->getId());

P.S.
As Joseph points out storing credit card details has certain legal considerations. In this particular case my client was aware of all that and were prepared to take on the responsibility.

比忠 2024-10-21 15:00:05

另一种可供考虑的替代方案是使用支付网关来存储信用卡,而不是直接存储在服务器上,并使用其 API 来处理订单支付。我想到的一个众所周知的方案是 Authorize.Net CIM(客户信息管理器)。这将消除许多潜在的合法性问题,并且您的站点更容易通过 PCI 合规性扫描和规则。 Magento 的一些付款方式扩展将有助于解决此问题。

Another alternative to consider is using the payment gateway to store credit cards instead of directly on the server and use their API to process order payments. A well known one that comes to mind is Authorize.Net CIM (Customer Information Manager). This will offload many of the potential legality issues and is easier for your site to pass the PCI Compliance scan and rules. There are some payment method extensions for Magento that will help with this.

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