在默认情况下,Magento仅为SaveCC做了信用卡密码保存的工作,而其它的支付方式,均没有进行保存(信用卡号等信息一般都保存在sales_flat_quote_payment中),Magento1.4.x后,仅需要在支付方式插件中修改一句话,就可以使其保存信用卡号。例:EBP\app\code\core\Mage\Paygate\Model\Authorizenet.php中第73行,修改以下语句为True:
protected $_canSaveCc = true;
与此同时,与信用卡相关的信息还有CVV,Magento系统中是不存放CVV信息的,如需要存放,请做以下修改
app\code\core\Mage\Payment\Model\Method\Cc.php中65行
public function prepareSave()
{
$info = $this->getInfoInstance();
if ($this->_canSaveCc) {
$info->setCcNumberEnc($info->encrypt($info->getCcNumber()));
}
$info->setCcCidEnc($info->encrypt($info->getCcCid()));//使用该语句来实现记录CVV信息
// $info->setCcNumber(null)将这一行注释掉
// ->setCcCid(null);
return $this;
}