As mentioned Visa cards work correctly. I tried entering a Visa card with an incorrect Card Verification Value and as the administrator I got the message
braintree_api
CC validation results: The credit card number starting with was not entered correctly, or we do not accept that kind of card. Please try again or use another credit card.(-1)
Of course this is not a useful error message, as the customer I did not receive any sort of error message and was just sent back to page 2 of 3- "Payment Information" without any explanation!
I tried commenting out the credit card check in braintree_api.php but then the correct Visa card does not work any more; at least as the customer I did get a detailed error message on page 2 of 3- "Payment Information"
This is the code but probably I did not comment it correctly; I commented out the whole section starting "This is the credit card check"
Code:
/**
* This is the credit card check done between checkout_payment and
* checkout_confirmation (called from checkout_confirmation).
* Evaluates the Credit Card Type for acceptance and the validity of the Credit Card Number & Expiration Date
*/
function pre_confirmation_check() {
global $messageStack, $order;
include(DIR_WS_CLASSES . 'cc_validation.php');
$cc_validation = new cc_validation();
$result = $cc_validation->validate($_POST['braintree_cc_number'], $_POST['braintree_cc_expires_month'], $_POST['braintree_cc_expires_year'], (isset($_POST['braintree_cc_issue_month']) ? $_POST['braintree_cc_issue_month'] : ''), (isset($_POST['braintree_cc_issue_year']) ? $_POST['braintree_cc_issue_year'] : ''));
$error = '';
switch ($result) {
case 1:
break;
case -1:
$error = MODULE_PAYMENT_BRAINTREE_TEXT_BAD_CARD; //sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
if ($_POST['braintree_cc_number'] == '')
$error = str_replace('\n', '', MODULE_PAYMENT_BRAINTREE_TEXT_JS_CC_NUMBER); // yes, those are supposed to be single-quotes.
break;
case -2:
case -3:
case -4:
$error = TEXT_CCVAL_ERROR_INVALID_DATE;
break;
case false:
$error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
break;
}
$_POST['braintree_cc_checkcode'] = preg_replace('/[^0-9]/i', '', $_POST['braintree_cc_checkcode']);
if (isset($_POST['braintree_cc_issuenumber']))
$_POST['braintree_cc_issuenumber'] = preg_replace('/[^0-9]/i', '', $_POST['braintree_cc_issuenumber']);
if (($result === false) || ($result < 1)) {
$messageStack->add_session($this->code, $error . '<!-- [' . $this->code . '] -->' . '<!-- result: ' . $result . ' -->', 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
}
$this->cc_card_type = $cc_validation->cc_type;
$this->cc_card_number = $cc_validation->cc_number;
$this->cc_expiry_month = $cc_validation->cc_expiry_month;
$this->cc_expiry_year = $cc_validation->cc_expiry_year;
$this->cc_checkcode = $_POST['braintree_cc_checkcode'];
}
/**
* Display Credit Card Information for review on the Checkout Confirmation Page
*/
Bookmarks