tags:

views:

356

answers:

2

ship file is:

include('fedexdc.php');

// create new fedex object
//$fed = new FedExDC('FedEx ACC #','Meter #');
$fed = new FedExDC('...','...'); // removed possible personal data

$ship_data = array(
75=> 'LBS'
,16=> 'Ma'
,13=> ''
,5=> ''
,1273=> '01'
,1274=> '01'
,18=> ''
,15=> 'Boston'
,23=> '1'
,9=> '02134'
,183=> ''
,8=> 'MA'
,117=> 'US'
,17=> ''
,50=> 'US'
,4=> 'Vermonster LLC'
,7=> 'Boston'
,1369=> '1'
,12=> ''
,1333=> '1'
,1401=> '1.0'
,116 => 1
,68 => 'USD'
,1368 => 1
,1369 => 1
,1370 => 5
,3025 => 'FDXG' // This I have added
);

// Ship example
$ship_Ret = $fed->ship_express($ship_data);

if ($error = $fed->getError()) {
echo "ERROR :". $error;
} else {
// Save the label to disk
$fed->label('mylabel.png');

}


/* tracking example

$track_Ret = $fed->track(
array(
29 => 790344664540,
));

*/



echo $fed->debug_str. "\n<BR>";
echo "Price ".$ship_Ret[1419];

Could any one explain What is FEDEX ACC # and Meter #

Any help will appreciable...

Thanks in Advance

Fero

A: 

Hi,

What about adding something like this to your _sendCurl() function :

curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);

After the call to curl_init, and before curl_exec -- should be the easiest way to get rid of that kind of error ; even if probably not the most secure one...

This article might be a good read : Curl: SSL certificate problem, verify that the CA cert is OK : it explains why the error, and also gives some explanations on the kind of security risk the two lines I posted imply -- and also gives some probably safer solution.

Pascal MARTIN
I tried it Martin... No changes occurred. Same Error is thrown again... Is there any way?
Fero
its working.. But i am in need to know what is FedEX Account Number and Meter NUMBER... Will you please explain.. And will you guide me to get those numbers.. Thanks
Fero
I have absolutly no idea, actually : I suppose the account number is something you get when you register for an account, or something like that -- was there any kind of API documentation with the class you're using ?
Pascal MARTIN
+2  A: 

It looks like you are trying to implement the old school Fedex API method of communication. The type of string you are using is called Tagged format. That is going away at some point in the next couple of years and Fedex will not provide a meter for that type of application. Fedex has implemented and new API solution called Fedex Web Services It uses XML formatted strings. Take a look at the new Fedex Web Services @ www.fedex.com/developer. You can get a Web Services meter there and also some sample code to get you started. You want to navigate to the technical Resources section of the Developer Resource Center. Find the "Get Started" page.

Paul M