function commerce_paypal_avs_code_message in Commerce PayPal 7.2
Same name and namespace in other branches
- 7 commerce_paypal.module \commerce_paypal_avs_code_message()
Returns an appropriate message given an AVS code.
1 call to commerce_paypal_avs_code_message()
- commerce_paypal_wpp_submit_form_submit in modules/
wpp/ commerce_paypal_wpp.module - Payment method callback: checkout form submission.
File
- ./
commerce_paypal.module, line 505 - Implements PayPal payment services for use with Drupal Commerce.
Code
function commerce_paypal_avs_code_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.');
case 'Null':
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');
default:
return t('An unknown error occurred.');
}
}