我在扩展和发展现金流期间 获取信用卡表格的信息时出现问题,但读取不到信用卡验证号(CVN)
例如,类
class Xxx_Yzz_Model_Method_Zcc extends Mage_Payment_Model_Method_Abstract
{
public function setParams ()
{
....
$ CcCid = $ this-> getInfoInstance () -> getCcCid ();
....
}
}
我在assignData覆盖内引用了Mage_Payment_Model_Method_Cc,但徒劳无功
public function assignData ($ data)
{
if (! ($ data instanceof Varien_Object)) {
$ data = new Varien_Object ($ data);
}
$ info = $ this-> getInfoInstance ();
$ info-> setCcType ($ data-> getCcType ())
-> setCcOwner ($ data-> getCcOwner ())
-> setCcLast4 (substr ($ data-> getCcNumber (), -4))
-> setCcNumber ($ data-> getCcNumber ())
-> setCcCid ($ data-> getCcCid ())
-> setCcExpMonth ($ data-> getCcExpMonth ())
-> setCcExpYear ($ data-> getCcExpYear ())
-> setCcSsIssue ($ data-> getCcSsIssue ())
-> setCcSsStartMonth ($ data-> getCcSsStartMonth ())
-> setCcSsStartYear ($ data-> getCcSsStartYear ())
;
return $ this;
}
另外我也参考了Mage_Payment_Model_Method_Cc,prepareSave覆盖,只能获取信用卡号,但没有获取验证码
public function prepareSave ()
{
$ info = $ this-> getInfoInstance ();
if ($ this-> _canSaveCc) {
$ info-> setCcNumberEnc ($ info-> encrypt ($ info-> getCcNumber ()));
}
// $ info-> setCcCidEnc ($ info-> encrypt ($ info-> getCcCid ()));
// These three lines seems useless
$ info-> setCcNumber (null)
// These three lines seems useless
-> setCcCid (null);
// These three lines seem useless
return $ this;
}
希望你能帮助我,谢谢