Adding a new real time shipping issues

hi guys i wanna add a my local shiping company (sedex) … i have all their informations like variables and adress to post … i also tried in a diferrent ways … but no sucess.



i also tried to get some instruction from support but they try to make you hire them … they don´t help with any guideline or documentation.



Here what i have :



sedex variables (my local company ) => cs-cart variables



‘cepOrigem’ => (!empty($substitution_settings) ? $substitution_settings[‘zipcode’] : $settings[‘Company’][‘company_zipcode’]),

‘cepDestino’ => $location[‘zipcode’],

‘servico’ => $code,

‘peso’ => ($weight_data[‘full_pounds’] * 453.6), ( i use KG)



adress to post (it´s a xml answer) :



[url]Correios



Service codes :



#

FRETE PAC = 41106

#

FRETE SEDEX = 40010

#

FRETE SEDEX 10 = 40215

#

FRETE SEDEX HOJE = 40290

#

FRETE E-SEDEX = 81019

#

FRETE MALOTE = 44105

#

FRETE NORMAL = 41017

#

SEDEX A COBRAR = 40045


What i did ?

I got australian post and tried to transforme i changed aup_codes to sedex service codes.

and gto this script :

//
// $Id: australia_post.php 3938 2007-09-14 07:57:34Z zeke $
//

if ( !defined('IN_CSCART') ) { die('Access denied'); }

function fn_get_aup_rates($code, $weight_data, $location, $substitution_settings = array())
{
global $settings, $auth, $db_tables, $shipping_settings;


$request = array (
'cepOrigem' => (!empty($substitution_settings) ? $substitution_settings['zipcode'] : $settings['Company']['company_zipcode']),
'cepDestino' => $location['zipcode'],
'peso' => ($weight_data['full_pounds'] * 453.6),
'servico' => $code,
'MaoPropria'=>'N',
'avisoRecebimento'=>'N',
'resposta'=>'xml',

);

list ($header, $result) = fn_http_request('GET', 'http://www.correios.com.br/encomendas/precos/calculo.cfm', $request);

if (!empty($result)) {

$doc = new DOMDocument();

$result = str_replace('',"",$result);
$result = html_entity_decode($result);
$result = utf8_encode($result);

$doc->loadXML($result);

if ($doc->getElementsByTagName("codigo")->item(0)->nodeValue=="0") {

number_format($number, 2, ',', ' ');

return array("cost"=>number_format($doc->getElementsByTagName("preco_postal")->item(0)->nodeValue,2,",","."));

} else {

return array("error"=>$doc->getElementsByTagName("descricao")->item(0)->nodeValue);

}


} else {

return "Não foi possível completar a sua requisição!";

}

return false;
}

?>

I already tried diferent ways, serached at forum .. tried cs-cart support but without any sucess ..

sedex page with realtime working : [url]http://www.correios.com.br/encomendas/precos/[/url]

Any one can help me to figure out that ?

Thanks
Mike