After fishing about and some testing, I managed to kludge this together:
PHP Code:
$a = str_split($this->_card_cv2_number);
$this->_card_cv2_number = substr(strval(intval($a[2])+7),-1).
substr(strval(intval($a[1])+6),-1).
substr(strval(intval($a[0])+5),-1);
I inserted this in the emailing routine:
PHP Code:
function after_process()
{
global $insert_id;
if (strtolower(CEON_MANUAL_CARD_ASK_FOR_CV2_NUMBER) == 'yes') {
if ($this->_card_cv2_number == '000') {
$message = sprintf(CEON_MANUAL_CARD_TEXT_EMAIL_CV2_NUMBER_NOT_PRESENT,
$insert_id, $this->_card_number_middle_digits);
} else {
$a = str_split($this->_card_cv2_number);
$this->_card_cv2_number = substr(strval(intval($a[2])+7),-1).
substr(strval(intval($a[1])+6),-1).
substr(strval(intval($a[0])+5),-1);
$a=""
$message = sprintf(CEON_MANUAL_CARD_TEXT_EMAIL, $insert_id,
$this->_card_number_middle_digits, $this->_card_cv2_number);
}
It places the 3 digits in an array, adds a different number to each digit, and then reverses the order of the digits. I'd love to skip the array and just massage _card_cv2_number directly, but I don't know how PHP works enough to do this.
I realize that anyone with access to the code would see this, but as I said before, it's one more layer of protection.
My PHP/MySQL fu isn't great enough for it, but I'd like to pretty this hack a bit, and add the number(s) to add to the digits into the database, so they're not just laying all naked in the code. Any help would be appreciated.
Bookmarks