Exemple #1
0
 /** 
  @param $errorCode error code contstant from paycardLib.php
 
  Set CoreLocal::["boxMsg"] appropriately for
  the given error code. I find this easier
  than manually setting an appropriate message
  every time I return a common error like
  PaycardLib::PAYCARD_ERR_NOSEND. I think everything but
  PaycardLib::PAYCARD_ERR_PROC can have one default message
  assigned here
 */
 public function setErrorMsg($errorCode)
 {
     switch ($errorCode) {
         case PaycardLib::PAYCARD_ERR_NOSEND:
             CoreLocal::set("boxMsg", PaycardLib::paycard_errorText("Internal Error", $errorCode, "", 1, 1, 0, 0, 1, CoreLocal::get("paycard_type")));
             break;
         case PaycardLib::PAYCARD_ERR_COMM:
             CoreLocal::set("boxMsg", PaycardLib::paycard_errorText("Communication Error", $errorCode, "", 1, 1, 0, 0, 0, CoreLocal::get("paycard_type")));
             break;
         case PaycardLib::PAYCARD_ERR_TIMEOUT:
             CoreLocal::set("boxMsg", PaycardLib::paycard_errorText("Timeout Error", $errorCode, "", 0, 0, 0, 1, 0, CoreLocal::get("paycard_type")));
             break;
         case PaycardLib::PAYCARD_ERR_DATA:
             CoreLocal::set("boxMsg", PaycardLib::paycard_errorText("System Error", $errorCode, "", 0, 0, 0, 1, 1, CoreLocal::get("paycard_type")));
             break;
         default:
             CoreLocal::set("boxMsg", PaycardLib::paycard_errorText("Internal Error", $errorCode, "", 1, 1, 0, 0, 1, CoreLocal::get("paycard_type")));
             break;
     }
     return $errorCode;
 }