When setting up cybersource, I came across an issue with the .8 version of the uc_cybersource module. I'm new to ubercart, so I hope this is the right place to post this. When the credit card module is set to "Enable card type field on checkout form" in the payment settings - the logic of the uc_cybersource_charge function does not correctly format the $cc_type (card_cardType) variable that gets passed to cybersource, which results in a failed transaction.
The ironic thing about this bug is - If the dropdown form is not enabled, the uc_cybersource module runs a function to determine which type of card it is, and then goes through a switch statement to determine which number to pass along as the "card_cardType", and it is correct. But if you allow the user to choose a card type in the form, the function just passes along the card type the user chooses, and does not change the $cc_type variable to the number that cybersource is expecting. It's as though the robots don't want the humans to have a choice! 
A quick fix would be to just modify lines 122-137 as below:
switch (strtolower($order->payment_details['cc_type'])) {
case 'amex':
case 'american express':
$cc_type = '003';//'Amex';
break;
case 'visa':
$cc_type = '001';//'Visa';
break;
case 'mastercard':
case 'master card':
$cc_type = '002';//'MasterCard';
break;
case 'discover':
$cc_type = '004';//'Discover';
break;
}But it might be worth making a separate "_uc_get_cybersource_card_type" function since this number is also generated by the _uc_cybersource_card_type function on line 281.



Re: Cybersource "card type" incorrectly submitted when allowing
hehe Actually, you're right on here. I just noticed the same thing yesterday debugging this for someone, but I don't think I had committed the fix yet. I'll make sure it goes in today!
Welcome aboard, and thanks for pitching in.
Thanks!
Thanks for taking the lead on this Ryan - and thanks for your kind attitude and great work. It's nice to make your acquaintance. I've been following ubercart for a while, as I did the initial work on mercedessource.com before jakob (japerry) took on the ubercart migration. Thanks for the compliments on the block themeing
.