You are here

function _uc_paypal_build_error_messages in Ubercart 6.2

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

Builds error message(s) from PayPal failure responses.

1 call to _uc_paypal_build_error_messages()
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 495
Integrates various PayPal payment services and Instant Payment Notifications (IPN) with Ubercart!

Code

function _uc_paypal_build_error_messages($nvp_response) {
  $code = 0;
  $message = '';
  while (array_key_exists('L_SEVERITYCODE' . $code, $nvp_response)) {
    $message .= '<br /><b>' . check_plain($nvp_response['L_SEVERITYCODE' . $code]) . ':</b> ' . check_plain($nvp_response['L_ERRORCODE' . $code]) . ': ' . check_plain($nvp_response['L_LONGMESSAGE' . $code]);
    $code++;
  }
  return $message;
}