2011-01-28 49 views

回答

1

這不是您使用「自己推出」的解決方案。有交易處理公司具有卡片錢包功能,不需要您自己保存信用卡詳細信息,這比這種思路更安全和更安全。

有關存儲信用卡數據的法律非常嚴格,從它的聲音來看,這種思維方式會打破其中的幾個法則,使客戶面臨信用卡詐騙的重大風險。

我正在爲完整性找到一個解決方案,但無法使我自己。

0

上週我偶然爲客戶做了這件事。我的解決辦法是通過提供新的類,這種配置使能產生的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()); 

附:
正如約瑟指出,存儲信用卡的細節有一定的法律考慮。在這種特殊情況下,我的客戶意識到這一切,並準備承擔責任。

+0

我在我的服務器上安裝了Onestepcheckout擴展程序,那麼請您告訴我確切步驟如何獲得用戶的所有信用卡數組?請幫忙 – bhushan 2011-01-31 11:25:15

0

另一種可供選擇的方法是使用支付網關直接在服務器上存儲信用卡而不是並使用其API處理訂單付款。一個衆所周知的想到的是Authorize.Net CIM (Customer Information Manager)。這將減輕許多潛在的合法性問題,並且使您的網站更輕鬆地通過PCI合規性掃描和規則。有一些Magento的付款方式擴展可以幫助解決這個問題。

相關問題