You are here

function _uc_paypal_avscode_message in Ubercart 6.2

Same name and namespace in other branches
  1. 5 payment/uc_paypal/uc_paypal.module \_uc_paypal_avscode_message()
  2. 7.3 payment/uc_paypal/uc_paypal.module \_uc_paypal_avscode_message()

Returns a human readable message for the AVS code.

1 call to _uc_paypal_avscode_message()
uc_paypal_wpp_charge in payment/uc_paypal/uc_paypal.module
Processes a credit card payment through Website Payments Pro.

File

payment/uc_paypal/uc_paypal.module, line 1151
Integrates various PayPal payment services and Instant Payment Notifications (IPN) with Ubercart!

Code

function _uc_paypal_avscode_message($code) {
  if (is_numeric($code)) {
    switch ($code) {
      case '0':
        return t('All the address information matched.');
      case '1':
        return t('None of the address information matched; transaction declined.');
      case '2':
        return t('Part of the address information matched.');
      case '3':
        return t('The merchant did not provide AVS information. Not processed.');
      case '4':
        return t('Address not checked, or acquirer had no response. Service not available.');
      default:
        return t('No AVS response was obtained.');
    }
  }
  switch ($code) {
    case 'A':
    case 'B':
      return t('Address matched; postal code did not');
    case 'C':
    case 'N':
      return t('Nothing matched; transaction declined');
    case 'D':
    case 'F':
    case 'X':
    case 'Y':
      return t('Address and postal code matched');
    case 'E':
      return t('Not allowed for MOTO transactions; transaction declined');
    case 'G':
      return t('Global unavailable');
    case 'I':
      return t('International unavailable');
    case 'P':
    case 'W':
    case 'Z':
      return t('Postal code matched; address did not');
    case 'R':
      return t('Retry for validation');
    case 'S':
      return t('Service not supported');
    case 'U':
      return t('Unavailable');
    case 'Null':
      return t('No AVS response was obtained.');
    default:
      return t('An unknown error occurred.');
  }
}