Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 4 of 4
Storing CVV information for manual credit card payment
 
nick_n
Jr. Member
 
Total Posts:  12
Joined:  2012-03-01
 
Sunlust - 25 November 2008 01:51 AM

hi,

Did anyone manage to figure out a way to store the CVV number?
I got it to show from the admin settings but it’s not storing the data in the order page in my shop.
We need to store this number to process the card manually.

Does anyone know of any tips/info on how to do this?

I had a Magento developer make a change in my Magento store in order to be able to view the CVV codes.  It cost just $20, a true bargain really and very quick service.  I highly recommend him.

I had contacted him at gsmagentodev@gmail.com

Drop him an email if it is necessary for you to view the CVV code for offline credit card processing.  It has helped me out a bunch!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tommy_Smith
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2009-06-16
 

@ Jerryfantastic

Thanks for the code Jerry.  I tried it, but when I went to check out, I just got a freeze up at the order review screen, no email was sent and no order was placed.

has anyone else had any success?

You mention ‘AJAX’ - is that something specialy which I need to install?

Thanks all the same, Tommy

 
Magento Community Magento Community
Magento Community
Magento Community
 
Robert S.
Jr. Member
 
Total Posts:  7
Joined:  2010-06-29
 
jerryfantastic - 18 May 2011 03:39 PM

I have solved this issue to my satisfaction by writing a little bit of javascript and PHP (less than 50 lines, I promise).

What my solution does is:
1. Capture the CVV and Cardholder Name when the “Place Order” button is clicked.
2. Pass this info via Ajax to a short PHP script which emails it to only you.

ADVANTAGES:
1. The CVV is accessible to you in your email, but is not stored in the Magento database
(thus separating the CVV and credit card number).
2. The customer does not see their CVV in the order confirmation email.
3. It is easy to delete emails (no extension required to dispose of CVVs)
4. Is very simple, so is not dependent on Magento version

STEPS
1. Open:
/app/design/frontend/base/default/template/checkout/onepage/review/info.phtml
(or the equivalent file in your theme folder, if it exists)

Find:
<onclick="review.save();">

Replace above code with:
<onclick="email_cvv(); review.save();">

Find:
review = new Review(’<?php echo $this->getUrl('checkout/onepage/saveOrder') ?>’, ‘<?php echo $this->getUrl('checkout/onepage/success') ?>’, $(’checkout-agreements’));

Right underneath this, add:

function email_cvv() {

var name = document.getElementById("ccsave_cc_owner").value;
var code = document.getElementById("ccsave_cc_cid").value;

if (window.XMLHttpRequest)
{
var xmlhttp=new XMLHttpRequest();
}
else
{
var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET”,"/email_code.php?name=" + name + “&code;=” + code,true);
xmlhttp.send(null);
}

The steps above put the Name and CVV into javascript variables called “name” and “code” and then send these two pieces of information via AJAX to a file “email_code.php” which will be placed in your site’s root directory (eg example.com/email_code.php)

2. Create a new file named email_code.php and write in it:

<?php

$name = $_GET["name"];
$code = $_GET["code"];

mail("sales@example.com", $name . " " . $code, $name . " " . $code);
// replace sales@example.com with the email address you want to send the name and CVV to.

?>

3. Upload this file to your root directory (eg www.example.com/email_code.php)

DONE! When an order is placed, you should now receive an email containing Name and CVV, in addition to any other emails you may receive

Thanks jerryfantastic, just to confirm that your code works with Magento v.1.6.2.0, with couple of changes:

1. <onclick="email_cvv(); review.save();"> should be added in /app/design/frontend/your-package/your-theme/template/checkout/onepage/review/button.phtml
2. the JavaScript code for the function email_cvv() should be added in /app/design/frontend/your-package/your-theme/template/checkout/onepage/payment.phtml right after

if($('payment-tool-tip-close')){
        Event
.observe($('payment-tool-tip-close'), 'click'toggleToolTip);
    
}

Adding it in /app/design/frontend/your-package/your-theme/template/checkout/onepage/review/info.phtml as you suggested doesn’t work and clicking on submit button will throw an error about undefined email_cvv() function.

Nice and effective way to retrieve the CVV number, use it to process the payment and delete the email without storing it and conforming the security regulations of credit card companies. Good job!

@Tommy_Smith

Try the changes I suggested above and I’m sure it will work just fine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
FireWire2
Jr. Member
 
Total Posts:  9
Joined:  2009-05-31
 

Any one get it work on 1.7.0.0

My case tt does not give ANY error nor email

Any help, would be appreciated very much
TIA

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tommy_Smith
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2009-06-16
 

Thanks Robert S.  but unfortunately still doesn’t work.  I’m using 1.7 and I wonder if that is something to do with it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
overnightgrafix
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2008-12-13
 

for you guys that need to display the code just delete the code after using it in the database

here is my version works for 1.7

i went to app/code/core/Mage/Payment/Model/Method/Cc.php

look for the old code:

public function prepareSave()
{
$info = $this->getInfoInstance();
if ($this->_canSaveCc) {
$info->setCcNumberEnc($info->encrypt($info->getCcNumber()));
}
//$info->setCcCidEnc($info->encrypt($info->getCcCid()));
$info->setCcNumber(null)
->setCcCid(null);
return $this;
}

replace with this one below:

public function prepareSave()
{
$info = $this->getInfoInstance();
if ($this->_canSaveCc) {

$info->setCcNumberEnc($info->encrypt($info->getCcCid().’ - ‘.$info->getCcNumber()));
}
$info->setCcNumber(null)
->setCcCid(null);
return $this;

}

wwww.overnightgrafix.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
ScoobyAndTiger
Member
 
Total Posts:  34
Joined:  2011-11-12
 
nick_n - 01 March 2012 11:16 PM

I had a developer do this for me for just $20.  A true bargain really and very quick service! I highly recommend him.

I had contacted him at gsmagentodev@gmail.com

Drop him an email if it is necessary for you to see the CVV code.  It has helped me out a bunch!

I took this advice, contacted George Savva. George made the changes expertly and quickly. Highly recommended. Thanks George

 
Magento Community Magento Community
Magento Community
Magento Community
 
stuarthammill
Jr. Member
 
Total Posts:  3
Joined:  2011-07-03
 

If you need to store the cvv may I suggest using george he is great and had the cvv number store workign within he hour

and for $25 its a bargain

 
Magento Community Magento Community
Magento Community
Magento Community
 
kvhsolutions
Jr. Member
 
Total Posts:  3
Joined:  2012-01-03
 

Check below link if u can find solutions

http://www.forum2tech.com/discussion/3/magento-knowledge-sharing

 
Magento Community Magento Community
Magento Community
Magento Community
 
sunvinay
Jr. Member
 
Total Posts:  1
Joined:  2013-01-09
 

We fixed this fast.  contact on sunvinay@gmail.com and i will send you info how to do this. We are magento extention developers smile

KayakJim - 05 May 2009 06:58 AM

Was an answer ever found to this?

I have the CVV code stored to the database in encrypted form but cannot get it to display in the admin when viewing an order.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 4 of 4