Contributions

Payment Modules (Category Index)
Search: 

cvv2 for entire order

This mod adds cvv2 credit card fields to osc that follows the entire order
process. It is for use with the the credit card payment module.

Inspiration for this mod comes from the cvv2 cc.php mod which I used parts
of in the cc.php file.

The included files should only be used on an unmodified OSC 2.2.

Just back up the corresponding files and copy these over them.

Otherwise you can follow these manual instructions. If you have modified OSC
in some way modify these directions as you need.

If you like this mod and would like to show appreciation feel free to drop
something into my paypal account.


Manual directions:


In checkout_process.php

AFTER:

'cc_number' => $order->info['cc_number'],

ADD:

'cc_cvv2' => $order->info['cc_cvv2'],


In includes/modules/payment/cc.php

AFTER:

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,
'field' => tep_draw_input_field('cc_number')),

ADD:

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVV2,
'field' => tep_draw_input_field('cc_cvv2')),

AFTER:

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,
'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) .

substr($this->cc_card_number, -4)),

ADD:

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVV2,
'field' => $_POST['cc_cvv2']),

AFTER:

tep_draw_hidden_field('cc_type', $this->cc_type) .

ADD:

tep_draw_hidden_field('cc_cvv2', $_POST['cc_cvv2']);


In includes/languages/english/modules/payment/cc.php

AFTER:

define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');

ADD:

define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVV2', 'CVV2:');


In includes/classes/order.php

In the line:

$order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city,

customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name,

delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id,

billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country,

billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified

from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

BETWEEN:

cc_number, cc_expires,

ADD:

cc_cvv2,

AFTER:

'cc_number' => $order['cc_number'],

ADD:

'cc_cvv2' => $order['cc_cvv2'],

AFTER:

'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),

ADD:

'cc_cvv2' => (isset($GLOBALS['cc_cvv2']) ? $GLOBALS['cc_cvv2'] : ''),


In admin/orders.php

AFTER:

<tr>
<td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
<td class="main"><?php echo $order->info['cc_number']; ?></td>
</tr>

ADD:

<tr>
<td class="main"><?php echo ENTRY_CREDIT_CARD_CVV2; ?></td>
<td class="main"><?php echo $order->info['cc_cvv2']; ?></td>
</tr>

In admin/includes/language/english/orders.php

AFTER:

define('ENTRY_CREDIT_CARD_NUMBER', 'Credit Card Number:');

ADD:

define('ENTRY_CREDIT_CARD_CVV2', 'CVV2:');


In admin/includes/classes/order.php

In line:

$order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city,

customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name,

delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id,

billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country,

billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified

from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

BETWEEN:

cc_number, cc_expires,

ADD:

cc_cvv2,

AFTER:

'cc_number' => $order['cc_number'],

ADD:

'cc_cvv2' => $order['cc_cvv2'],



In phpMyAdmin or from commandline mysql run:

ALTER TABLE `orders` ADD `cc_cvv2

Expand All / Collapse All

CVV2 For Entire Order - Corrected 28 Feb 2006

This includes the complete install file - the following was corrected:

** This code is corrected from the previous installation file. The "ADD" line originally had a ";" at the
** end of it, it needs to be a "." (as shown below). If you use the ";" you'll find that your credit card
** number is no longer written to the database. - bob61 02/28/06
AFTER:

tep_draw_hidden_field('cc_type', $this->cc_card_type) .

ADD:

tep_draw_hidden_field('cc_cvv2', $_POST['cc_cvv2']).

Small correction. 25 Sep 2005
Correction James 14 Apr 2005
cvv2 for entire order James 14 Apr 2005

Note: Contributions are used at own risk.