function M_ReturnStatus(&$conn, $id)
 {
     $tran =& M_findtranbyid($conn, $id);
     if ($tran === false) {
         return false;
     }
     /* Invalid ptr, or transaction has not returned */
     if ($tran['status'] != M_TRAN_STATUS_DONE) {
         return M_ERROR;
     }
     if ($tran['comma_delimited'] == true) {
         return M_SUCCESS;
     }
     $code = M_ResponseParam($conn, $id, "code");
     if (strcasecmp($code, "AUTH") == 0 || strcasecmp($code, "SUCCESS") == 0) {
         return M_SUCCESS;
     }
     return M_FAIL;
 }
function MCVE_GetUserParam(&$conn, $id, $key)
{
    return M_ResponseParam($conn, $id, $key);
}
 private function parseKeyValueResponse($identifier)
 {
     $keys_and_values = array();
     $keys = M_ResponseKeys($this->conn, $identifier);
     if ($keys === false) {
         throw new MonetraException(__('Specified transaction does not exist or is not yet completed.'));
     }
     for ($i = 0; $i < count($keys); $i++) {
         $key = $keys[$i];
         try {
             $param = M_ResponseParam($this->conn, $identifier, $key);
             if ($param === false) {
                 throw new MonetraException(__(sprintf('Could not retrieve param "%s" for transaction "%s".', $key, $identifier)));
             }
             $keys_and_values[$key] = $param;
         } catch (\Exception $e) {
             continue;
         }
     }
     return $keys_and_values;
 }