I've been testing how payments made using the "Credit Card - Offline Processing" payment module appear in Super Orders.
(ETA: Also affects Authorize.net payments too) I noticed that not all credit cards payments display the correct
payment_type in Super Orders. In particular Master Card and Diners Club. (
Visa, Amex, and Discover all show up correctly) After doing some tiptoeing through the Developers Tool Kit I think found the answer:
I believe that Master Card does not show up because the Master Card value used in the array in the Super Orders class files (store and admin) and the payment type for Master Card in the
so_payment_types table do not match the
cc_type for Master Card in the
/includes/classes/cc_validation.php file.
Diners Club doesn't show up because it's not defined (at all) in the array in the Super Orders class files (store and admin) and simply needs to be added the class files and the
so_payment_types table.
To fix Master Card and add Diners Club here's the changes I made:
Go to
/admin/includes/classes/super_order.php around line 276 and make the changes highlighted in red:
Code:
$cc_type_key = array('MasterCard' => 'MC',
'Visa' => 'VISA',
'American Express' => 'AMEX',
'Diners Club' => 'DINE',
'Discover' => 'DISC');
Go to
/includes/classes/super_order.php around line 276 and make the changes highlighted in red:
Code:
$cc_type_key = array('MasterCard' => 'MC',
'Visa' => 'VISA',
'American Express' => 'AMEX',
'Diners Club' => 'DINE',
'Discover' => 'DISC');
Then run the following SQL changes in
Admin>Tools>
Install SQL Patches to correct the Master Card payment type and add Diners Club to the Super Orders payment types tables.
Code:
UPDATE `so_payment_types` SET `payment_type_full` = 'MasterCard' WHERE `so_payment_types`.`payment_type_full` = 'Master Card';
INSERT INTO `so_payment_types` (`payment_type_id` ,`language_id` ,`payment_type_code` ,`payment_type_full`)
VALUES ('10', '1', 'DINE', 'Diners Club');
For the record any other credit cards you would like to add, you can simply update the class files to add them to the array. You must make sure that you also add them to the
so_payment_types table as well. Remember they must match the cc_types used in the
/includes/classes/cc_validation.php file.
Thought I'd share this too.. I used the following test credit card numbers for the various credit card types
Master Card - 5105105105105100 - (16) Characters
Master Card - 5555555555554444 - (16) Characters
Master Card - 4222222222222 - (13) Characters
VISA - 4111111111111111 - (16) Characters
VISA - 4012888888881881 - (16) Characters
American Express - 378282246310005 - (15) Characters
American Express - 371449635398431 - (15) Characters
Amex Corporate - 378734493671000 - (15) Characters
Dinners Club - 38520000023237 - (14) Characters
Dinners Club - 30569309025904 - (14) Characters
Discover - 6011111111111117 - (16) Characters
Discover - 6011000990139424 - (16) Characters
JCB - 3530111333300000 - (16) Characters
JCB - 3566002020360505 - (16) Characters
Here's the source for these test credit card numbers:
http://www.ameripayment.com/testcreditcard.htm
Hope all of this is useful for someone else..
Bookmarks