Contributions
CyberSource SOP Module
This module uses CyberSource's Silent Order POST method to connect. Basically it sends the transaction info to their server for processing using an HTTP Post.
It's really simple to install and pretty user friendly. Hopefully it works for you as well.
Expand All / Collapse All
Thank you Victor for finding that problem, I have included the fix in this build. I have also updated the README to comply with the new locations in the CyberSource Business Center.
Note to new downloaders: Please review the README attached in this package for installation and usage instructions. Please read and follow all instructions.
Hi,
Different card types were working but American Express always got a TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH (-5) returned. The problem is that cc_validation() returns 'Amex' as the type instead of 'American Express'. The real buglet is in cc_validation because the elseif conditional for 'Amex' and 'American Express' is identical and the 'Amex' condtional is first (maybe it's just my version of cc_validation()) In any case, I prefer putting in the fix in cybersource.php:
Add an additional case for 'Amex' that acts identically to 'American Express' above line 277.
case 'Amex':
$this->cc_card_type_id = '003';
Victor.
Hey guys,
Good catch by agrafuese, this new upload includes his find. Also, I reviewed the function that selects the card types. I realized that I was using some form dependencies which may not work in some browser versions or if you've made modifications to other parts of the page. So I changed it to dynamically update the form value, rather than hard coding it. Hopefully this fixes it. FYI: the function uses javascript.
Also, to explain the fix suggested by Santand. There are three places that the name of the module is displayed to your customer. Two are during checkout. The first is on the page where they put in their CC info. I modified this to say "Credit Card". The second is on the Order Confirmation page. This one has to be modified in the checkout_confirmation.php file. Specifically line 240 where it says:
<?php echo $order->info['payment_method']; ?>
For my store, I simply deleted lines 236 through 241, but if you want it to say "CyberSource" then leave it as is. The last place is in the receipt email, which is built in the checkout_process.php file. The payment method is added on line 253 where it says:
$email_order .= $payment_class->title . "nn";
I also deleted this section (lines 249 through 256) but perhaps it would be better to modify it to display all of their CC info. I haven't done this yet though, sorry guys. Well, let me know if you find any other bugs. I'm glad that it's been useful so far.
This is a great contribution, but I noticed that there was a small bug in the error handling that caused a "CVV code supplied is invalid" error during validation if the Card Validation Value was set to "Disabled" in the module configuration. Here is the proper code for the fix:
In file: catalog/includes/modules/payment/cybersource.php
Find line 289 which states:
if(strlen($HTTP_POST_VARS['card_cvNumber']) < 3 || strlen($HTTP_POST_VARS['card_cvNumber']) > 4)
AND REPLACE IT WITH THE FOLLOWING:
if(MODULE_PAYMENT_CYBS_CVV == 'Required' && strlen($HTTP_POST_VARS['card_cvNumber']) < 3 || strlen($HTTP_POST_VARS['card_cvNumber']) > 4)
As you can see, the original code was not specifying the correct instance to check for a valid CVV.
ALSO:
There seems to be a problem with the credit card types not setting properly in the admin module. If you check the boxes next to any credit card types other than Visa or MasterCard, or if you try to uncheck Visa or MasterCard, your settings are not saved. It will not allow you to change this option. For now, the only solution is to manually change the option via SQL commands. This is not a proper fix and I will not outline how to do this. However, if anyone knows how to fix this problem properly, please post the remedy code or contact me.
Many thanks to chiviak, the original author of this contribution. His hard work has made it a lot easier for us less-knowledgeable programmers. ;)
PLEASE NOTE: the attached file is a DUMMY text file with this same exact text written in it. For the full package, please see chiviak's file below!
I've updated the module to include two new enhancements! The changes are listed below:
1) I realized that I was depending on osCommerce's card validation function to determine the card type. The problem with this is that it doesn't allow you to pick and choose what card types you want to accept. So now you can pick and choose which ones you want in the module settings.
2) Also, CVV has been enhanced to now include a Required status. So now if people don't put one in, the transaction isn't even sent to CyberSource.
Please note: I did not include the modifications that Santand suggested below since it seems to work fine for me. But feel free to modify anything as you see fit.
Hi Everybody
I have used this contrib recently. This is a good contrib, but i think it need one simple modification to make it work perfectly. I have found that after installing and configuring this contrib. It is not sending all values required for successful approval of the transaction. All the hidden fields required are not coming. This needs just one simple modification, which I have made to make oscommerce work perfectly.
Please open the file catalogincludesmodulespaymentcybersource.php and go to line 131 and 143 , you will find following code.
$selection = array('id' => $this->code,
'module' => 'Credit Card',
Modify the lines like this.
$selection = array('id' => $this->code,
'module' => 'cybersource',
I think this will work for others too. i am uploading complete package.
The previous .zip had some extra files in it. Please use this one instead.
This module uses CyberSource's Silent Order POST method to connect. Basically it sends the transaction info to their server for processing using an HTTP Post.
It's really simple to install and pretty user friendly. Hopefully it works for you as well.
Note: Contributions are used at own risk.