cancel
Showing results for 
Search instead for 
Did you mean: 

decrypt($this->getCcNumberEnc())? don't work ???

SOLVED

decrypt($this->getCcNumberEnc())? don't work ???

hi,

 

in Magento 2.0.10 PHP 5.6.27

 

I created a Credit Card payment module (Save) which works very well. The encryption feature seems to work correctly ...

$info->encrypt($data->getDataByPath('additional_data/cc_number'))

 

but decrypt function always returns an empty field

in Magento\payment\Model\info.php line 76

public function getData($key = '', $index = null)
{
    if ('cc_number' === $key) {
        if (empty($this->_data['cc_number']) && !empty($this->_data['cc_number_enc'])) {
            $this->_data['cc_number'] = $this->decrypt($this->getCcNumberEnc());
        }
    }
    if ('cc_cid' === $key) {
        if (empty($this->_data['cc_cid']) && !empty($this->_data['cc_cid_enc'])) {
            $this->_data['cc_cid'] = $this->decrypt($this->getCcCidEnc());
        }
    }
    return parent::getData($key, $index);
}

 

idem in

$info->decrypt($info->getCcNumberEnc());

 

nothing :-(

Have you successful used the decrypt? It's a Bug ?

Thanks

sorry for my English ... i'm french :-)

1 REPLY

Re: decrypt($this->getCcNumberEnc())? don't work ???

It's a magento bug !

 

in quote_payment table

cc_number_enc => datatype VARCHAR(255)

cc_ss_issue => datatype VARCHAR(255)

...

and in sales_order_payment table

cc_number_enc => datatype VARCHAR(32)

cc_ss_issue => datatype VARCHAR(32)

 

if you change VARCHAR(255) in sales_order_payment, this fix the problem !!! Smiley Happy